Defect #13631
closed
Git 1.8.1.5: Permission denied
Added by Joe E about 12 years ago.
Updated almost 4 years ago.
Description
After upgrading Git from 1.7.12.4 to 1.8.1.5, I got the following error message:
log/production.scm.stderr.log
warning: unable to access '/root/.config/git/config': Permission denied
warning: unable to access '/root/.gitconfig': Permission denied
I got this error with Redmine 2.2.2 and 2.3.0 (haven't tried other versions). A downgrade back to Git 1.7.12.4 solved this issue.
My system: Ruby 1.9.3 (latest patch), Rails 3.2.13, RVM, Gentoo Linux
I guess this could be in relation to #13592.
Sorry, I don't see the relation with #13592?
When I requested the repository overview, a similar error message like in #13592 was displayed.
Joe E wrote:
When I requested the repository overview, a similar error message like in #13592 was displayed.
If you mean "Internal server error", it's a very common message.
Do you mean you have ActiveRecord::RecordNotUnique message in your production.log
file?
Or what do you see in this file at the time an error is raised?
Do you have plugins installed?
No, but a similar error was displayed in my browser. The production.log
isn't very verbose:
Started GET "/projects/myproject/repository" for 127.0.0.1 at 2013-03-28 19:46:52 +0100
Processing by RepositoriesController#show as HTML
Parameters: {"id"=>"myproject"}
Current user: myuser (id=1)
Rendered common/error.html.erb within layouts/base (0.6ms)
Completed 404 Not Found in 222ms (Views: 17.9ms | ActiveRecord: 2.1ms)
But as mentioned above, the production.scm.stderr.log
gave more information. This problem does only occur with Git 1.8.1.5, 1.7.12.4 works without problems.
warning: unable to access '/root/.config/git/config': Permission denied
warning: unable to access '/root/.gitconfig': Permission denied
I don't use any plugins.
So what are the permissions on /root/.config/git/config and /root/.gitconfig, and what user / group owns them? Is your new git binary able to access these files when executed by Redmine (and thus running under the uid / gid used for executing redmine) ?
Max Horn wrote:
So what are the permissions on /root/.config/git/config and /root/.gitconfig, and what user / group owns them? Is your new git binary able to access these files when executed by Redmine (and thus running under the uid / gid used for executing redmine) ?
I don't use Git under root, so /root/.config/git/config
and /root/.gitconfig
don't exist. The Git repository is readable by the Redmine user.
Yeah, no surprise. It means that git is being run under the wrong uid resp. env, and so it sounds indeed as if this was caused by that Gentoo bug Etienne mentioned.
Etienne E: Changing Redmine to set HOME for git is probably not a terribly good idea; in particular, what should it set HOME to? It seems much more likely that this is a bug in the Gentoo git package anyway.
Hi,
I've had the same issue and fixed it with a simple shell wrapper.
#!/bin/sh
HOME="/home/redmine" git $@
You save this file somewhere who your redmine user has access too and configured it as git command in your redmine configuration.
Torsten Walluhn wrote:
I've had the same issue and fixed it with a simple shell wrapper.
[...]
You save this file somewhere who your redmine user has access too and configured it as git command in your redmine configuration.
+1
- Status changed from New to Closed
- Resolution set to Invalid
It doesn't seem to be a problem with Redmine. Closing.
Also available in: Atom
PDF