Temporary lack of licences cause queued build to stay forever

I recently often encounter licence saturation, which normally works fine (when licence is release build starts).
But for the first time I came across an error:
“Error selecting agent and licence for stage ‘Clone’: No row with the given identifier exists[Continua.Modules.Builds.Build#218320]”
Which makes the queued build hang forever.

I use Continua version

Hi Michal,

In this case, there should be a more detailed error message with a stack trace on the Event Log page (under Administration). Can you post these details?

Error selecting agent and licence : Exception: ObjectNotFoundException

Message: No row with the given identifier exists[Continua.Modules.Builds.Build#218316]

Stack Trace:    at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id)
   at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
   at NHibernate.Proxy.AbstractLazyInitializer.GetImplementation()
   at BuildProxy.get_Version()
   at Continua.Modules.Builds.Services.DataTransferObjects.BuildMapper.Map(Build build, BuildDTO buildDto, Paging changesetPaging)
   at Continua.Shared.Mapping`2.Map(TSource source, TDestination destination)
   at Continua.Shared.Mapping`2.Map(TSource source)
   at Continua.Modules.Builds.Querying.RootDescriptorFactory.ForAgentRequirements(Build build, String serverHostUrl, String serverHostName, String agentHostname, Int32 agentPort, IEnumerable`1 agentPropertyDTOs, IAgentDescriptorCache agentDescriptorCache, ISharedResourceLockManager sharedResourceLockManager)
   at Continua.Modules.Builds.Agents.ServerAgentManager.CheckRequirements(CachedAgent agent, IEnumerable`1 agentPropertyDTOs, IEnumerable`1 requirements, Build build, IList`1& messages)
   at Continua.Modules.Builds.Agents.ServerAgentController.SelectBestAgent(ISession session, Stage stage, Func`2 checkIfBuildIsOnCancelQueue, IList`1& messages)
   at Continua.Modules.Builds.StageQueue.StartQueuedStageIfReady(QueueInfo[] orderedQueuedStages, QueueInfo stageQueueInfo)

Hi Michal,

This is a strange error as it has occurred while simply reading the build version column from the database. We have not been able to reproduce it.

We also tried raising an error at the same place in the code but were unable to reproduce an issue where the build would hang. In our tests, the build was immediately stopped with an error message instead.

The error may be due to some database index corruption. Assuming you are using PostgreSQL, we would suggest backing up the database, then opening pgAdmin4, connecting to the database and running VACUUM in the Query Tool. This should show some errors if there is any index corruption. If so, let us know and we will provide instructions for repairing.

We also recommend updating to the latest version of Continua CI as this includes a minor update to NHibernate, the third party ORM that we use to query the database.

If the issue reoccurs, send us a copy of the diagnostics report from the Event Log page.

Well, it happened again.
I ran:


Query returned successfully in 5 secs 408 msec.

I updated Continua, haven’t noticed the problem since.

1 Like