How to troubleshoot a repo that is not being updated on Sourcegraph
A repository on Sourcegraph that fails to be updated could have different reasons. For example, the repository is a bad repository, the number of repositories causes significant load on the code host, a large repository, or code host permission issues etc. This guide will walk you through the steps you can take to investigate further when encountering this issue.
This document assumes that you are a site administrator and do not have
disableAutoGitUpdates set to
true in your site configuration.
Steps to investigate
- First of all, you should identify how long has it been since the repo was last updated on Sourcegraph by going to the repository page > Settings > Mirroring
- From there you can check:
- Last refreshed: Time when the repo was last synced
- Next scheduled update: Estimated time of when the repo will be updated next (this could change as it is determined by a smart heuristic)
- Queued for update: Its position in queue to be updated next
- Connection: Connection status to the repository
- If clicking on the
Refresh Nowbutton has triggered the repository to be updated instantly for you then congratulations! You can now move on from this troubleshooting guide!
- If clicking on the
Refresh Nowbutton does not work for you, try using webhooks following the instructions detailed in our Repository Webhooks Docs
- Look for errors related to this repository in gitserver logs, which should help you to determine the next best course of action.
What is a bad repository?
A bad repository is simiply a repository that Sourcegraph cannot handle. For example:
- A large repository
- This could result in gitserver running out of memory.
- An empty/locked/disabled repository
- For example, if you’ve created a repo repository GitHub and did not click the “initialize the repository for me” button, the repository would then become an empty repository as it has no commits at all.
- A corrupted repository
- The repository could be corrupted on the code host, or corrupted on disk.
Looks like Sourcegraph is trying to clone the same bad repository over and over again, what should I do?
Please upgrade your instance to 3.27.0 where the bug has been addressed.