sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

User friendly error messages in git fetch failures #47548

Open indradhanush opened 1 year ago

indradhanush commented 1 year ago

Quoting @mrnugget from Slack:

What we show is not cloneable: context deadline exceeded and failed to update: exit status 128 but then the underlying problems are something like Repository not found\nThe requested repository does not exist, or you do not have permission to access it. or failed to fetch repo \"<redacted>/manage\": failed to update with output \"fatal: remote error: want f3ae9d7d680c42ae95ad9bb17cc13b14197e2757 not valid\\nfatal

We should probably simulate these errors in the deepest part of the stack (for example: overwrite PATH so a false git is called in which we can produce errors/timeouts) and then see how they bubble up.

/cc @ryphil


On site-admin repos page:

screenshot_2023-02-13_15 58 49@2x

On repository settings page: screenshot_2023-02-13_15 59 41@2x

Cloning message are a bit better but not that much better:

screenshot_2023-02-13_16 01 53@2x
rakeshjosh2003 commented 1 year ago

Similar issue is faced recently with one of the customer, where no relevant details were shown in the logs even enabling debug options , the error only displays

error":"failed to fetch repo \"<redacted>/source\": failed to update: exit status 128"}

Customer account Slack thread