Defect #13631
closedGit 1.8.1.5: Permission denied
0%
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
Updated by Joe E about 12 years ago
I guess this could be in relation to #13592.
Updated by Etienne Massip about 12 years ago
Sorry, I don't see the relation with #13592?
Updated by Joe E about 12 years ago
When I requested the repository overview, a similar error message like in #13592 was displayed.
Updated by Etienne Massip about 12 years ago
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?
Updated by Joe E about 12 years ago
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.
Updated by Anonymous about 12 years ago
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) ?
Updated by Etienne Massip about 12 years ago
Looks more like a Gentoo package or Git itself issue, see https://bugs.gentoo.org/show_bug.cgi?id=460370.
Updated by Etienne Massip about 12 years ago
Etienne Massip wrote:
Looks more like a Gentoo package or Git itself issue, see https://bugs.gentoo.org/show_bug.cgi?id=460370.
Or Redmine has to set HOME but I don't know Redmine Git internals for well.
Updated by Joe E about 12 years ago
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.
Updated by Anonymous about 12 years ago
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.
Updated by Torsten Walluhn about 12 years ago
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.
Updated by Joe E about 12 years ago
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
Updated by Go MAEDA almost 4 years ago
- Status changed from New to Closed
- Resolution set to Invalid
It doesn't seem to be a problem with Redmine. Closing.