Explorer Error

+2 votes
Hi

I'm seeing an error in the explorer when it starts....it crashes on startup when it hits the same point on the chain with the following error:

 

explorer_1  | Failed to catch up {'blkfile_offset': 37954, 'blkfile_number': 100000, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/var/lib/multichain/energy-chain', 'id': 2}
explorer_1  | Traceback (most recent call last):
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2896, in catch_up
explorer_1  |     store.catch_up_dir(dircfg)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 3208, in catch_up_dir
explorer_1  |     store.import_blkdat(dircfg, ds, blkfile['name'])
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 3340, in import_blkdat
explorer_1  |     store.import_block(b, chain = chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 1199, in import_block
explorer_1  |     tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0, chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2214, in import_and_commit_tx
explorer_1  |     tx_id = store.import_tx(tx, is_coinbase, chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2084, in import_tx
explorer_1  |     """, (unicode(val.get('Asset Name',''), 'latin-1'), val['Quantity Multiple'], tx_id))
explorer_1  | KeyError: 'Quantity Multiple'

 

I'm using multichain 1.0.2 and the latest cut of the explorer code

 

Cheers

 

Marty
asked Dec 19, 2017 by marty

1 Answer

0 votes
 
Best answer

It looks like this might be an asset issuance transaction which didn't have the display multiple expressed explicitly in the metadata, presumably because it was built manually using the raw transaction interface?

If so MultiChain reverts to the default multiple value of 1, but the Explorer appears to have a bug which assumes that the multiple should be in there explicitly.

The solution would be to replace:

val['Quantity Multiple']

... with ...

val.get('Quantity Multiple',1)

Please try that in the DataStore.py file, then recompile the Explorer using the appropriate python setup.py install line, and let us know if that solves the problem. If so we'll update the repository.

answered Dec 19, 2017 by MultiChain
selected Dec 20, 2017 by marty
Thanks for the quick reply,

On the money with the reason, all our issue transactions are built using raw transactions....

Unfortunately your suggested fix blew up even quicker.....

explorer_1  | Failed to catch up {'blkfile_offset': 835, 'blkfile_number': 100000, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/var/lib/multichain/energy-chain', 'id': 2}
explorer_1  | Traceback (most recent call last):
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2896, in catch_up
explorer_1  |     store.catch_up_dir(dircfg)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 3208, in catch_up_dir
explorer_1  |     store.import_blkdat(dircfg, ds, blkfile['name'])
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 3340, in import_blkdat
explorer_1  |     store.import_block(b, chain = chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 1199, in import_block
explorer_1  |     tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0, chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2214, in import_and_commit_tx
explorer_1  |     tx_id = store.import_tx(tx, is_coinbase, chain)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2084, in import_tx
explorer_1  |     """, (unicode(val.get('Asset Name',''), 'latin-1'), val.get['Quantity Multiple',1], tx_id))
explorer_1  | TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'

Marty
ignore that....the fix is val.get('Quantity Multiple',1)     round not square brackets!

That's my first bit of python :)

Cheers

Marty
Great and thanks for the correction, which we've applied in the answer.
...