Sql Server 2008 R2 - Failed to associate build with promotion, promotion was not persisted

I am trying to configure TeamCity to use a SQL Server 2008 R2. This is a fresh install of Team City and a fresh DB. I am not migrating anything.

The DB Collation for the TeamCity and TempDb is SQL_Latin1_General_CP1_CI_AS

When a build is in the build queue the server log fills up with this error:

[2012-10-17 12:57:44,213]  DEBUG -   jetbrains.buildServer.SERVER - Compatible/can run on agents for: QueuedBuildImpl{myBuildType=Minerva24.Net :: Dev Debug Build {id=bt2},ItemId=2} are: [DEV08 1 registered: true authorized: true], already distributed agents: []
[2012-10-17 12:57:44,213]  DEBUG -   jetbrains.buildServer.SERVER - Initializing Running build bt2 on DEV08, build id: 1240
[2012-10-17 12:57:44,229]  DEBUG -   jetbrains.buildServer.SERVER - Associating build promotion 2 with build 1240
[2012-10-17 12:57:44,229]   WARN -   jetbrains.buildServer.SERVER - Failed to start build: null, error: java.lang.RuntimeException: Failed to associate build with promotion, promotion was not persisted
[2012-10-17 12:57:44,229]  DEBUG -   jetbrains.buildServer.SERVER - Failed to start build: null, error: java.lang.RuntimeException: Failed to associate build with promotion, promotion was not persisted
java.lang.RuntimeException: Failed to associate build with promotion, promotion was not persisted
 at jetbrains.buildServer.serverSide.impl.BuildPromotionImpl.setAssociatedBuild(BuildPromotionImpl.java:387)
 at jetbrains.buildServer.serverSide.impl.RunningBuildImpl.initialize(RunningBuildImpl.java:424)
 at jetbrains.buildServer.serverSide.impl.RunningBuildImpl.<init>(RunningBuildImpl.java:318)
 at jetbrains.buildServer.serverSide.impl.auth.SecuredRunningBuild.<init>(SecuredRunningBuild.java:26)
 at jetbrains.buildServer.serverSide.impl.auth.SecuredBuildFactory.createRunningBuild(SecuredBuildFactory.java:48)
 at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.newRunningBuild(BuildTypeImpl.java:176)
 at jetbrains.buildServer.serverSide.impl.FlushQueueForConnectedAgents.chooseBuildAndAgent(FlushQueueForConnectedAgents.java:40)
 at jetbrains.buildServer.serverSide.impl.FlushQueueForConnectedAgents.chooseBuildAndAgent(FlushQueueForConnectedAgents.java:15)
 at jetbrains.buildServer.serverSide.impl.FlushQueueTemplate.flushRealAgents(FlushQueueTemplate.java:8)
 at jetbrains.buildServer.serverSide.impl.FlushQueueTemplate.access$100(FlushQueueTemplate.java:47)
 at jetbrains.buildServer.serverSide.impl.FlushQueueTemplate$2.run(FlushQueueTemplate.java)
 at jetbrains.buildServer.serverSide.impl.FlushQueueAction$QueueAction.run(FlushQueueAction.java:5)
 at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl.executeWithInactiveCleanup(ServerCleanupManagerImpl.java:112)
 at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl$$FastClassByCGLIB$$ba2c8525.invoke(<generated>)
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 at jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(TeamCityMethodSecurityInterceptor.java:8)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:572)
 at jetbrains.buildServer.serverSide.impl.cleanup.ServerCleanupManagerImpl$$EnhancerByCGLIB$$8ae3cffa.executeWithInactiveCleanup(<generated>)
 at jetbrains.buildServer.serverSide.impl.BuildServerImpl.flushQueue(BuildServerImpl.java:285)
 at jetbrains.buildServer.serverSide.impl.BuildServerRunner$2.doSomething(BuildServerRunner.java)
 at jetbrains.buildServer.serverSide.impl.BuildServerRunner$BuildServerWorker.runAction(BuildServerRunner.java:30)
 at jetbrains.buildServer.serverSide.impl.BuildServerRunner$BuildServerWorker.run(BuildServerRunner.java:28)
 at java.lang.Thread.run(Unknown Source)
[2012-10-17 12:57:44,229]  DEBUG - ains.buildServer.util.WatchDog - Flush Queue done: 35 msec



I don't see any database tables that relate to promotions.
1 comment
Comment actions Permalink

Hi Bryan,

As a matter of fact we ran into the same errors you see regarding promotions. We've searched a full day to resolve this, suddenly our TC production server was showing this issue after years of problem free operations.

At the end we found out that our DBA had changed the MSSQL Server 2008 R2 configuration of the DB server we run the TC DB on; he enabled the "SET NOCOUNT option". As soon as he turned it off, TC recovered and assumed normal operations.

Talk to your DBA, you need the "SET NOCOUNT option" disabled.

I've looked this up on the web, as I do not have access to the DBA at the moment. I guess this is the way he changed the setting:

     Open SQL Server Management Studio and navigate to Tools -> Options -> Query Execution -> SQL Server -> Advanced
     Ensure that the SET NOCOUNT option is not selected

That should do the trick. I'm curious if this resolves your issue.

Kind Regards,

  Bob van Rooij

0

Please sign in to leave a comment.