question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: image

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.CommandUsingCommandMessageWireProtocol1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage) at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.Execute(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.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, IEnumerable1 commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action1 postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer1 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.CommandOperationBase1.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, IWriteOperation1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl1.ExecuteWriteOperation[TResult](IClientSessionHandle session, IWriteOperation1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.CreateMany(IClientSessionHandle session, IEnumerable1 models, CreateManyIndexesOptions options, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.<>c__DisplayClass9_0.<CreateMany>b__0(IClientSessionHandle session) at MongoDB.Driver.MongoCollectionImpl1.UsingImplicitSession[TResult](Func2 func, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.CreateMany(IEnumerable1 models, CreateManyIndexesOptions options, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl1.MongoIndexManager.CreateMany(IEnumerable1 models, CancellationToken cancellationToken) at MongoDB.Driver.MongoIndexManagerBase1.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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
artyomabrahamyancommented, Feb 24, 2022

Is this still an issue regarding Amazon DocumentDB support? Is there any known workarounds? (like use certain strategies for example?)

Please take a changes made here. After those changes I was able to successfully use Hangfire.Mongo with Amazon DocumentDb.

1reaction
imarrerocommented, Nov 27, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index fields not supported error while migrating MongoDB ...
I am trying to migrate my data from MongoDB 3.6 running on one ec2 instance to AWS DocumentDB running on another ec2 instance...
Read more >
DocumentDB mongorestore index fails to create with error ...
DocumentDB mongorestore index fails to create with error 303: Field currently not supported. 0. I have a DocDB instance running the 4.0 engine...
Read more >
Functional Differences: Amazon DocumentDB and MongoDB
Starting with MongoDB 4.2 compatible drivers, retryable writes is enabled by default. However, Amazon DocumentDB does not currently support retryable writes.
Read more >
createIndexes — MongoDB Manual
Command Fields. The createIndexes command takes the following fields: ... MongoDB supports several different index types, including:.
Read more >
Supported MongoDB APIs, Operations, and Data Types
MongoDB commands and operators that are internal-only or not applicable to a fully-managed service are not supported and are not included in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found