Oops! fatal: unable to access '/root/.config/git/config': Permission denied

9,640 views
Skip to first unread message

Mika Epstein

unread,
May 8, 2013, 1:00:41 AM5/8/13
to git...@googlegroups.com
I am flummoxed.

Oops! fatal: unable to access '/root/.config/git/config': Permission denied

It was working, I upgraded PageSpeed, wandered back to GitList, and now when I try to view a repo, I see that. I rolled back PageSpeed, nothing. I bounced apache, nothing.

I reinstalled GitList from source (running latest and greatest), using Git 1.8.2.2 on CentOS 6 (self installed).

Git is working just fine, by the way. Add files, commit, pull, push, merge, etc. It's all good.

I'm just at a loss as to what the heck happened here :( Why is it looking in /root/ ? How can I overcome it? I'm guessing this is actually a git setup error, but I'm a rookie and have no idea where to look.

Klaus Silveira

unread,
May 8, 2013, 7:35:43 PM5/8/13
to git...@googlegroups.com
Where are you repositories located? Where is your GitList installation located? Can you send your config.ini? Are you using Apache or Nginx?

--
You received this message because you are subscribed to the Google Groups "GitList" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitlist+u...@googlegroups.com.
To post to this group, send email to git...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/gitlist/-/62WU8iC46TYJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Klaus Silveira
(011) 8564-2492
www.klaussilveira.com

Mika Epstein

unread,
May 8, 2013, 7:49:11 PM5/8/13
to git...@googlegroups.com, con...@klaussilveira.com
Repositories are in /home/username/repositories/

GitList is in /home/username/public_html/git/gitlist (accessible at git.example.com/gitlist behind a .htaccess password protection)


I tried using /home/username/repositories/ as my path to repos, but it wouldn't believe me. Same owners for the folders/files, though. Webpage and repos are all owned by the username.

Running Apache 2.2

Thank you!

javi....@degestec.com

unread,
May 13, 2013, 6:49:28 AM5/13/13
to git...@googlegroups.com, con...@klaussilveira.com
Same problem here with similar scenario.

My gitlist is at /var/www/gitlist/.
My repos are at /git/.
All is owned by apache:apache, 660 for files, 755 for dirs (except cache that is 770 ).

I don't know why Gitter is trying to access files that belong to root user.

I set debug = true in config.ini and this is the full error

RuntimeException: fatal: unable to access '/root/.config/git/config': Permission denied

  1. in /var/www/gitlist/vendor/klaussilveira/gitter/lib/Gitter/Client.php line 139
  2. at Client->run(object(Repository), 'branch') in /var/www/gitlist/vendor/klaussilveira/gitter/lib/Gitter/Repository.php line 162
  3. at Repository->getBranches() in /var/www/gitlist/vendor/klaussilveira/gitter/lib/Gitter/Repository.php line 194
  4. at Repository->hasBranch('master') in /var/www/gitlist/vendor/klaussilveira/gitter/lib/Gitter/Repository.php line 403
  5. at Repository->getHead() in /var/www/gitlist/src/GitList/Controller/TreeController.php line 21
  6. at TreeController->GitList\Controller\{closure}('doc.git') in /var/www/gitlist/src/GitList/Controller/TreeController.php line 79
  7. at TreeController->GitList\Controller\{closure}('doc.git')
  8. at call_user_func_array(object(Closure), array('doc.git')) in /var/www/gitlist/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 129
  9. at HttpKernel->handleRaw(object(Request), '1') in /var/www/gitlist/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 73
  10. at HttpKernel->handle(object(Request), '1', true) in /var/www/gitlist/vendor/silex/silex/src/Silex/Application.php line 509
  11. at Application->handle(object(Request)) in /var/www/gitlist/vendor/silex/silex/src/Silex/Application.php line 484
  12. at Application->run() in /var/www/gitlist/index.php line 10

My gitlist is a

Darko Luketic

unread,
Jun 18, 2013, 6:00:20 PM6/18/13
to git...@googlegroups.com, con...@klaussilveira.com
Same here.

the solution in my case, maybe it will help someone,
I'm running uwsgi (1.9.12) in emperor mode
and since it is ran as root and dropping privileges to the user and group passes the root's environment
the HOME environment variable was set to /root
so it looked at /root/.gitconfig or /root/.config/git/config
since the unprivileged user didn't have access to /root
it threw an error.

So the solution was for me to set the HOME env to the user's HOME directory

javi....@degestec.com

unread,
Jun 19, 2013, 6:50:00 AM6/19/13
to git...@googlegroups.com, con...@klaussilveira.com
Thanks Darko.

Your solution worked for me too. I just added

    putenv("HOME=/var/www/gitlist");

to the index.php file and problem solved.

zoe chow

unread,
Jun 21, 2013, 5:56:34 AM6/21/13
to git...@googlegroups.com, con...@klaussilveira.com
Thanks Darko, the solution you supply is useful for the issue.
but what confuse me is that when I run the git on php file as a script:
such as :
php git_test.php.  there is not this issue.

but when i run it on web( web server is apache2.2) . this issue is happen.
and i print the getenv("HOME"). -_#. it is /root.
i can't understand what is the real reason for this issue.
Appreciate for any help!

在 2013年6月19日星期三UTC+8上午6时00分20秒,Darko Luketic写道:

Jose

unread,
Jul 19, 2013, 11:48:59 AM7/19/13
to git...@googlegroups.com, con...@klaussilveira.com

Thanks Darko and Javi for the details of the workaround. It solved this issue that appeared suddenly after months of using GitList.

Jose
Reply all
Reply to author
Forward
0 new messages