Error -3 while decompressing data: invalid distance too far back - mercurial

We have a Mercurial repository on our CI server that is available via Windows network share (\\server\hg_repo). Our team of 7 developers makes regular push's to and pulls from there. Also CI server itself does pulls obviously.
Periodically repository gets broken with error:
stdout: requesting all changes
adding changesets
adding manifests
stderr: transaction abort!
rollback completed
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.0.1)
** Extensions loaded:
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 27, in run
File "mercurial\dispatch.pyo", line 64, in dispatch
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 684, in _dispatch
File "mercurial\dispatch.pyo", line 466, in runcommand
File "mercurial\dispatch.pyo", line 738, in _runcommand
File "mercurial\dispatch.pyo", line 692, in checkargs
File "mercurial\dispatch.pyo", line 681, in <lambda>
File "mercurial\util.pyo", line 455, in check
File "mercurial\commands.pyo", line 1137, in clone
File "mercurial\hg.pyo", line 347, in clone
File "mercurial\localrepo.pyo", line 2056, in clone
File "mercurial\localrepo.pyo", line 1486, in pull
File "mercurial\localrepo.pyo", line 1871, in addchangegroup
File "mercurial\revlog.pyo", line 1157, in addgroup
File "mercurial\changegroup.pyo", line 187, in deltachunk
File "mercurial\changegroup.pyo", line 152, in chunklength
File "mercurial\changegroup.pyo", line 17, in readexactly
File "mercurial\util.pyo", line 863, in read
File "mercurial\util.pyo", line 841, in splitbig
File "mercurial\localrepo.pyo", line 1774, in gengroup
File "mercurial\revlog.pyo", line 1122, in group
File "mercurial\changegroup.pyo", line 244, in revchunk
File "mercurial\revlog.pyo", line 852, in revdiff
File "mercurial\revlog.pyo", line 831, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
zlib.error: Error -3 while decompressing data: invalid distance too far back
Funny is that error may appear not for all developers e.g. CI server has error when I can do pull/push without error.
When we recreate central repo from some other copy it works fine again.
How to troubleshoot this error?
**
UPDATE:
**
When it happened again today I run hg verify and its obfuscated output is below:
XXX> hg verify
checking changesets
checking manifests
hg.exe : 2355: reading manifest delta 2da8374dc3db: Error -3 while decompressing data: invalid distance too far back
+ CategoryInfo : NotSpecified: ( 2355: reading ...ce too far back:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
2356: reading manifest delta 784e9c245c61: unknown compression type '\xfb'
2357: reading manifest delta 5b147ce7d2a5: unknown compression type 'e'
2358: reading manifest delta e1aa758953b2: unknown compression type '\xb3'
2359: reading manifest delta 61dcc0da8106: unknown compression type 'F'
2360: reading manifest delta 7579106dd2fe: unknown compression type '\xfa'
2361: reading manifest delta b021c8e5ae34: unknown compression type '\xd2'
2362: reading manifest delta 04e2a8673e61: unknown compression type '\x84'
crosschecking files in changesets and manifests
checking files
XXX.csproj#2358: 564af8d2dcea not in manifests
XXX.cs#2356: d1d2086e 9b69 not in manifests
.......... // here are more 'not in manifests errors'
20 integrity errors encountered!
(first damaged changeset appears to be 2355)
14811 files, 3040 changesets, 31214 total revisions

Related

Mercurial keeps returning Error 400: Bad Request

Anytime I try to do any interaction with the server, Mercurial returns "abort: HTTP Error 400: Bad Request". We are not using any authentication, so that's not an issue. We have three other developers working on the same repo with the same version of mercurial installed (2.2.3). They haven't had any issues, so it makes me think I'm corrupting something in the .hg folder or something. But I really have no clue.
I was able to clone and work from the new directory just fine. However, about 4 hours later, it started happening again in the new directory too. The only things I did in that time period were commit, pull, and push. When I committed a few hours later and tried to pull, that's when I got the error again.
Here is the debug log for incoming (hg --debug --traceback incoming):
using http://myserver/myapp
sending capabilities command
comparing with http://myserver/myapp
query 1; heads
sending batch command
searching for changes
taking initial sample
searching: 2 queries
query 2; still undecided: 208, sample size is: 200
sending known command
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 88, in _runcatch
File "mercurial\dispatch.pyo", line 740, in _dispatch
File "mercurial\dispatch.pyo", line 514, in runcommand
File "mercurial\dispatch.pyo", line 830, in _runcommand
File "mercurial\dispatch.pyo", line 801, in checkargs
File "mercurial\dispatch.pyo", line 737, in <lambda>
File "mercurial\util.pyo", line 472, in check
File "mercurial\extensions.pyo", line 144, in wrap
File "mercurial\util.pyo", line 472, in check
File "hgext\mq.pyo", line 3528, in mqcommand
File "mercurial\util.pyo", line 472, in check
File "mercurial\commands.pyo", line 3894, in incoming
File "mercurial\hg.pyo", line 513, in incoming
File "mercurial\hg.pyo", line 472, in _incoming
File "mercurial\bundlerepo.pyo", line 342, in getremotechanges
File "mercurial\discovery.pyo", line 45, in findcommonincoming
File "mercurial\setdiscovery.pyo", line 184, in findcommonheads
File "mercurial\wireproto.pyo", line 116, in plain
File "mercurial\wireproto.pyo", line 164, in _submitone
File "mercurial\httppeer.pyo", line 170, in _call
File "mercurial\httppeer.pyo", line 118, in _callstream
File "urllib2.pyo", line 406, in open
File "urllib2.pyo", line 519, in http_response
File "urllib2.pyo", line 444, in error
File "urllib2.pyo", line 378, in _call_chain
File "urllib2.pyo", line 527, in http_error_default
HTTPError: HTTP Error 400: Bad Request
abort: HTTP Error 400: Bad Request
As I said earlier, I can do a clone, but if I try to run incoming, outgoing, pull, or push, I get this error.
I was able to resolve this issue by running
hg rollback
Once I ran that, it uncommitted my files (but kept the changes, so I could see the modified files in hg status). I was then able to run incoming and pull. Then I re-committed my code and pushed it out without any problems.
So something must be getting corrupted when I commit, just not sure why.
I don't know what's the problem in this specific case. But we had a different problem with the same result - incoming and pull commands failed with 400 Bad Request. So here's receipt for how to investigate the failure, in case hg -v --debug doesn't help.
Take Fiddler for capturing and revealing HTTP traffic. Then run mercurial request as following:
hg --config http_proxy.host=127.0.0.1:8888 pull
The config causes redirects of requests through Fiddler, which is listening on port 8888. Then in Fiddler, you may find the red 400 reply and in Inspectors pane to see an entire message, not the code only.
You may look here for details on our problem, investigation and resolution.

Mercurial: abandoned transaction found run hg recover. missing revlogs

I recently tried to push to a central repository and received the error: abandoned transaction found. Running hg recover said there was no missing transaction. On the advice of another answer I used hg verify to see that my repository is missing two revlogs; below is the result of running hg verify:
% hg --repository C:\dev\WHDLawWeb verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
data/WHDLawWeb/Images/pastsponsorships.jpg.d#167: missing revlog!
data/WHDLawWeb/WHDLawWeb/Resources/Image/ALFALogoWhite.jpg.i#319: missing revlog!
7175 files, 988 changesets, 14987 total revisions
2 integrity errors encountered!
(first damaged changeset appears to be 167)
[command returned code 1 Tue Jul 03 15:02:13 2012]
In an effort to correct this, and mostly due to my frustration at this point, I decided to just clone the central repository as I'd only be missing a few revisions. However, once I try to push from this cloned repository I get the following bug report:
** Mercurial version (2.2.2). TortoiseHg version (2.4.1)
** Command: --nofork workbench
** CWD: C:\dev
** Encoding: cp1252
** Extensions loaded: bugzilla, graphlog, convert, extdiff
** Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
** Windows version: (6, 1, 7601, 2, 'Service Pack 1')
** Processor architecture: x86
** Qt-4.7.4 PyQt-4.8.6
Traceback (most recent call last):
File "tortoisehg\hgqt\repowidget.pyo", line 954, in repositoryChanged
File "tortoisehg\hgqt\repowidget.pyo", line 916, in rebuildGraph
File "tortoisehg\hgqt\repowidget.pyo", line 777, in setupModels
File "tortoisehg\hgqt\repomodel.pyo", line 151, in __init__
File "tortoisehg\hgqt\repomodel.pyo", line 170, in initBranchColors
File "mercurial\localrepo.pyo", line 523, in branchtags
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Traceback (most recent call last):
File "tortoisehg\hgqt\commit.pyo", line 533, in repositoryChanged
File "tortoisehg\hgqt\commit.pyo", line 553, in refresh
File "tortoisehg\hgqt\thgrepo.pyo", line 631, in thgmqappliedpatch
File "tortoisehg\hgqt\thgrepo.pyo", line 623, in _thgmqpatchtags
File "mercurial\context.pyo", line 191, in tags
File "mercurial\localrepo.pyo", line 468, in nodetags
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\localrepo.pyo", line 395, in _tagscache
File "mercurial\localrepo.pyo", line 428, in _findtags
File "mercurial\tags.pyo", line 30, in findglobaltags
File "mercurial\tags.pyo", line 242, in _readtagcache
File "mercurial\context.pyo", line 251, in filenode
File "mercurial\context.pyo", line 240, in _fileinfo
File "mercurial\context.pyo", line 183, in files
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\context.pyo", line 134, in _changeset
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Running hg verify on the central repository shows that the two revlogs are also missing here. If anyone knows how to fix either my original or cloned repository I'd appreciate any feedback.
Also tried a solution here and encountered the same problem. I'm relatively new to mercurial and tortiosehg, please forgive any stupid mistakes. Like I said help would be appreciated.

Mercurial share extension doesn't work with nested subrepos

I can't get mercurial share extension to work with nested repos.
Test repository structure:
SubrepoTest/
nested/
The SubrepoTest/.hgsub content:
nested = nested
Trying to share repo gives this error:
hg share --debug --traceback SubrepoTest Copy
updating working directory
resolving manifests
overwrite: False, partial: False
ancestor: 000000000000, local: 000000000000+, remote: 9d3080714601
.hgsub: remote created -> g
.hgsubstate: remote created -> g
New Text Document.txt: remote created -> g
calling hook preupdate.auto_update_hooks:
calling hook preupdate.auto_rhapsody:
Rhapsody not running.
updating: .hgsub 1/3 files (33.33%)
getting .hgsub
updating: .hgsubstate 2/3 files (66.67%)
getting .hgsubstate
subrepo merge 000000000000+ 9d3080714601 000000000000+
subrepo nested: remote added, get nested:6a97f6c97cf7b1fd1bd82cb528a7494980e17d62:hg
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 696, in _dispatch
File "mercurial\dispatch.pyo", line 472, in runcommand
File "mercurial\extensions.pyo", line 184, in wrap
File "hgext\color.pyo", line 362, in colorcmd
File "mercurial\dispatch.pyo", line 786, in _runcommand
File "mercurial\dispatch.pyo", line 757, in checkargs
File "mercurial\dispatch.pyo", line 693, in
File "mercurial\util.pyo", line 463, in check
File "hgext\share.pyo", line 29, in share
File "mercurial\hg.pyo", line 175, in share
File "mercurial\hg.pyo", line 416, in update
File "mercurial\merge.pyo", line 596, in update
File "mercurial\merge.pyo", line 391, in applyupdates
File "mercurial\subrepo.pyo", line 183, in submerge
File "mercurial\subrepo.pyo", line 512, in get
File "mercurial\subrepo.pyo", line 494, in _get
File "mercurial\subrepo.pyo", line 247, in _abssource
Abort: default path for subrepository nested not found
abort: default path for subrepository nested not found
I'm using Mercurial Distributed SCM (version 2.2.2) from TortoiseHG for Windows.
How do I solve this problem?

Mercurial / TortoiseHg Issues with Jenkins Slave - A specified logon session does not exist

I've got a build that was previously working fine on the Jenkins Master node that I'm now trying to execute on the Jenkins slave.
I'm using the Jenkins Mercurial Plugin and pointing to the TortoiseHg installation directory on the slave machine.
The Mercurial repository that I'm using is secured by a self-signed certificate (hosted in IIS).
Working on the machine locally, I can clone the repository without issues (this is necessary to get TortoiseHg to preserve the user's password).
However, I seem to be running into issues getting this to work when the build is executed by Jenkins.
The specific error that I'm getting is listed below :
Building remotely on <slave> in workspace <workspace>
$ S:\Software\TortoiseHg/hg clone --rev default --noupdate https://<repository> <workspace_on_slave>
warning: <MercurialServerIP> certificate with fingerprint e3:5f:5e:ea:4f:da:ef:a4:0b:4a:bb:00:e8:31:59:de:ce:d0:28:94 not verified (check hostfingerprints or web.cacerts config setting)
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.1.2)
** Extensions loaded: mercurial_keyring
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 27, in run
File "mercurial\dispatch.pyo", line 64, in dispatch
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 685, in _dispatch
File "mercurial\dispatch.pyo", line 467, in runcommand
File "mercurial\dispatch.pyo", line 739, in _runcommand
File "mercurial\dispatch.pyo", line 693, in checkargs
File "mercurial\dispatch.pyo", line 682, in <lambda>
File "mercurial\util.pyo", line 456, in check
File "mercurial\commands.pyo", line 1157, in clone
File "mercurial\hg.pyo", line 250, in clone
File "mercurial\hg.pyo", line 93, in repository
File "mercurial\httprepo.pyo", line 236, in instance
File "mercurial\httprepo.pyo", line 57, in _fetchcaps
File "mercurial\httprepo.pyo", line 169, in _call
File "mercurial\httprepo.pyo", line 117, in _callstream
File "urllib2.pyo", line 397, in open
File "urllib2.pyo", line 510, in http_response
File "urllib2.pyo", line 429, in error
File "urllib2.pyo", line 369, in _call_chain
File "urllib2.pyo", line 864, in http_error_401
File "mercurial\url.pyo", line 429, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 332, in basic_http_error_auth_reqed
File "urllib2.pyo", line 842, in http_error_auth_reqed
File "urllib2.pyo", line 845, in retry_http_basic_auth
File "hgext\mercurial_keyring.pyo", line 326, in find_user_password
File "hgext\mercurial_keyring.pyo", line 177, in find_auth
File "hgext\mercurial_keyring.pyo", line 60, in get_http_password
File "keyring\core.pyo", line 37, in get_password
File "keyring\backend.pyo", line 560, in get_password
File "keyring\backend.pyo", line 573, in _get_password
pywintypes.error: (1312, 'CredRead', 'A specified logon session does not exist. It may already have been terminated.')
ERROR: Failed to clone https://<repository>
Can anyone offer suggestions on what I can do to get past this?
Non-Polling Solution: (Useful if you're not doing polling of the repository to trigger builds)
The fix to this turns out to be to manually clone the repository on the slave at the workspace location (where it would normally end up).
It seems that once the repository is available on the slave, it's able to get past the 'A specified logon session does not exist. It may already have been terminated.' error.
Polling Solution: (The solution above does not seem to work with the Jenkins polling functionality, so we're left with the solution below).
See How do you specify authentication information for Mercurial as part of Jenkins? (mercurial_keyring)
The only way I was able to figure out how to get the server to remember the password (and work with polling) in my setup was to specify it manually in \mercurial.ini .
NOTE: You may also have to remove the mercurial_keyring line from mercurial.ini. (This disables the keyring extension on the Jenkins server/slave since we're specifying everything manually.)

Problem with Mercurial hg serve command

When using the hg serve command in windows, the server starts correctly, but when somebody tries to do a clone, this error appears.
$ hg serve
listening at http://machineX:8000/ (bound to *:8000)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 4456)
Traceback (most recent call last):
File "SocketServer.pyc", line 558, in process_request_thread
File "SocketServer.pyc", line 320, in finish_request
File "mercurial\hgweb\server.pyc", line 42, in __init__
File "SocketServer.pyc", line 615, in __init__
File "BaseHTTPServer.pyc", line 329, in handle
File "BaseHTTPServer.pyc", line 323, in handle_one_request
File "mercurial\hgweb\server.pyc", line 74, in do_GET
File "mercurial\hgweb\server.pyc", line 65, in do_POST
File "mercurial\hgweb\server.pyc", line 58, in do_write
File "mercurial\hgweb\server.pyc", line 122, in do_hgweb
File "mercurial\hgweb\hgweb_mod.pyc", line 85, in __call__
File "mercurial\hgweb\hgweb_mod.pyc", line 117, in run_wsgi
ErrorResponse
----------------------------------------
It seems this is some sort of python error... I've already tried reinstalling to the lastest version of mercurial, but still the same problem occurs.
anybody else seen this before?
thanks!
It a dumb problem...
I was doing hg serve on my "hello" repository, and I was trying to access it as
hg clone http://machine:8000/hello
you shouldn't use the repo name in the address...
that is all.