cloning via http produces http 500 path/to/repo "not found" error
Jones, JonathanX
jonathanx.jones at intel.com
Mon Jan 30 21:11:46 UTC 2017
We think we may have traced this problem back to some odd permissions misconfiguration in the .hg folder that resulted in this behavior.
To answer Simon's questions, however:
Yes, the path exists on the server.
And yes, it was accessible by the account that runs the web server process (in our case IIS).
And yes, the users whom it worked for were using the same command (hg clone).
To give a little more detail in case it helps someone:
The problem seemed to stem from some anomalous permissions on files such as .hg/undo.bookmarks and other files in the .hg folder which perhaps stem from a misconfiguration of the server itself (inherited CREATOR OWNER permissions propagating which would sometimes cause repository permissions to not conform to how they should have been configured).
It's beyond the scope of this conversation really to really delve into the server misconfiguration, but suffice it to say, once the .hg folder permissions were corrected on all files and sub-folders, the problems ceased.
FYI, it was not obvious that the individual file permissions were wrecked until we started checking them one by one-- the child folders seemed to be set to inherit permissions.
Again, I hope that helps others using Mercurial on Windows.
Regards,
Jon
-----Original Message-----
From: Simon King [mailto:simon at simonking.org.uk]
Sent: Monday, 30 January, 2017 01:34
To: Jones, JonathanX <jonathanx.jones at intel.com>
Cc: mercurial at mercurial-scm.org
Subject: Re: cloning via http produces http 500 path/to/repo "not found" error
On Wed, Jan 25, 2017 at 10:13 PM, Jones, JonathanX <jonathanx.jones at intel.com> wrote:
> When some users try to clone a repo using the web url, they receive an
> error such as:
>
>
>
> “abort: HTTP Error 500: repository D:\repos\ repository1 not found”
>
>
>
> But if they use the UNC path (we’re hosting Mercurial on Windows
> Server 2k8 by the way), it works fine.
>
>
>
> Traceback (anonymized):
>
>
>
> C:\Users\username\Desktop\repos\REPO>hg clone
> https://username@serverurl.com/in
>
> dex.py/REPO . --debug --traceback
>
> using https://serverurl.com/index.py/REPO
>
> http auth: user username, password not set
>
> sending capabilities command
>
> serverurl.com certificate matched fingerprint []
>
> [HgKeyring] Keyring URL: https://serverurl.com/index.py/REPO
>
> [HgKeyring] Looking for password for user username and url
> https://serverurl.c
>
> om/index.py/REPO
>
> [HgKeyring] Keyring password found. Url:
> https://serverurl.com/index.py/REPO,
>
> user: username, passwd: ***********
>
> serverurl.com certificate matched fingerprint []
>
> Traceback (most recent call last):
>
> File "mercurial\dispatch.pyo", line 140, in _runcatch
>
> File "mercurial\dispatch.pyo", line 850, in _dispatch
>
> File "mercurial\dispatch.pyo", line 611, in runcommand
>
> File "mercurial\dispatch.pyo", line 941, in _runcommand
>
> File "mercurial\dispatch.pyo", line 912, in checkargs
>
> File "mercurial\dispatch.pyo", line 847, in <lambda>
>
> File "mercurial\util.pyo", line 677, in check
>
> File "mercurial\commands.pyo", line 1371, in clone
>
> File "mercurial\hg.pyo", line 304, in clone
>
> File "mercurial\hg.pyo", line 138, in peer
>
> File "mercurial\hg.pyo", line 115, in _peerorrepo
>
> File "mercurial\httppeer.pyo", line 264, in instance
>
> File "mercurial\httppeer.pyo", line 58, in _fetchcaps
>
> File "mercurial\httppeer.pyo", line 172, in _call
>
> File "mercurial\httppeer.pyo", line 119, in _callstream
>
> File "urllib2.pyo", line 410, in open
>
> File "urllib2.pyo", line 523, in http_response
>
> File "urllib2.pyo", line 442, in error
>
> File "urllib2.pyo", line 382, in _call_chain
>
> File "urllib2.pyo", line 897, in http_error_401
>
> File "mercurial\url.pyo", line 452, in http_error_auth_reqed
>
> File "hgext\mercurial_keyring.pyo", line 400, in
> basic_http_error_auth_reqed
>
> File "urllib2.pyo", line 872, in http_error_auth_reqed
>
> File "mercurial\url.pyo", line 463, in retry_http_basic_auth
>
> File "urllib2.pyo", line 410, in open
>
> File "urllib2.pyo", line 523, in http_response
>
> File "urllib2.pyo", line 448, in error
>
> File "urllib2.pyo", line 382, in _call_chain
>
> File "urllib2.pyo", line 531, in http_error_default
>
> HTTPError: HTTP Error 500: repository D:\Repositories\REPO not found
>
> abort: HTTP Error 500: repository D:\Repositories\REPO not found
>
>
Hi,
Does the path from the error message actually exist on the server? Is it accessible by the user account that runs the web server process?
You say that this only affects some users, which seems surprising since this looks like a server misconfiguration. Are you sure that the users for which it *does* work are running the exact same command?
Simon
More information about the Mercurial
mailing list