Umbraco.Cms.Core.Exceptions.BootFailedException: Could not check the upgrade state

Hi,

I recently started getting below error without doing any upgrade:

Umbraco.Cms.Core.Exceptions.BootFailedException: Could not check the upgrade state.
 ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Error: 802, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.

   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 216
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass35_0.<ExecuteDbDataReader>b__0()
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass38_0`1.<Execute>b__0()
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at NPoco.Database.<>c__DisplayClass298_0.<ExecuteReaderHelper>b__0()
   at NPoco.Database.ExecutionHook[T](Func`1 action)
   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)
   at NPoco.Database.ExecuteDataReader(DbCommand cmd, Boolean sync)
   at NPoco.AsyncHelper.RunSync[T](Task`1 task)
   at NPoco.Database.QueryImp[T](T instance, Expression`1 listExpression, Func`2 idFunc, Sql Sql, PocoData pocoData)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NPoco.Database.Fetch[T](Sql sql)
   at NPoco.Database.Fetch[T](String sql, Object[] args)
   at Umbraco.Cms.Persistence.SqlServer.Services.SqlServerSyntaxProvider.GetConstraintsPerColumn(IDatabase db)
   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.ValidateDbConstraints(DatabaseSchemaResult result)
   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.ValidateSchema(IEnumerable`1 orderedTables)
   at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.ValidateSchema()
   at Umbraco.Cms.Infrastructure.Persistence.UmbracoDatabase.ValidateSchema()
   at Umbraco.Cms.Infrastructure.Persistence.UmbracoDatabase.IsUmbracoInstalled()
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.GetUmbracoDatabaseState(IUmbracoDatabaseFactory databaseFactory)
ClientConnectionId:2de75885-3fe3-40bc-a58e-c628302b177c
Error Number:802,State:1,Class:16
   --- End of inner exception stack trace ---
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.GetUmbracoDatabaseState(IUmbracoDatabaseFactory databaseFactory)
   at Umbraco.Cms.Infrastructure.Runtime.RuntimeState.DetermineRuntimeLevel()
   at Umbraco.Cms.Infrastructure.Runtime.CoreRuntime.DetermineRuntimeLevel()

i had this similar issue, have you tried restarting SQL Server or checking its memory settings? Sometimes it’s just SQL running out of memory.