0

I'm posting this question because googling gitlab bad object refs/pipelines/ found no similiar pages, and I think it is interesting to investigate.

There's no stable and minimal reproducible steps, just describe what happend. I have(the owner) a repo and with only single branch main, add has .gitlab-ci.yml to enable pipelines. Never added any pre or post hooks. Mainly use git for windows built in bash or git gui to pull and push. Everything goes smoothly until one day push got error like

Pushing to git.labs.hosting.of.mycompany:myrepo.git
remote: fatal: bad object refs/pipelines/2651688
fatal: bad object refs/pipelines/2651688
To git.labs.hosting.of.mycompany:myrepo.git
  ![remote rejected] main -> main (missing necessary objects)
error: failed to push some refs to 'git.labs.hosting.of.mycompany:myrepo.git'

The number 2651688 is the one of the most recent(not last one, and successful) pipelines of this repo. To my limited git knowledge, refs should mean something like branch, but I never create branch name like that. So I thought the repo state corrupted when running ci.

Tried cloning the repo to another folder and push directly, same issue. so seems not client side issue. Also tried push another repo in same group, no problem.

There's no special jobs changing the repo itself. By running git ls-remote for this problematic repo got many refs/keep-around/*, still don't see refs/pipelines/*

3ef2b1aba9f1493a039c18c978ae192143363ee6        HEAD
3ef2b1aba9f1493a039c18c978ae192143363ee6        refs/heads/main
064e56e78a6679ec570ad506e0b2f861dbada059        refs/keep-around/064e56e78a6679ec570ad506e0b2f861dbada059
...tens of refs/keep-around/*

Could anyone explain why this issue happens and could it be solved from client side? I'm not the gitlab owner so cannot do anything on server side repo directly. After a random housekeeping, i can push now. so i cannot reproduce the issue.

4
  • 1
    As a general rule: prefer pasting text over images. For a terminal window: you can easily select the content of the window, paste it in a text editor to remove the elements you don't want (e.g: search & replace the path prefix you want to hide) and paste that text in your question. Commented Jan 13, 2023 at 7:23
  • your second screenshot shows a succesful push. Is this the one you wanted to show ? Commented Jan 13, 2023 at 7:23
  • it is only to demonstrate i have correct client setup, for comparison. Commented Jan 13, 2023 at 8:23
  • 1
    i've updated with only text and removed the correct push one. Commented Jan 13, 2023 at 8:37

1 Answer 1

1

When you run git push, the lines pefixed with a remote: indicate they are executed on the server side, as part of a pre-receive hook for example. I'm not familiar enough with the standard actions run through a .gitlab-ci.yml, but I would say your first push happened at a moment when the remote repo wasn't in sync with some other gitlab data.


  • is this error persistent ? or does it go away with time ?

  • does it go away if you manually launch a new gitlab CI job, then run a git push ?

(these two questions would point to some issue with how the repo used by gitlab's jobs is synced with gitlab's data)

  • on your local clone: if you run git ls-remote, do you see references named refs/pipelines/... ?

do check the documentation for the actions you trigger from your .gitlab.yml.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for your reply. i have used gitlab ci for at least 2 years, should be familiar enough. and never experience this issue. just updated the question with contents of git ls-remote. any ideas? this error persists. however, when today i randomly did a housekeeping, i can push now. so i cannot reproduce the issue or do more investigating now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.