Project

General

Profile

Actions

Defect #13631

closed

Git 1.8.1.5: Permission denied

Defect #13631: Git 1.8.1.5: Permission denied

Added by Joe E over 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
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

Updated by Joe E over 13 years ago Actions #1

I guess this could be in relation to #13592.

Updated by Etienne Massip over 13 years ago Actions #2

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

Updated by Joe E over 13 years ago Actions #3

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

Updated by Etienne Massip over 13 years ago Actions #4

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 over 13 years ago Actions #5

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 over 13 years ago Actions #6

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 over 13 years ago Actions #7

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

Updated by Etienne Massip over 13 years ago Actions #8

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 over 13 years ago Actions #9

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 over 13 years ago Actions #10

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: 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 over 13 years ago Actions #11

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 over 13 years ago Actions #12

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 over 5 years ago Actions #13

  • 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: PDF Atom