Page MenuHomePhabricator

Give more specific error when git clone fails
Closed, ResolvedPublic


Original user report: I've created a bot user that has access to a repository and is used to clone from inside a docker container.
I cost me hours to find out why i get the error message everytime:

Exception: No repository "XXX" exists!
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

The user has been added to a group that has access to the repo and I've also added the user directly to the repo. Everthing ends up in this error message.

The problem was: The user has no access to the Diffusion module...

It would be nice if that is noted in the error message.

To reproduce:

  • create a diffusion repository with restrictive access settings
  • try to git pull as a user who doesn't have access to the repository
  • get error message

Event Timeline

sascha-egerer raised the priority of this task from to Needs Triage.
sascha-egerer updated the task description. (Show Details)
sascha-egerer added a subscriber: sascha-egerer.

Isn't this a problem with Docker? ("Diffusion module" is some Docker thing of organizing Phabricator?)

If not, how could we reproduce this issue on this install?

Create a bot User that has Access to a Repository but not to Diffusion. Try to clone which will fail.

btrahan updated the task description. (Show Details)

Ah, okay. We call things applications here so its the "Diffusion application" or you can just say Diffusion.

I think I bungled the reproduction steps so feel free to clarify them.

Also, I am not sure this is fixable since we are returning a git response, and that's the git error message for this sort of thing. "Please make sure you have the correct access rights and the repository exists."

In Git, we get fairly good control over error messages, although less so in Subversion/Mercurial. We emit this particular message ourselves:

src/applications/diffusion/ssh/DiffusionSSHWorkflow.php:        pht('No repository "%s" exists!', $callsign))

The execute() method in that class could perform this test and throw a more relevant message earlier, although how it shows up on the client will vary from VCS to VCS.