Skip to content

Download raw file fails on large repos

Created by: dadlerj

Reported by https://app.hubspot.com/contacts/2762526/company/693777200

We’ve had users report that download raw file is failing. I can reproduce it as well, we navigate to a file, click on the button and nothing seems to happen for 5-10 seconds. Then I see the download start and immediately fail. (Error message in Chrome is just ‘Failed - Server problem’). Any ideas?

And by 5-10 seconds, I really mean closer to a few minutes as I tried to actually time it and gave up.

Discussion in Slack at: https://sourcegraph.slack.com/archives/CHPC7UX16/p1587695598217700

Suggestion by @unknwon:

Are they having monorepo or huge repo? The way I see the current raw endpoint works is by first fetching an archive of the commit, then extract that single file from the archive. Pretty wasteful I would say… so could be timing out on fetch the ZIP archive.

Related: https://github.com/sourcegraph/sourcegraph/pull/9410, https://github.com/sourcegraph/sourcegraph/issues/9372, https://github.com/sourcegraph/sourcegraph/issues/1995