Mercurial: Why do I get a 404 error when pushing to a repository whose URL I can hit in a browser?
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 wa开发者_JAVA百科y?
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>
"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.
Is this similar to this configuration, where hgweb.config
need to be configured properly:
/ = /home/my_username/hg/**
(with the two stars at then end)
Or is it a http vs. https issue?
For https, you need a correct .hgrc
file, otherwise you can also get the 404 error.
See the .hg/hgrc
file man page.
[ui]
username = my.address@myco.com
password = mypassword
schemes = https
[paths]
default = https://myURL.kilnhg.com/Repo/Repositories/Groups/myrepo
I had the same problem and it ended up being the VERBs allowed for the CGI handler. I had limited it to GET, POST and HEAD, but ended up changing it to allow all and it works fine now.
I received this error while trying to push a lot of changesets, with an especially large-sized one with many binary files (jpg update on a website). [jpg under source control, in the same repo as the source might not be the best approach, but that's besides the point.]
In such a case, if you don't have access to the IIS configuration, a work-around is to push fewer changesets at a time. In TortoiseHg, use the Outgoing feature, right-click the top changeset of the subset you want to push, and select Push To Here. Repeat.
精彩评论