Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Permission Denied errors post upgrade to stash 2

Leon Wright December 5, 2012

I've upgrade 2 instances of stash, one at work and my personal one at home. Oddly the one at home results in this:

leon@bofh-sider:~/git/flux$ git pull origin master 
warning: unable to access '/root/.config/git/config': Permission denied
warning: unable to access '/root/.gitconfig': Permission denied
warning: unable to access '/root/.config/git/config': Permission denied
warning: unable to access '/root/.gitconfig': Permission denied
From ssh://gandalf:7999/SRV/flux
 * branch            master     -> FETCH_HEAD
Already up-to-date.

Which is a little odd. However pull/push/merge/branch etc all still work correctly. Nothing appears in the logs on the stash server.

The permissons on the usual directories are correct:

chown -Rv jira /opt/atlassian/stast/work/
chown -Rv jira /opt/atlassian/stast/logs/
chown -Rv jira /opt/atlassian/stast/temp/
chown jira -Rv /var/atlassian/application-data/stash/

I Have stash/jira on the same box, both running as the jira user. The instance at work is working correctly. Any ideas where I can look next? Does the same for HTTP + SSH.

Both boxes are Ubuntu 12.04 amd64.

Edit: git version 1.8.0

7 answers

1 accepted

2 votes
Answer accepted
Leon Wright December 5, 2012

Although I'd set the stash user, something weird was going on. Set my init script to su to the jira user first and the error went away.

su jira -c ./start-stash.sh

Weird, but it's just the home setup so I'll just leave it at that!

1 vote
Chris Gruszka June 24, 2014

We saw
remote: warning: unable to access '/root/.config/git/attributes': Permission denied
running Git client version 1.9.4.msysgit.0 from git-scm.comand Stash 3.0.4.

If Stash 3.0.4 tries to switch to the $STASH_USER,
[root init.d]# ./atlstash restart
it starts with "Starting Atlassian Stash as dedicated user atlstash"
git clone displays:
"remote: warning: unable to access '/root/.config/git/attributes': Permission denied"

Switching to the dedicated user first resolves the warning.

[root init.d]# su atlstash
[atlstash /]# cd /etc/init.d
[atlstash init.d]$ ./atlstash restart
starts with "Starting Atlassian Stash as current user"

git clone does not display the remote warning

Hopefully Atlassian will fix how start-stash.sh switches the user. We are running Stash on RHEL.

1 vote
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2012

It looks like the problems you're seeing are all on the git client, not on the Stash server. When you do a git pull, git tries to read config settings from a variety of paths and apparently you don't have access to some of the configured paths.

git uses the HOME and XDG_CONFIG_HOME environment settings to lookup the config files. I'd check whether either of these has accidentally been set to /root/.

Leon Wright December 5, 2012

I was thinking along those lines, but it occurs even as a root user doing a fresh clone:

root@gandalf:~/git# git clone http://lwright@gandalf:7990/scm/SRV/flux.git
Cloning into 'flux'...
Password for 'http://lwright@gandalf:7990': 
remote: warning: unable to access '/root/.config/git/config': Permission denied
remote: warning: unable to access '/root/.gitconfig': Permission denied
remote: warning: unable to access '/root/.config/git/config': Permission denied
remote: warning: unable to access '/root/.gitconfig': Permission denied
remote: warning: unable to access '/root/.config/git/config': Permission denied
remote: warning: unable to access '/root/.gitconfig': Permission denied
remote: warning: unable to access '/root/.config/git/attributes': Permission denied
remote: Counting objects: 3048, done.
remote: Compressing objects: 100% (2418/2418), done.
remote: Total 3048 (delta 1784), reused 809 (delta 450)
Receiving objects: 100% (3048/3048), 284.23 KiB, done.
Resolving deltas: 100% (1784/1784), done.

0 votes
Susan sparks September 15, 2014

@Chris Gruszka that was spot on. Just had to run ./bin/start-stash.sh as the atlstash user. Thanks!

 

0 votes
alexander_fortin September 10, 2013

Same problem here with fresh new installation of Stash. I thnk this should be considered a bug. Thanks a lot for pointing it out though!

0 votes
Mathias Lieber June 17, 2013

BTW, I had this problem without an upgrade. I had moved stash and jira from one server to another.

0 votes
Mathias Lieber June 17, 2013

I faced the same problem today. I set export XDG_CONFIG_HOME=/home/jira and started stash like you as user jira. Worked for me, though I am unsure whether this is a good solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events