Search code examples
azure-devopssql-server-data-toolsazure-pipelines-build-taskazure-devops-hosted-agent

Azure Pipeline DB Build Fails Randomly with EsentVersionStoreOutOfMemoryException: Version store out of memory


We have an Azure DevOps Pipeline build for our SSDT DACPAC projects, set to run on Continuous Integration. It has been running for a few years, and we've periodically and randomly seen the following error failing the build:

Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)
   at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
   at Microsoft.Isam.Esent.Interop.Api.JetUpdate(JET_SESID sesid, JET_TABLEID tableid, Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
   at Microsoft.Isam.Esent.Interop.Update.Save(Byte[] bookmark, Int32 bookmarkSize, Int32& actualBookmarkSize)
   ...

Our fix until now has been to just re-queue a new build. 99% of the time that would resolve the problem. Until today. Now I queued a new CI build 3 times in a row and every time it failed with the same exception. The project builds locally so just some issue with the Pipeline build process.

Is there some fix we can put into our MSBuild Pipeline build process to remove this error?


Solution

  • Adding /p:CmdLineInMemoryStorage=true to the MSBuild arguments for the Pipeline build task resolved this issue for me. So far.

    I found uncovered many references for similar errors and fixes, but none exactly having to do specifically with Azure DevOps Pipeline builds for SSDT.

    See: