profile
viewpoint

Ask questionsBackup snapshotting of Sourcegraph instance might corrupt .git dirs

  • 3.12.6 <!-- the version of Sourcegraph or "Sourcegraph.com" -->
  • AWS linux intel EC2: docker-compose

Steps to reproduce:

  1. Follow https://docs.sourcegraph.com/admin/install/docker-compose/aws to create a sourcegraph instance
  2. Add one repo to it
  3. Create a snapshot of the volume: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-snapshot.html
  4. Create a second EC2 instance and for the volume choose to use the snapshot just created

Observe the repo .git directory in inconsistent state (if you're lucky and it reproduced)

image

Notes:

This doesn't seem to be AWS or docker-compose specific. Any snapshotting that happens while a git operation is in flight could potentially trigger this.

sourcegraph/sourcegraph

Answer questions slimsag

As for how this is failing, we can probably file another issue about making it fail nicely. For example if we set GIT_DIR then git won't do the discovery all the way up to /data and instead will fail with a better error message. Additionally we could look into making our janitor job more aggressively detect bad .git dirs. WDYT?

This SGTM

useful!

Related questions

Add loki to sourcegraph.com hot 1
Unable to clone GitLab repositories with self signed certificate hot 1
Github User Rank List