1.0.0.340 - Agent workspace initialization fails

Hi,

 We're now trying to build a simple test project using Continua. This unfortunately does not work really as the build gets stuck in Stage Executing -phase and really nothing happens.

The agent where the build is allocated stated in the Diagnostics:
[WorkspaceInitialisation] Couldn't initialise workspace for build '1'.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Continua.Modules.Builds.Agent.AgentRepositoryExecutionContext..ctor(IEnumerable`1 properties)
   at Continua.Modules.Builds.Agent.Services.AgentService.<>c__DisplayClass14.b__13(Object x)

Hmm… this looks like a duplicate agent property issue… can you have a look in the admin section under agents at the properties for that agent, are there any duplicate properties? If so delete the duplicate.

I have checked in a fix for this particular exception and a new build is uploading at the moment, I’ll get the team to check tomorrow why it’s allowing duplicates in the first place. It takes about 40 minutes to upload the builds :

http://downloads.finalbuilder.com/downloads/continua/beta/ContinuaCI.Server.Setup_1.0.0.342.exe
http://downloads.finalbuilder.com/downloads/continua/beta/ContinuaCI.Server.Setup_x64_1.0.0.342.exe

Build 342 has finished uploading.

Posted By Vincent Parrett on 10 May 2012 08:19 AM
Hmm.. this looks like a duplicate agent property issue.. can you have a look in the admin section under agents at the properties for that agent, are there any duplicate properties? If so delete the duplicate.


The agent did actually have all properties as duplicates. Makes sense it causes some issues...

Hi,

 With 1.0.0.423 there is following workspace initialization issue from agent. Apparently it's related to using the branch aware SVN repository. Previous tests have been with the standard one.

 [WorkspaceInitialisation] Couldn't initialise workspace for build '2'.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Continua.Modules.Builds.Repositories.PlugIns.BranchAwareSubversionRepositoryPlugIn.Update(IRepositoryExecutionContext context, String repository, String branch)
   at Continua.Modules.Builds.Agent.AgentRepositoryHelper.CopySourceToWorkspace(IRepositoryExecutionContext context, Boolean usesDefault, String branch)
   at Continua.Modules.Builds.Agent.AgentBuildHelper.b__0(BuildRepositoryDTO repository)
   at Continua.Common.Extensions.IEnumerableExtensions.Each[T](IEnumerable`1 items, Action`1 action)
   at Continua.Modules.Builds.Agent.AgentBuildHelper.InitialiseWorkspace(Guid asyncCallId, TransportContextDTO source, IEnumerable`1 repositories, Boolean copySourceToWorkspace)
   at Continua.Modules.Builds.Agent.Services.AgentService.<>c__DisplayClass14.b__13(Object x)

Hi Olli

Are you able to provide any more info on your repository setup? I’m not sure if this got looked at today, it was a busy day of bug fixing (about to post a new build). I’ll check with the team tomorrow on the status of this bug. It is in an area that is currently undergoing some serious reworking.

With the newest build it does not display that same issue, but the build fails anyway.

Basically I have a Assembly info updater, that cannot find the source file. As far as I can see the repository working copy is in the Agent repository directory (C:\ContinuaAgent\Repos), but it tries to do the update on the workspace (C:\ContinuaAgent\Ws\\\\AssemblyInfo.cs), which is missing. Actually the -directory appears to be empty.

Agent diagnostics does not report any issues, nor does the server event log.

Failed to update 'C:\ContinuaAgent\Ws\1047\Source\SVN_Misc_Suite_Test_Automation\trunk\TestAutomationFramework\Properties\AssemblyInfo.cs'. Could not find a part of the path 'C:\ContinuaAgent\Ws\1047\Source\SVN_Misc_Suite_Test_Automation\trunk\TestAutomationFramework\Properties\AssemblyInfo.cs.bak'.
AssemblyInfo update action failed

The repository is a SVN branch aware repo, which as trunk, development and branches -directories. The repository setup is basically default, except for the path.



Ok thanks, we’ll check it out tomorrow.

Hi Olli,
The only way we’ve been able to reproduce the error here is if Continua hasn’t yet detected a changeset for the branch we’re trying to build. To confirm that that’s the problem, can you please go to the Changes tab of the configuration page, and see if there are any changesets listed for the branch you’re building?

If you don’t have a changeset for the branch, the easiest (although hacky) workaround is to create a dummy commit in SVN on that branch. Continua will then detect the commit, create a changeset, and everything should work as normal.

Currently changesets are the core method used for determining which branch and revision of the source to build, so if there is no changeset it causes problems. For the most part we ensure that there is always a changeset available to ‘drive’ the build. We’ll be adding a fix for the branch-aware SVN repository soon, but in the mean time the workaround above should get you up and running.

Please let me know how you go.

Cheers,

Ben

Posted By Ben Hughes on 29 May 2012 11:20 PM
Hi Ollie,
The only way we've been able to reproduce the error here is if Continua hasn't yet detected a changeset for the branch we're trying to build. To confirm that that's the problem, can you please go to the Changes tab of the configuration page, and see if there are any changesets listed for the branch you're building?


There are no detected changes in that repository since it has been defined, so it's indeed plausible as a cause. I'll check if having a commit there will help.

Related to that, if I attach a repository change monitor to the repository to trigger a build, how can I get the actual branch that triggered the build and set variables based on the branch?

Hi Olli,

You can use the expression $Source.[your repository name].Branch$ to get the branch that that is being built.


Cheers,

Ben
Posted By Ben Hughes on 30 May 2012 06:06 PMYou can use the expression $Source.[your repository name].Branch$ to get the branch that that is being built.

 

When starting a build manually how should it be told to Continua what branch should be built?

From the other thread :slight_smile: :

When you manually start a build (with the single arrow ‘play’ button) it should prompt you to specify the branch for any branch-aware repositories. If you use the quick start (double arrow) button it will build the default branch - in the case of subversion this is the trunk. You shouldn’t need to do anything to manage the branches manually - Continua should take care of that for you.

As discussed in the other thread, you can use $Source.Repo.Branch$ to find which branch is being used and perform different build steps etc.