Command createIndexes failed: Field 'v' is currently not supported.
See original GitHub issue- HangFire.Mongo version: Version=“0.6.7”
- MongoDB Version: EKS DocumentDB - MongoDB 3.6
Hello Sergey, Im facing this error when HangFire seeds the database:
When BackupStrategy = MongoBackupStrategy.Collections :
2020-05-05 08:27:28 [DEBUG] (Hangfire.Mongo.Migration.MigrationLock) Acquired lock for migration [08:27:28 FTL] Program terminated unexpectedly ({appname})! MongoDB.Driver.MongoCommandException: Command createIndexes failed: Field ‘v’ is currently not supported CreateIndexes looks ok according with https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html#mongo-apis-database but Field ‘v’ dont know what is
When BackupStrategy = MongoBackupStrategy.None :
MongoDB.Driver.MongoCommandException: Command create failed: Feature not supported: capped:true. I think this last one is because DocumentDB doesnt support “Capped Collections” https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html#mongo-apis-database Anyway Strategy none was discarded
These are the created collections only, then crash:
Data logged:
Failure looks in the moment where index is being created on then backup collection because HangFire.jobQueue is correctly created with its correct index V:3:
source collection and index HangFire.jobQueue { “v” : 3, “key” : { “JobId” : -1 }, “name” : “JobId”, “ns” : “MYDB.HangFire.jobQueue”, “sparse” : true }
Target collection: backupCollectionName = “HangFire.jobQueue.8.migrationbackup”
variable newIndex newIndex = {“Document”:[{“Name”:“JobId”,“Value”:-1}]}
variable contains newOptions = {“Background”:null,“Bits”:null,“BucketSize”:null,“Collation”:null,“DefaultLanguage”:null,“ExpireAfter”:null,“LanguageOverride”:null,“Max”:null,“Min”:null,“Name”:“JobId”,“Sparse”:true,“SphereIndexVersion”:null,“StorageEngine”:null,“TextIndexVersion”:null,“Unique”:null,“Version”:3,“Weights”:null}
Then… fails 😦
Its something about the library? Or documentDB compatibility? Thanks
Whole exception:
MongoDB.Driver.MongoCommandException: Command createIndexes failed: Field 'v' is currently not supported. at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol
1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage)
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.Execute(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol
1.Execute(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol1 protocol, ICoreSession session, CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command[TResult](ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable
1 commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action1 postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer
1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.CommandOperationBase1.ExecuteProtocol(IChannelHandle channel, ICoreSessionHandle session, ReadPreference readPreference, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.CommandOperationBase
1.ExecuteProtocol(IChannelSource channelSource, ICoreSessionHandle session, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.WriteCommandOperation1.Execute(IWriteBinding binding, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.CreateIndexesUsingCommandOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.CreateIndexesOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken) at MongoDB.Driver.OperationExecutor.ExecuteWriteOperation[TResult](IWriteBinding binding, IWriteOperation
1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.ExecuteWriteOperation[TResult](IClientSessionHandle session, IWriteOperation
1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.CreateMany(IClientSessionHandle session, IEnumerable
1 models, CreateManyIndexesOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.<>c__DisplayClass9_0.<CreateMany>b__0(IClientSessionHandle session) at MongoDB.Driver.MongoCollectionImpl
1.UsingImplicitSession[TResult](Func2 func, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl
1.MongoIndexManager.CreateMany(IEnumerable1 models, CreateManyIndexesOptions options, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl
1.MongoIndexManager.CreateMany(IEnumerable1 models, CancellationToken cancellationToken) at MongoDB.Driver.MongoIndexManagerBase
1.CreateOne(IndexKeysDefinition1 keys, CreateIndexOptions options, CancellationToken cancellationToken) at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyBase.BackupCollection(IMongoDatabase database, String collectionName, String backupCollectionName) at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyBase.BackupStrategyCollection(IMongoDatabase database, MongoSchema fromSchema, MongoSchema toSchema) at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyBase.Backup(MongoSchema fromSchema, MongoSchema toSchema) at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyBase.Execute(MongoSchema fromSchema, MongoSchema toSchema) at Hangfire.Mongo.Migration.MongoMigrationManager.Migrate() at Hangfire.Mongo.Migration.MongoMigrationManager.MigrateIfNeeded(MongoStorageOptions storageOptions, IMongoDatabase database) at Hangfire.Mongo.MongoStorage..ctor(MongoClient mongoClient, String databaseName, MongoStorageOptions storageOptions) at Hangfire.Mongo.MongoBootstrapperConfigurationExtensions.UseMongoStorage(IGlobalConfiguration configuration, MongoClient mongoClient, String databaseName, MongoStorageOptions storageOptions) ....
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Please take a changes made here. After those changes I was able to successfully use Hangfire.Mongo with Amazon DocumentDb.
Hello there!!! Was long time ago for a POC. I downloaded Hangfire.Mongo from Sergei, then used as a library and not as a package anymore. Finally, debugging, getting errors and try to fix it what I needed:
BackupCollection in MongoMigrationStrategyBase.cs
Cannot guarantee it will work right now, but you get an idea where to go and create your needs This was mine at that time, and worked 😃 see attached,bye
BackupCollection_Workaround_Function.txt