Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: Why do I get a 404 error when pushing to a repository whose URL I can hit in a browser?

Tags:

I have a Mercurial repository that I can see just fine if I navigate to it in a browser, but when I try to do a push, with my default path set to the same URL that I visit in the browser, I get this:

abort: HTTP Error 404: Not Found

Should the URL that I push to be different in some way?

like image 370
Mike Pateras Avatar asked Mar 23 '10 05:03

Mike Pateras


People also ask

What is Error 404 on Internet Explorer?

404 – File or directory not found. The resource you are looking for might have been removed, has its name changed, or is temporarily unavailable.

How do I trigger a 404 error?

One typical trigger for an error 404 message is when the page has been deleted from the website. The page was moved to another URL and the redirection was done incorrectly. You entered an incorrect URL address. Although it happens very rarely, sometimes the server malfunctions.


2 Answers

We suddenly started getting this error on our main Mercurial repository, hosted under IIS on Windows 2008. When your repository has too many heads, Mercurial POSTs query strings longer than IIS chooses to handle.

You can tell by looking at the sub-status code of the failed request in the IIS logs (it's usually the number after the normal HTTP status code). In this situation, IIS returns a sub-status of 15 which means the query string is too long. Don't forget to check your sub-status codes!

To fix the issue, you'll need to increase IIS's maxiumum query string length:

 # Get the current query string size limit
 c:\windows\system32\inetsrv\appcmd list config /section:requestFiltering -text:requestLimits.maxQueryString

 # Set the new query string size limit
 c:\windows\system32\inetsrv\appcmd set config /section:requestFiltering /requestLimits.maxQueryString:<NEW SIZE>
like image 77
Aaron Jensen Avatar answered Oct 26 '22 02:10

Aaron Jensen


"content too large" is what I had. Go to the IIS logs and look for "404 13".

To fix it, under IIS manager, go the the "Request Filtering" option, and then select the "Headers" tab.

Then go to "Edit Feature Settings" on the right. Then pick a really big number for the "Maximum allowed content (Bytes)" field.

This fixed my issue.

like image 39
camster Avatar answered Oct 26 '22 02:10

camster