# Agent Repository is damaged when build is cancelled during initialization

**URL:** https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893
**Category:** Bugs
**Created:** [February 26, 2014, 9:53am UTC](https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893 "2014-02-26T09:53:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chillefeld](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/chillefeld/32/1333_2.png) [@chillefeld](https://www.finalbuilder.com/forums/u/chillefeld)
#### Post date: [February 26, 2014, 9:53am UTC](https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893/1 "2014-02-26T09:53:32Z")

</div>

Hi everyone,  
  
Today we noticed a problem that can occur when a build is stopped while the Continua Agent is synching its local repository.  
When the Build is stopped while the mercurial process is currently updating the local repository we get the following message the next time we try to run a build on this agent:  
  
&nbsp; Stage Controller   
  
&nbsp; There was an error with stage: [Build](http://1-defb01-w12/view/1004/ac6eb5f4-248a-4328-8551-a2de009e88f2). Message: Error initialising workspace   
&nbsp; Exception: ProcessException   
&nbsp; Message: Running C:\Program Files\VSoft Technologies\ContinuaCI Agent\hg\hg.exe with arguments "pull -f -R E:\CI\_WS\Repos\87217da2 \\1-DEFB01-W12\Continua\Rc\87217da2 --config ui.username=Continua --noninteractive" failed with return code 255 and error output: "pulling from \\1-DEFB01-W12\Continua\Rc\87217da2  
&nbsp; searching for changes  
  
&nbsp; abort: abandoned transaction found - run hg recover!  
&nbsp; "   
&nbsp; Stack Trace: at Continua.Shared.Utils.Mercurial.Run(ProcessArguments args, String workingDir, Func`2 checkResult)   
&nbsp; at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.\<\>c\_\_DisplayClassa.b\_\_8()   
&nbsp; at Continua.Shared.Utils.ReadWriteLockList`1.WithWriteLock(TId id, CancellationTokenSource cancelTokenSource, Action action)   
&nbsp; at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.SyncFrom(TransportContextDTO source, String cacheRevision)   
&nbsp; at Continua.Modules.Builds.Agent.AgentRepositoryHelper.SyncCache(String cacheRevision)   
&nbsp; at Continua.Modules.Builds.Agent.AgentBuildHelper.SyncRepoCache(BuildRepositoryDTO buildRepositoryDTO, AgentRepositoryHelper repositoryHelper)   
&nbsp; at Continua.Modules.Builds.Agent.AgentBuildHelper.SyncSourceFromServer(IEnumerable`1 rules, AgentWorkspaceSyncContext workspaceCtx)   
&nbsp; at Continua.Modules.Builds.Agent.AgentBuildHelper.InitialiseWorkspaceOnAgent(AgentCallbackProxy proxy, TransportContextDTO source, Guid callId)   
&nbsp; at Continua.Modules.Builds.Agent.AgentBuildRunner.OnInitialisingWorkspace(Transition`1 inState)   
  
  
Running hg recover on the agent's repository as per the error message resolved the issue but ideally this should not cause Continua to stop working.  
Regards,  
Christoph Hillefeld

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 26, 2014, 1:16am UTC](https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893/2 "2014-02-26T01:16:15Z")

</div>

Ouch. Thanks for the report, we’ll get it fixed asap.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 7, 2014, 6:33am UTC](https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893/3 "2014-03-07T06:33:35Z")

</div>

Hi Christoph   
  
 This should be fixed in the latest update.

---

<div class="post-metadata">

### Author: ![chillefeld](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/chillefeld/32/1333_2.png) [@chillefeld](https://www.finalbuilder.com/forums/u/chillefeld)
#### Post date: [March 7, 2014, 7:54am UTC](https://www.finalbuilder.com/forums/t/agent-repository-is-damaged-when-build-is-cancelled-during-initialization/5893/4 "2014-03-07T07:54:15Z")

</div>

Thanks. We will update and try it out soon.
