block-core / blockcore-indexer

Blockcore Indexer scans the blockchain of Blockcore-derived chains and stores transaction information in a MongoDB database with REST API available for Block Explorers to use.
MIT License
20 stars 22 forks source link

db startup bug #92

Open dangershony opened 2 years ago

dangershony commented 2 years ago

I keep getting this intermittent error need to investigate

fail: Blockcore.Indexer.Core.Storage.Mongo.MongoBuilder[0]
      TaskStarter-CirrusMongoBuilder
      System.ArgumentException: An item with the same key has already been added. Key: Blockcore.Indexer.Core.Storage.Mongo.Types.BlockTable
         at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
         at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
         at MongoDB.Bson.Serialization.BsonClassMap.RegisterClassMap(BsonClassMap classMap)
         at MongoDB.Bson.Serialization.BsonClassMap.RegisterClassMap[TClass](Action`1 classMapInitializer)
         at Blockcore.Indexer.Core.Storage.Mongo.MongoBuilder.OnExecute() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Core\Storage\Mongo\MongoBuilder.cs:line 44
         at Blockcore.Indexer.Cirrus.Storage.Mongo.CirrusMongoBuilder.OnExecute() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Cirrus\Storage\Mongo\CirrusMongoBuilder.cs:line 20
         at Blockcore.Indexer.Core.Sync.SyncTasks.TaskStarter.<>c__DisplayClass8_0.<<Run>b__0>d.MoveNext() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Core\Sync\SyncTasks\TaskStarter.cs:line 37
fail: Blockcore.Indexer.Core.Sync.SyncServer[0]
      Sync
      System.ArgumentException: An item with the same key has already been added. Key: Blockcore.Indexer.Core.Storage.Mongo.Types.BlockTable
         at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
         at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
         at MongoDB.Bson.Serialization.BsonClassMap.RegisterClassMap(BsonClassMap classMap)
         at MongoDB.Bson.Serialization.BsonClassMap.RegisterClassMap[TClass](Action`1 classMapInitializer)
         at Blockcore.Indexer.Core.Storage.Mongo.MongoBuilder.OnExecute() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Core\Storage\Mongo\MongoBuilder.cs:line 44
         at Blockcore.Indexer.Cirrus.Storage.Mongo.CirrusMongoBuilder.OnExecute() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Cirrus\Storage\Mongo\CirrusMongoBuilder.cs:line 20
         at Blockcore.Indexer.Core.Sync.SyncTasks.TaskStarter.<>c__DisplayClass8_0.<<Run>b__0>d.MoveNext() in C:\Users\dan\Documents\GitHub\blockcore-indexer\src\Blockcore.Indexer.Core\Sync\SyncTasks\TaskStarter.cs:line 37
dangershony commented 2 years ago

Some hits towards this issue https://stackoverflow.com/questions/37078116/why-is-wcf-mongo-throwing-exception-an-item-with-the-same-key-has-already-been