Reputation: 4684
I am getting the following error while running build in teamcity.
Failed to collect changes, error: '"C:\Program Files\TortoiseHg\hg.exe" --config ui.interactive=False pull https://test:******@hg.myrepo.co.uk/terriff' command failed.
stdout: pulling from https://test:***@hg.myrepo.co.uk/terriff
searching for changes
stderr: abort: abandoned transaction found - run hg recover!
I already tried to delete the build directories on agent machines but still getting same error. Also tried to run hg recover command but it says repository is not local. Please guide how to fix this error.
Upvotes: 5
Views: 9401
Reputation: 2101
I have the same issue, because my hg
folder was missing from the repository folder. I managed to fix it running hg recover
on the cached version of the repository. You can find the cached repository at the following directory:
..\ProgramData\JetBrains\TeamCity\system\caches\mercurial
You should see a few folders with the names like hg_7282240431393414416
and a file map
(with no extension) at that folder. There are mappings from repository to folders stored in this file. The file contains a few lines like:
https://bitbucket.org/{teamname1}/{repo1}/ = hg_7282240431393414416
https://bitbucket.org/{teamname1}/{repo2}/ = hg_7282240431393414417
https://bitbucket.org/{teamname2}/{repo3}/ = hg_7282240431393414418
You have to find the folder corresponding to your repository(after the equation sign) in this map
file and run hg recover
in that corresponding folder. Running this command may take some time.
Please, note: team names, repositories and folder names are for demonstration only.
I hope it will help!
Upvotes: 5
Reputation: 33
I got the same issue and i fixed this by trashing the cache/mercurial directory of TEAMCITY. It may be not the best thing to do, but it's now working. The problem with HG comes from one of the subfolders of team citycache...
I took me about 5 hours to understand it! Damn!
Upvotes: 0
Reputation: 3204
Ok, I faced the same issue today and this is how I fixed it!
Type,
hg recover -R "remote-path-of-your-repository"
It might take a while until the command completes.
Upvotes: 3
Reputation: 11711
Yeah, that command will have to be run on the remote host (for example, via a shell).
Upvotes: -1