Chase
Chase

Reputation: 81

HG Push Failed; Permission denied .hg/store/lock

I have been trying to setup a mercurial repository on my server so that my team can work from theirs. I am running Ubuntu server 10.4 and I did the install of mercurial using apt-get. Now this all went smoothly.

I init a dir with hg just fine, I setup the hgrc as follows:

[web]
push_ssl = False
allow_push = *

[trusted]
users = *
groups=

then I run hg serve. The server begins listening. I can clone this repository to another computer but when I try and push my changes i get the error:

C:\Users\UserName\Project1>hg push http://MyInternalIP:8000
pushing to http://MyInternalIP:8000
searching for changes
abort: HTTP Error 500: Internal Server Error

On the server side I get the following error:

LockUnavailable: [Errno 13] Permission denied: '/home/UserName/projects/Project1/.hg/store/lock'

If anyone has a solution to how to fix this that would be amazing. I have googled and found people with similar issues and they say that it may have something to do with the web user not having permissions but I am new to all of this and none of them give solutions on how to fix the issue. Thanks for your time.

Upvotes: 8

Views: 8765

Answers (2)

Maske
Maske

Reputation: 864

In my case with mercurial repository on redmine

HTTP Error: 500 (Permission denied)

Run

chown -R www-data /path/to/repos

on the server, it worked for me.

(Fuente)

Upvotes: 3

Carles Barrobés
Carles Barrobés

Reputation: 11683

You must allow write access to the repository directories to the user running the Mercurial server process. I.e the user account running hg serve must be able to write to /home/UserName/projects/Project1/

BTW can you provide more details as to what command line you used to clone the repository?

Upvotes: 10

Related Questions