views:

93

answers:

1

Yesterday I setup Apache to serve my Mercurial repositories and got everything working properly. I then tested pushing changes back to this repository and was presented with an error, and now that error pops up for every single operation I attempt - even just a simple GET request of the repositories! Here is the error:

mod_wsgi (pid=1771): Target WSGI script '/var/hg/hgweb.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=1771): Exception occurred processing WSGI script '/var/hg/hgweb.wsgi'.
Traceback (most recent call last):
  File "/var/hg/hgweb.wsgi", line 18, in ?
    application = hgwebdir(config)
  File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/__init__.py", line 15, in hgwebdir
    return hgwebdir_mod.hgwebdir(*args, **kwargs)
  File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 52, in __init__
    self.refresh()
  File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 82, in refresh
    self.repos = findrepos(paths)
  File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 36, in findrepos
    for path in util.walkrepos(roothead, followsym=True, recurse=recurse):
  File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1164, in walkrepos
    for hgname in walkrepos(fname, True, seen_dirs):
  File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1146, in walkrepos
    for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
  File "/usr/lib64/python2.4/os.py", line 276, in walk
    onerror(err)
  File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1127, in errhandler
    raise err
OSError: [Errno 13] Permission denied: './dev/fd'

My repository directory is owned by apache, the user running Apache. I dont know why './dev/fd' is being operated on either. I've restarted the server numerous times, recreated the repository directory, but I still get this error no matter what! I dont have access to restart the machine, so that is not an option. But it seems to have gotten in a very bad persistent state, and I dont know how to fix it. Any help is appreciated!

+1  A: 

This turned out to be a configuration error on my part, and rather than delete the question I'll post the resolution here in case someone has this problem in the future.

Here was the hgweb.config I was using:

[paths]
/ = /var/hg/repos/*

#[web]
style = gitweb
allow_archive = bz2 gz zip
maxchanges = 200
allow_push = *
push_ssl = false

Two problems here, one is obvious. I had the [web] header commented out, and I assume that many of the options are not valid for the [paths] section. Also, after re-reading the Hg docs again, the push_ssl directive does not belong in the hgweb.config file, but rather in each repository's .hg/hgrc (or the ~/.hgrc of the user that runs apache). After fixing these, things are working perfectly!

purecharger