Agent Repository is damaged when build is cancelled during initialization

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:

  Stage Controller

  There was an error with stage: Build. Message: Error initialising workspace
  Exception: ProcessException
  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
  searching for changes

  abort: abandoned transaction found - run hg recover!
  "
  Stack Trace: at Continua.Shared.Utils.Mercurial.Run(ProcessArguments args, String workingDir, Func`2 checkResult)
  at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.<>c__DisplayClassa.b__8()
  at Continua.Shared.Utils.ReadWriteLockList`1.WithWriteLock(TId id, CancellationTokenSource cancelTokenSource, Action action)
  at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.SyncFrom(TransportContextDTO source, String cacheRevision)
  at Continua.Modules.Builds.Agent.AgentRepositoryHelper.SyncCache(String cacheRevision)
  at Continua.Modules.Builds.Agent.AgentBuildHelper.SyncRepoCache(BuildRepositoryDTO buildRepositoryDTO, AgentRepositoryHelper repositoryHelper)
  at Continua.Modules.Builds.Agent.AgentBuildHelper.SyncSourceFromServer(IEnumerable`1 rules, AgentWorkspaceSyncContext workspaceCtx)
  at Continua.Modules.Builds.Agent.AgentBuildHelper.InitialiseWorkspaceOnAgent(AgentCallbackProxy proxy, TransportContextDTO source, Guid callId)
  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

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

Hi Christoph

This should be fixed in the latest update.

Thanks. We will update and try it out soon.