Skip to content

Packages: gracefully handle 403 errors when fetching packages

Created by: olafurpg

Many Rust crates are currently failing to "clone" due to 403 errors https://sourcegraph.com/site-admin/repositories?status=failed-fetch

CleanShot 2022-07-22 at 14 17 58

These crates have in common that they don't exist on crates.io, for example https://crates.io/crates/alloc

CleanShot 2022-07-22 at 14 18 23

We should gracefully handle errors like this so that the Sourcegraph repos don't have a "failed fetch" status. Candidates solutions include

  • silently ignore 403 errors
  • create the repos with a readme.md that includes the error message, this would make it easier for site admins to troubleshoot the issue
  • delete the crate versions from lsif_dependency_repos so that we stop trying to fetch the crate versions that error