Details
Dear all,
my Phorge/Phabricator installation is unable to use "git" shell command. For example, when it tries to show history of repository, it fails:
Command failed with error #128! COMMAND git log --skip=0 -n 15 --pretty=format:'%H:%P' 79eb7fc914ea3b5936ea15a08af3154e7d2e1a36 -- STDOUT (empty) STDERR fatal: detected dubious ownership in repository at '/storage/phabricator/storage-repo/35' To add an exception for this directory, call: git config --global --add safe.directory /storage/phabricator/storage-repo/35
It returns the same error for all repositories (even for repos created today). What is strange, yesterday, all worked fine :-/
I tried to run the suggested command under several users (www-data, phab-daemon, root), so the directory is for sure marked as safe. I confirmed this from shell as the user "www-data" with:
git config --global --get-all safe.directory
Which return the directory as safe. Also, when run from command line as www-data user, it works fine:
$ git log --skip=0 -n 15 --pretty=format:'%H:%P' 79eb7fc914ea3b5936ea15a08af3154e7d2e1a36 -- 79eb7fc914ea3b5936ea15a08af3154e7d2e1a36:
File ownership is set as follows:
drwxr-sr-x 7 phab-daemon www-data 4096 feb 3 09:05 . drwxrwsr-x+ 23 www-data www-data 4096 feb 3 08:51 .. drwxr-sr-x 2 phab-daemon www-data 4096 feb 3 08:51 branches -rw-r--r-- 1 phab-daemon www-data 104 feb 3 09:05 config -rw-r--r-- 1 phab-daemon www-data 73 feb 3 08:51 description -rw-r--r-- 1 phab-daemon www-data 23 feb 3 09:05 HEAD drwxr-sr-x 3 phab-daemon www-data 4096 feb 3 08:51 hooks drwxr-sr-x 2 phab-daemon www-data 4096 feb 3 08:51 info drwxr-sr-x 7 phab-daemon www-data 4096 feb 3 08:54 objects drwxr-sr-x 4 phab-daemon www-data 4096 feb 3 08:51 refs
Do you have any idea, what can I do?
Answers
This error is shown if the user running git is operating on files that are not owned by that user. Double check your environment to verify this mismatch.
Note that Phorge/Phabricator runs git commands using something like sudo -u your-vcs-user git .... from the webserver user. So, it really tries to use the very same user you configured. So, if there is a mismatch, it's probably a problem of the system administrator.