mercurial HTTP Error: 500 (Internal Server Error) when pushing repository

April 13, 2016 1.8k views
DigitalOcean Apache Linux Commands Python Linux Basics Debian

When I try to push a repository to my server, I would receive the following error:

HTTP Error: 500 (Internal Server Error

When i check my apache2/error.log file, it states that No module named mercurial

[Tue Apr 12 11:05:23.755798 2016] [cgi:error] [pid 10602] [client] AH01215: from mercurial import demandimport; demandimport.enable()
[Tue Apr 12 11:05:23.755828 2016] [cgi:error] [pid 10602] [client] AH01215: ImportError
[Tue Apr 12 11:05:23.755843 2016] [cgi:error] [pid 10602] [client] AH01215: :
[Tue Apr 12 11:05:23.755863 2016] [cgi:error] [pid 10602] [client] AH01215: No module named mercurial

I have installed mercurial and every time I restart the apache server, I am able to push my repos but the error comes back soon after.

1 comment
  • Is your Apache server being managed by an automation tool like Chef or Puppet? Is it possible an application or another admin are uninstalling Mercurial? Do you have multiple Apache servers, or is the the only one you push your repository to?

    You also may want to try using

    import sys

    with the appropriate Python path before your from mercurial import demandimport; line as well.

Be the first one to answer this question.