RavenDB 4 RC2: Cannot execute command of type PutAutoIndexCommand for database - Can not update auto-index:

106 views Asked by At

I am using a RavenDB 4 RC 2 database. Some of my database auto generated indexes keep 'freezing' and causing errors in my API. Deleting the frozen index provides a short term solution. But even though I am regenerating them, it just a matter of time before they 'freeze' again.

FYI => They get an orange colour state in the RavenDb Studio instead of the normal green status colour. I had this with the beta and RC1 as well. So the timeframe in which this is happening is a few months.

Does anyone know how I can fix this? See full Stacktrace below.

Failed to generate order number Raven.Client.Exceptions.Cluster.CommandExecutionException: Cannot execute command of type PutAutoIndexCommand for database <my-database> ---> System.NotSupportedException: Can not update auto-index: Auto/Orders/ByCreatedBy.IdAndOrderNumberAndWorkspace 
at Raven.Client.ServerWide.DatabaseRecord.AddIndex(AutoIndexDefinition definition) in C:\Builds\RavenDB-4.0-RC\src\Raven.Client\ServerWide\DatabaseRecord.cs:line 119 
at Raven.Server.ServerWide.Commands.Indexes.PutAutoIndexCommand.UpdateDatabaseRecord(DatabaseRecord record, Int64 etag) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\ServerWide\Commands\Indexes\PutAutoIndexCommand.cs:line 34 
at Raven.Server.ServerWide.ClusterStateMachine.UpdateDatabase(TransactionOperationContext context, String type, BlittableJsonReaderObject cmd, Int64 index, Leader leader, ServerStore serverStore) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\ServerWide\ClusterStateMachine.cs:line 802 
--- End of inner exception stack trace --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Rachis.RachisConsensus.<PutAsync>d__92.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Rachis\RachisConsensus.cs:line 589 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.ServerWide.ServerStore.<SendToLeaderAsyncInternal>d__124.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\ServerWide\ServerStore.cs:line 1479 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Indexes.IndexStore.<CreateIndex>d__23.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Indexes\IndexStore.cs:line 435 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Queries.Dynamic.DynamicQueryRunner.<MatchIndex>d__7.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Queries\Dynamic\DynamicQueryRunner.cs:line 102 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Queries.Dynamic.DynamicQueryRunner.<ExecuteQuery>d__3.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Queries\Dynamic\DynamicQueryRunner.cs:line 39 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Queries.QueryRunner.<ExecuteQuery>d__5.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Queries\QueryRunner.cs:line 53 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Handlers.QueriesHandler.<Query>d__3.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Handlers\QueriesHandler.cs:line 123 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Documents.Handlers.QueriesHandler.<Post>d__0.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Handlers\QueriesHandler.cs:line 51 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Raven.Server.Routing.RequestRouter.<HandlePath>d__5.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Routing\RequestRouter.cs:line 107 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult() 
at Raven.Server.RavenServerStartup.<RequestHandler>d__11.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\RavenServerStartup.cs:line 159. Response: {"Error":"Raven.Client.Exceptions.Cluster.CommandExecutionException: Cannot execute command of type PutAutoIndexCommand for database <my-database> ---> System.NotSupportedException: Can not update auto-index: Auto/Orders/ByCreatedBy.IdAndOrderNumberAndWorkspace\r\n at Raven.Client.ServerWide.DatabaseRecord.AddIndex(AutoIndexDefinition definition) in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Client\\ServerWide\\DatabaseRecord.cs:line 119\r\n at Raven.Server.ServerWide.Commands.Indexes.PutAutoIndexCommand.UpdateDatabaseRecord(DatabaseRecord record, Int64 etag) in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\ServerWide\\Commands\\Indexes\\PutAutoIndexCommand.cs:line 34\r\n at Raven.Server.ServerWide.ClusterStateMachine.UpdateDatabase(TransactionOperationContext context, String type, BlittableJsonReaderObject cmd, Int64 index, Leader leader, ServerStore serverStore) in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\ServerWide\\ClusterStateMachine.cs:line 802\r\n --- End of inner exception stack trace ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Rachis.RachisConsensus.<PutAsync>d__92.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Rachis\\RachisConsensus.cs:line 589\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.ServerWide.ServerStore.<SendToLeaderAsyncInternal>d__124.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\ServerWide\\ServerStore.cs:line 1479\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Indexes.IndexStore.<CreateIndex>d__23.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Indexes\\IndexStore.cs:line 435\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Queries.Dynamic.DynamicQueryRunner.<MatchIndex>d__7.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Queries\\Dynamic\\DynamicQueryRunner.cs:line 102\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Queries.Dynamic.DynamicQueryRunner.<ExecuteQuery>d__3.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Queries\\Dynamic\\DynamicQueryRunner.cs:line 39\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Queries.QueryRunner.<ExecuteQuery>d__5.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Queries\\QueryRunner.cs:line 53\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Handlers.QueriesHandler.<Query>d__3.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Handlers\\QueriesHandler.cs:line 123\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Documents.Handlers.QueriesHandler.<Post>d__0.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Documents\\Handlers\\QueriesHandler.cs:line 51\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Server.Routing.RequestRouter.<HandlePath>d__5.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\Routing\\RequestRouter.cs:line 107\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()\r\n at Raven.Server.RavenServerStartup.<RequestHandler>d__11.MoveNext() in C:\\Builds\\RavenDB-4.0-RC\\src\\Raven.Server\\RavenServerStartup.cs:line 159","Message":"Cannot execute command of type PutAutoIndexCommand for database <my-database>","Type":"Raven.Client.Exceptions.Cluster.CommandExecutionException","Url":"/databases/<my-database>/queries?query-hash=11022226452836968979"}
1

There are 1 answers

0
Fitzchak Yitzchaki On BEST ANSWER

This was reported and fixed in nightly:

issues.hibernatingrhinos.com/issue/RavenDB-7919