Colored-Coins / Colored-Coins-Block-Explorer

An implementation of a full Bitcoin Block Explorer (Parser/API/Sockets) with full Colored-Coins capabilities
17 stars 30 forks source link

E11000 duplicate key error in various indices #12

Closed AlexanderPavlenko closed 7 years ago

AlexanderPavlenko commented 7 years ago

Hello, what is the possible cause of these errors? Maybe it's some misconfiguration leading to race condition?

{"message":"Internal server error","status":500,"original":{"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: colu_explorer_testnet.assetsutxos index: assetId_1_utxo_1 dup key: { : "La7gvYzMK54sqz8hwpAWavXAobxbc6WvHv75w2", : "a5343180c98e49bab0f295403f19731a5fa220786c1a5e56807121e47eca69c5:0" }","op":{"q":{"assetId":"La7gvYzMK54sqz8hwpAWavXAobxbc6WvHv75w2","utxo":"a5343180c98e49bab0f295403f19731a5fa220786c1a5e56807121e47eca69c5:0"},"u":{"assetId":"La7gvYzMK54sqz8hwpAWavXAobxbc6WvHv75w2","utxo":"a5343180c98e49bab0f295403f19731a5fa220786c1a5e56807121e47eca69c5:0"},"multi":false,"upsert":true}},"stack":"MongoError: E11000 duplicate key error collection: colu_explorer_testnet.assetsutxos index: assetId_1_utxo_1 dup key: { : "La7gvYzMK54sqz8hwpAWavXAobxbc6WvHv75w2", : "a5343180c98e49bab0f295403f19731a5fa220786c1a5e56807121e47eca69c5:0" }
    at Function.MongoError.create (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/utils.js:114:22)
    at /Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/bulk/unordered.js:472:64
    at handleCallback (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/utils.js:96:12)
    at resultHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/bulk/unordered.js:420:5)
    at commandCallback (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:1194:9)
    at Callbacks.emit (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
    at null.messageHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:358:23)
    at Socket.<anonymous> (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:292:22)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:531:20)","requestId":"blockexplorer-7a76321f-a094-4c26-b4d1-8738b8fe78c6","correlationId":"/api/transmit-blockexplorer-7a76321f-a094-4c26-b4d1-8738b8fe78c6"}
{"message":"Internal server error","status":500,"original":{"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: colu_explorer_testnet.rawtransactions index: txid_1 dup key: { : "8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839" }","op":{"q":{"txid":"8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839"},"u":{"hex":"0100000001e0319f7685fc4898098fccaeb107d38bbdc3a3b7ee5acf830c4871c395d02501020000006b483045022100b2431b4953fe4cbda0a2b9969696ec12aad5205af8bb7825bf15a202d81b82e0022023838765b8d9916aeac5932ad61d50eafb95571bb837084d93c4a5a6cdeee2e4012103ec05868e3a1c268bf9d09171de009056ebaa098392b432f5aabd3b5221e06e2bffffffff0358020000000000001976a914e068deb37b3cd00736b30e3fb385d0843bcf342d88ac00000000000000000c6a0a4343020527b00027b010a054eb0b000000001976a914c0f5b0cf3ad99ce6ffa447303abce6990a918aa788ac00000000","txid":"8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839","hash":"8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839","size":247,"vsize":247,"version":1,"locktime":0,"vin":[{"txid":"0125d095c371480c83cf5aeeb7a3c3bd8bd307b1aecc8f099848fc85769f31e0","vout":2,"scriptSig":{"asm":"3045022100b2431b4953fe4cbda0a2b9969696ec12aad5205af8bb7825bf15a202d81b82e0022023838765b8d9916aeac5932ad61d50eafb95571bb837084d93c4a5a6cdeee2e4[ALL] 03ec05868e3a1c268bf9d09171de009056ebaa098392b432f5aabd3b5221e06e2b","hex":"483045022100b2431b4953fe4cbda0a2b9969696ec12aad5205af8bb7825bf15a202d81b82e0022023838765b8d9916aeac5932ad61d50eafb95571bb837084d93c4a5a6cdeee2e4012103ec05868e3a1c268bf9d09171de009056ebaa098392b432f5aabd3b5221e06e2b"},"sequence":4294967295,"previousOutput":{"asm":"OP_DUP OP_HASH160 c0f5b0cf3ad99ce6ffa447303abce6990a918aa7 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a914c0f5b0cf3ad99ce6ffa447303abce6990a918aa788ac","reqSigs":1,"type":"pubkeyhash","addresses":["my7EMmj3XnFPT9ymM7JGpxg25dbjgHpBv3"]},"assets":[],"value":199977600,"fixed":true}],"vout":[{"value":600,"n":0,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 e068deb37b3cd00736b30e3fb385d0843bcf342d OP_EQUALVERIFY OP_CHECKSIG","hex":"76a914e068deb37b3cd00736b30e3fb385d0843bcf342d88ac","reqSigs":1,"type":"pubkeyhash","addresses":["n1yXHWnBDw3hvbABPK2CkdD2rZ3zuDGcVL"]},"assets":[{"assetId":"La79agnHUWa5Cms5bX6eF1gSsTaNSvJTXyeQ4r","amount":123,"issueTxid":"8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839","divisibility":0,"lockStatus":true,"aggregationPolicy":"aggregatable"}]},{"value":0,"n":1,"scriptPubKey":{"asm":"OP_RETURN 4343020527b00027b010","hex":"6a0a4343020527b00027b010","type":"nulldata"}},{"value":199972000,"n":2,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 c0f5b0cf3ad99ce6ffa447303abce6990a918aa7 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a914c0f5b0cf3ad99ce6ffa447303abce6990a918aa788ac","reqSigs":1,"type":"pubkeyhash","addresses":["my7EMmj3XnFPT9ymM7JGpxg25dbjgHpBv3"]},"assets":[]}],"blocktime":1491215575164,"blockheight":-1,"colored":true,"ccdata":[{"payments":[{"range":false,"output":0,"input":0,"percent":false,"amount":123}],"protocol":17219,"version":2,"type":"issuance","lockStatus":true,"aggregationPolicy":"aggregatable","divisibility":0,"amount":123,"multiSig":[]}],"iosparsed":false,"ccparsed":false,"totalsent":199972600,"fee":5000,"overflow":false},"multi":false,"upsert":true}},"stack":"MongoError: E11000 duplicate key error collection: colu_explorer_testnet.rawtransactions index: txid_1 dup key: { : "8fb905f19b1a232798a86dcaf7241985eb202bb651751ab95bb0a32147549839" }
    at Function.MongoError.create (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/utils.js:114:22)
    at resultHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/bulk/ordered.js:426:39)
    at commandCallback (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:1194:9)
    at Callbacks.emit (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
    at null.messageHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:358:23)
    at Socket.<anonymous> (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:292:22)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:531:20)","requestId":"blockexplorer-1ba6af0f-b7e9-495e-93fc-5c80b4605643","correlationId":"/api/transmit-blockexplorer-1ba6af0f-b7e9-495e-93fc-5c80b4605643"}
{"message":"Internal server error","status":500,"original":{"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: colu_explorer_testnet.utxos index: txid_1_index_1 dup key: { : "0a565caf061e2a6353b8cd67b4f24c6fcd5a6d93b88767d1cfdde559d9887e15", : 0 }","op":{"q":{"txid":"0a565caf061e2a6353b8cd67b4f24c6fcd5a6d93b88767d1cfdde559d9887e15","index":0},"u":{"$set":{"blocktime":1491220099832,"blockheight":-1},"$setOnInsert":{"txid":"0a565caf061e2a6353b8cd67b4f24c6fcd5a6d93b88767d1cfdde559d9887e15","index":0,"value":600,"used":false,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 04411f432aaf3b8e7813befafca1fbad187293ed OP_EQUALVERIFY OP_CHECKSIG","hex":"76a91404411f432aaf3b8e7813befafca1fbad187293ed88ac","reqSigs":1,"type":"pubkeyhash","addresses":["mfuT1aumqec6K28ro2YtptK4ifYJYkpzf6"]}}},"multi":false,"upsert":true}},"stack":"MongoError: E11000 duplicate key error collection: colu_explorer_testnet.utxos index: txid_1_index_1 dup key: { : "0a565caf061e2a6353b8cd67b4f24c6fcd5a6d93b88767d1cfdde559d9887e15", : 0 }
    at Function.MongoError.create (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/utils.js:114:22)
    at resultHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/lib/bulk/ordered.js:426:39)
    at commandCallback (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:1194:9)
    at Callbacks.emit (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
    at null.messageHandler (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:358:23)
    at Socket.<anonymous> (/Colored-Coins-Block-Explorer/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:292:22)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:531:20)","requestId":"blockexplorer-05add974-5e75-45d2-92f6-c7eb1d1a8ff8","correlationId":"/api/transmit-blockexplorer-05add974-5e75-45d2-92f6-c7eb1d1a8ff8"}

Colored-Coins-Block-Explorer: master-3e26525 Bitcoin Core Daemon: 0.14.0.0-g43a987c1c MongoDB: 3.4.3-f07437fb5a OS: Ubuntu 16.04