Project

General

Profile

Actions

Defect #13631

closed

Git 1.8.1.5: Permission denied

Added by Joe E about 11 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

Actions #1

Updated by Joe E about 11 years ago

I guess this could be in relation to #13592.

Actions #2

Updated by Etienne Massip about 11 years ago

Sorry, I don't see the relation with #13592?

Actions #3

Updated by Joe E about 11 years ago

When I requested the repository overview, a similar error message like in #13592 was displayed.

Actions #4

Updated by Etienne Massip about 11 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?

Actions #5

Updated by Joe E about 11 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.

Actions #6

Updated by Anonymous about 11 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) ?

Actions #7

Updated by Etienne Massip about 11 years ago

Looks more like a Gentoo package or Git itself issue, see https://bugs.gentoo.org/show_bug.cgi?id=460370.

Actions #8

Updated by Etienne Massip about 11 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.

Actions #9

Updated by Joe E about 11 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.

Actions #10

Updated by Anonymous about 11 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.

Actions #11

Updated by Torsten Walluhn about 11 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.

Actions #12

Updated by Joe E about 11 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

Actions #13

Updated by Go MAEDA almost 3 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

It doesn't seem to be a problem with Redmine. Closing.

Actions

Also available in: Atom PDF