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.