Mercurial push, abort: authorization failed

I'm having trouble clicking on the mercurial repository:

$ hg push pushing to https://user:***@hg.domain.com/X_repo searching for changes abort: authorization failed 

The same URL (with the same credentials) is accessible through a web browser. Also, I tried this without inserting usr + pass in the url.

HTTPS is configured correctly, I tried both Basic and Digest auth - with no luck.

Pulling (over HTTP) works fine.

I use hgwebdir to service my repo.

What else should I check?

I found this: http://code.google.com/p/support/issues/detail?id=2580 In my case, this is not random, it happens every time.

The relevant part of my vhost conf:

  WSGIScriptAlias / /home/(...)/hgwebdir.wsgi <Directory /home/(...)> AuthType Basic AuthUserFile /(...)/basic-password AuthName (...) Require valid-user Order deny,allow Allow from all </Directory> $ hg -v Mercurial Distributed SCM (version 1.0.2) 

Oddly enough, hg outgoing works fine:

 $ hg outgoing comparing with https://hg.domain.com/X_repo http authorization required realm: ... user: ... password: searching for changes changeset: 64:... tag: tip user: ... date: ... summary: ... 
+41
repository mercurial apache apache2
Jun 03 '09 at 19:40
source share
7 answers

The problem turned out to be reporter. chown www-data decided ...

+18
Jun 05 '09 at 20:46
source share

If someone wants him to run on the local machine, then adding this to the REPO/.hg/hgrc , do the job:

 [web] allow_push = * push_ssl = false 

as described in this site .

+46
01 Oct '10 at 18:21
source share

It is strange that you can run hg outgoing but not hg push , as I understand that they both authenticate equally.

Unfortunately, I am not an hgweb expert. Email Mercurial list (mercurial@mercurial-scm.org) and / or go to IRC ( #mercurial on irc.freenode.net ). There will be many more people to help you there. IRC is especially good because these things are much easier to debug interactively.

+3
Jun 04 '09 at 6:57
source share

For those with TortoiseHg clicking on a web server (another unauthorized user on another PC):

In TortoiseHg: File - Settings - (Either globally or just for the current repository - tabs) then Server settings. Web server

 Push Requires SSL - No Allow Push - * 

This does the same through the user interface as the lukmdo answer above (editing the hgrc file).

+3
Apr 29 '13 at 7:08
source share

Just in case, this may help someone - I ran into this error for unknown reasons, all permissions were ok, and just restarting apache solved it.

+1
Aug 13 '10 at 9:50
source share

This happened to me after changing the password on the bitpack, but although I used SourceTree to manage my password and I changed it to a global one repo, however, my old password, hardcoded in REPO/.hg/hgrc , changed the line and that's it works again

0
Mar 17 '14 at 18:56
source share

My problem was a little different. Changing the password caused it ... And I had repo/.hgrc and repo/.hg/hgrc . I don’t know why, but this is contradictory.

For recording, the cleanest way I've found is to save the global configuration file (on Windows C:\Users\<user>\mercurial.ini or Linux /home/<user>/.hgrc ) with all the configuration that applies to all to repositories (profiles, plugins / extensions, repositories, etc.) and then behind the repo, just use something like:

 [paths] default = https://path/to/remote/repo # any other repo-specific config 

Why I had another repo-specific mercurial configuration file, I don’t know, now everything is cleaned up and works beautifully.

0
May 24 '16 at 21:12
source share



All Articles