Push a branch sometimes fails with Reference not found when triggering a pipeline
Context
Some customers have reported that pipelines are not triggered when pushing branch refs. In this case, branches are created but will not run pipelines. Pipeline triggering fails intermittently with a "Reference not found" error in Git::BranchHooksService.
What is the current bug behavior?
- Pipelines randomly fail to trigger when pushing to branches (5-10 times per day reported by customer).
- Sidekiq logs show Git::BranchHooksService throwing "Error creating pipeline" with "Reference not found" errors.
- Error occurs even when the branch reference clearly exists in the repository.
- Teams must manually push "null" changes to trigger pipelines as a workaround.
- Issue appears to be related to cache invalidation problems similar to issue #539287, but affects a different component in the pipeline creation process.
- Affects Self-Managed instances under normal load conditions.
What is the expected correct behavior?
- Pipelines should trigger consistently when pushing commits to branches.
- Git references should be properly found and validated during the pipeline creation process.
- Cache invalidation should not prevent pipeline triggering for valid branch references.
- No manual intervention should be required to trigger pipelines for legitimate pushes.
Edited by Javiera Tapia