Use more friendly error message when a repository can not be accessed #8331

Closed
opened 2025-11-02 08:02:35 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wxiaoguang on GitHub (Jan 10, 2022).

Now, if users access an invalid repository (non-existing, renamed, etc), they would see:

$ git fetch
Gitea: Internal Server Error
Gitea: Internal Server Error
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The Internal Server Error is quite misleading and there is a error level message in Gitea log:

...ters/private/serv.go:114:ServCommand() [E] Unable to get repository owner: org-name/repo-name Error: user does not exist [uid: 0, name: org-name, keyid: 0]

Since such case is not an serious error, users should not see the Internal Server Error or the error level log messages.

Originally created by @wxiaoguang on GitHub (Jan 10, 2022). Now, if users access an invalid repository (non-existing, renamed, etc), they would see: ``` $ git fetch Gitea: Internal Server Error Gitea: Internal Server Error fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` The `Internal Server Error` is quite misleading and there is a error level message in Gitea log: ``` ...ters/private/serv.go:114:ServCommand() [E] Unable to get repository owner: org-name/repo-name Error: user does not exist [uid: 0, name: org-name, keyid: 0] ``` Since such case is not an serious error, users should not see the `Internal Server Error` or the error level log messages.
GiteaMirror added the type/enhancement label 2025-11-02 08:02:35 -06:00
Author
Owner

@lunny commented on GitHub (Jan 10, 2022):

We should say the repository is not exist or you have no access to this repository.

@lunny commented on GitHub (Jan 10, 2022): We should say the repository is not exist or you have no access to this repository.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8331