Unable to https push (or push at all by http)
Tim Boudreau
tboudreau at sun.com
Sat Jun 20 15:45:45 CDT 2009
Hi,
I followed the instructions here
http://slucas.wikidot.com/en:hgweb-mod-python to get Mercurial 1.2.1 set up
with hgwebdir and being served by apache, on Gentoo 2.6.30. Web access and
http or https clone works fine. Pushing, however, is not working at all.
I'm hoping it's some simple configuration issue that will be obvious to
someone here.
It works fine for pulling; however, I've been tearing my hair out trying to
get http and (more ideally) https push working. It seems to be failing with
a 401 error in httprepo.py, line 81.
Things I've tried:
- Disable htaccess and all authentication from hgweb.conf so the repository
is wide open and http or https pushes from anyone should work.
- Tried pushing using both http and https with and without, both with and
without authentication and require ssl on
- Tried giving the main repository config and data directories
(/home/www/hg_config and /home/www/hg_root) world read-write access
None of this has worked. I cannot push over http/https. Here are the
gritty details - hopefully somebody here has been through this before:
The hg repository lives under the home/www/ user directory (which owns a few
java server processes that are proxied through apache [which runs as a
service as user "apache"]) - this gives me one place to back up all
server-related data.
The hgweb.conf file I'm using currently looks like this (as I mentioned, for
testing, I've cleared out pretty much all push restrictions):
[collections]
/ = /projects
#[paths]
#main/ = /home/www/hg_root/content/main
#stuff/ = /home/www/hg_root/content/stuff
[web]
style = gitweb
description = A place for my random creations
baseurl = /hg
push_ssl = true
contact = Tim Boudreau <tboudreau at sun.com>
allow_archive = bz2 gz zip war jar ear
allow_push = *
(/projects is a symlink to /home/www/hg_root/content - I'm just using it to
shorten the URLs, so you don't pull and push from
http://timboudreau.org/home/www/hg_root/content/*)
My current include file for httpd.conf that enables hg looks like
LocationMatch /hg/.*?>
AuthType Digest
AuthDigestProvider file
AuthUserFile /home/www/hg_config/.htaccess
AuthName "Tim's Mercurial Repository"
<LimitExcept GET OPTIONS>
Require valid-user
</LimitExcept>
PythonPath "sys.path + ['/home/www/hg_config/']"
PythonDebug On
SetHandler mod_python
PythonHandler modpython_gateway::handler
PythonOption SCRIPT_NAME /hg
PythonOption wsgi.application hgwebdir::test
Options ExecCGI FollowSymLinks Includes
Order deny,allow
Allow from all
</LocationMatch>
Here's a sample session from a remote machine w/ --debug and --traceback
enabled for the push:
tTim:test tim$ hg clone http://timboudreau.com/hg/projects/main
destination directory: main
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Tim:test tim$ cd main
Tim:main tim$ echo bar > bar
Tim:main tim$ hg addremove
adding bar
Tim:main tim$ hg commit --message "adding bar"
Tim:main tim$ hg --debug --traceback push
https://tim:bulbs4u@timboudreau.com/hg/projects/main/
using https://timboudreau.com/hg/projects/main/
http auth: user tim, password *******
sending between command
pushing to https://tim:***@timboudreau.com/hg/projects/main/
sending capabilities command
capabilities: unbundle=HG10GZ,HG10BZ,HG10UN lookup changegroupsubset
sending heads command
searching for changes
common changesets up to 3293a7661c75
1 changesets found
list of changesets:
58c3e9d7119eae8c72d72dcb3280beba8a72de2e
sending unbundle command
sending 285 bytes
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 41,
in _runcatch
return _dispatch(ui, args)
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 372,
in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 247,
in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 417,
in _runcommand
return checkargs()
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 377,
in checkargs
return cmdfunc()
File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 371,
in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/Library/Python/2.5/site-packages/mercurial/util.py", line 718, in
check
return func(*args, **kwargs)
File "/Library/Python/2.5/site-packages/mercurial/commands.py", line 2206,
in push
r = repo.push(other, opts.get('force'), revs=revs)
File "/Library/Python/2.5/site-packages/mercurial/localrepo.py", line
1509, in push
return self.push_unbundle(remote, force, revs)
File "/Library/Python/2.5/site-packages/mercurial/localrepo.py", line
1590, in push_unbundle
return remote.unbundle(cg, remote_heads, 'push')
File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 204,
in unbundle
heads=' '.join(map(hex, heads)))
File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 124,
in do_read
fp = self.do_cmd(cmd, **args)
File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 81,
in do_cmd
raise util.Abort(_('authorization failed'))
Abort: authorization failed
abort: authorization failed
Tim:main tim$
As a workaround, I have ssl push working, but this is not going to be
practical once I'm not the only committer on this machine.
Any help appreciated.
--
View this message in context: http://www.nabble.com/Unable-to-https-push-%28or-push-at-all-by-http%29-tp24129115p24129115.html
Sent from the Mercurial mailing list archive at Nabble.com.
More information about the Mercurial
mailing list