Polkascan run well when i start the chain with --chain dev ,but when i run chain to connect with my
testnet which has 4 peers and have more than 25,000 blocks, it will throw a exception and looks like concurrent reason
polkascan:master latest
substrate:master Dec 9, 2019
`[2019-12-12 17:54:56,710: INFO/MainProcess] Received task: app.tasks.accumulate_block_recursive[641a3faf-d996-4690-b6f4-57878b6c9480]
[2019-12-12 17:54:56,711: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x1107ebf28> (args:('app.tasks.accumulate_block_recursive', '641a3faf-d996-4690-b6f4-57878b6c9480', {'lang': 'py', 'task': 'app.tasks.accumulate_block_recursive', 'id': '641a3faf-d996-4690-b6f4-57878b6c9480', 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'ba499d6d-f592-469c-98f8-8fe0b454520e', 'parent_id': '531ab9ec-b32a-4a9d-bc12-e6b488092dae', 'argsrepr': "('0xd4243cf2b940b36120243e787ac2bdef72f6ef772ec2a737a09d66befc220416', None)", 'kwargsrepr': '{}', 'origin': 'gen26565@haoMBP', 'reply_to': '8dd2b96d-9d6b-3c30-8b16-d55f1310abd8', 'correlation_id': '641a3faf-d996-4690-b6f4-57878b6c9480', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': True}}, '[["0xd4243cf2b940b36120243e787ac2bdef72f6ef772ec2a737a09d66befc220416", null], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})
[2019-12-12 17:54:56,711: INFO/MainProcess] Received task: app.tasks.accumulate_block_recursive[2c274382-d4e0-4ae6-83e1-b857c531c16b]
...skipping...
[2019-12-12 17:54:57,013: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,013: DEBUG/ForkPoolWorker-1] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,014: DEBUG/ForkPoolWorker-3] http://localhost:9933 "POST / HTTP/1.1" 200 597
[2019-12-12 17:54:57,018: DEBUG/ForkPoolWorker-3] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,021: DEBUG/ForkPoolWorker-4] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,021: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:57,022: WARNING/ForkPoolWorker-2] Metadata: CACHE MISS
[2019-12-12 17:54:57,022: WARNING/ForkPoolWorker-2] 198
[2019-12-12 17:54:57,024: DEBUG/ForkPoolWorker-1] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:57,024: WARNING/ForkPoolWorker-1] Metadata: CACHE MISS
[2019-12-12 17:54:57,025: WARNING/ForkPoolWorker-1] 198
[2019-12-12 17:54:57,027: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,028: DEBUG/ForkPoolWorker-3] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:57,028: DEBUG/ForkPoolWorker-4] http://localhost:9933 "POST / HTTP/1.1" 200 992
[2019-12-12 17:54:57,029: WARNING/ForkPoolWorker-3] Metadata: CACHE MISS
[2019-12-12 17:54:57,029: WARNING/ForkPoolWorker-3] 198
[2019-12-12 17:54:57,031: DEBUG/ForkPoolWorker-1] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,032: DEBUG/ForkPoolWorker-4] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,035: DEBUG/ForkPoolWorker-3] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,043: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 117345
[2019-12-12 17:54:57,059: DEBUG/ForkPoolWorker-1] http://localhost:9933 "POST / HTTP/1.1" 200 117345
[2019-12-12 17:54:57,064: DEBUG/ForkPoolWorker-4] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:57,065: WARNING/ForkPoolWorker-4] Metadata: CACHE MISS
[2019-12-12 17:54:57,065: WARNING/ForkPoolWorker-4] 198
[2019-12-12 17:54:57,071: DEBUG/ForkPoolWorker-4] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:57,084: DEBUG/ForkPoolWorker-3] http://localhost:9933 "POST / HTTP/1.1" 200 117345
[2019-12-12 17:54:57,110: DEBUG/ForkPoolWorker-4] http://localhost:9933 "POST / HTTP/1.1" 200 117345
[2019-12-12 17:54:57,237: WARNING/ForkPoolWorker-2] store version to db
[2019-12-12 17:54:57,237: WARNING/ForkPoolWorker-2] MetadataV9Decoder
[2019-12-12 17:54:58,371: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,378: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,383: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,385: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 69
[2019-12-12 17:54:58,386: WARNING/ForkPoolWorker-2] 1
[2019-12-12 17:54:58,386: WARNING/ForkPoolWorker-2] {'phase': 0, 'extrinsic_idx': 0, 'type': '0000', 'module_id': 'System', 'event_id': 'ExtrinsicSuccess', 'params': [{'type': 'DispatchInfo', 'value': {'weight': 10000, 'class': 'Operational', 'paysFee': True}, 'valueRaw': ''}], 'topics': []}
[2019-12-12 17:54:58,396: WARNING/ForkPoolWorker-2] + Added 0xd4243cf2b940b36120243e787ac2bdef72f6ef772ec2a737a09d66befc220416
[2019-12-12 17:54:58,400: DEBUG/ForkPoolWorker-1] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,400: DEBUG/ForkPoolWorker-3] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,400: DEBUG/ForkPoolWorker-4] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,405: DEBUG/ForkPoolWorker-4] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,405: WARNING/ForkPoolWorker-4] Metadata: CACHE MISS
[2019-12-12 17:54:58,406: WARNING/ForkPoolWorker-4] 198
[2019-12-12 17:54:58,407: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,407: WARNING/ForkPoolWorker-4] ! ERROR adding 0xf6b75ad9cd5d9aa3a643bb40ff9ec681401f347269ee5a00dcf9eae524f8d91e
[2019-12-12 17:54:58,408: DEBUG/ForkPoolWorker-1] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,409: WARNING/ForkPoolWorker-1] Metadata: CACHE MISS
[2019-12-12 17:54:58,410: WARNING/ForkPoolWorker-1] 198
[2019-12-12 17:54:58,411: WARNING/ForkPoolWorker-1] ! ERROR adding 0x5a024887e2cd8a8d650fb47b3e7b117c94c5c10a60440e668f9b90db36e649ab
[2019-12-12 17:54:58,413: DEBUG/ForkPoolWorker-3] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,413: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 595
[2019-12-12 17:54:58,414: WARNING/ForkPoolWorker-3] Metadata: CACHE MISS
[2019-12-12 17:54:58,414: WARNING/ForkPoolWorker-3] 198
[2019-12-12 17:54:58,415: WARNING/ForkPoolWorker-3] ! ERROR adding 0x9f7985dd6019395cbabee3b42deeefb07d2ab3ba30801af117f7a4ff801c03d4
[2019-12-12 17:54:58,416: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,417: ERROR/ForkPoolWorker-1] Task app.tasks.accumulate_block_recursive[4248d115-48a5-4bdc-98e5-3b787ca91166] raised unexpected: HarvesterCouldNotAddBlock('0x5a024887e2cd8a8d650fb47b3e7b117c94c5c10a60440e668f9b90db36e649ab')
Traceback (most recent call last):
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/tasks.py", line 106, in accumulate_block_recursive
block = harvester.add_block(block_hash)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/processors/converters.py", line 539, in add_block
self.process_metadata(json_parent_runtime_version, parent_hash)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/processors/converters.py", line 201, in process_metadata
runtime = Runtime.query(self.db_session).get(spec_version)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 959, in get
return self._get_impl(ident, loading.load_on_pk_identity)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 1069, in _get_impl
return db_load_fn(self, primary_key_identity)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 282, in load_on_pk_identity
return q.one()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3292, in one
ret = self.one_or_none()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3261, in one_or_none
ret = list(self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3334, in iter
return self._execute_and_instances(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3356, in _execute_and_instances
querycontext, self._connection_from_session, close_with_result=True
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3371, in _get_bind_args
mapper=self._bind_mapper(), clause=querycontext.statement, **kw
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3349, in _connection_from_session
conn = self.session.connection(**kw)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1124, in connection
execution_options=execution_options,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1130, in _connection_for_bind
engine, execution_options
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 408, in _connection_for_bind
self._assert_active()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 299, in _assert_active
"This session is in 'inactive' state, due to the "
sqlalchemy.exc.InvalidRequestError: This session is in 'inactive' state, due to the SQL transaction being rolled back; no further SQL can be emitted within this transaction.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/celery/app/trace.py", line 375, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/tasks.py", line 66, in call
return super().call(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/celery/app/trace.py", line 632, in protected_call
return self.run(*args, **kwargs)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/tasks.py", line 133, in accumulate_block_recursive
raise HarvesterCouldNotAddBlock(block_hash) from exc
app.processors.converters.HarvesterCouldNotAddBlock: 0x5a024887e2cd8a8d650fb47b3e7b117c94c5c10a60440e668f9b90db36e649ab
[2019-12-12 17:54:58,417: ERROR/ForkPoolWorker-4] Task app.tasks.accumulate_block_recursive[0fe935ed-7475-46f3-8c4f-5954af00f64d] raised unexpected: HarvesterCouldNotAddBlock('0xf6b75ad9cd5d9aa3a643bb40ff9ec681401f347269ee5a00dcf9eae524f8d91e')
Traceback (most recent call last):
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/tasks.py", line 106, in accumulate_block_recursive
block = harvester.add_block(block_hash)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/processors/converters.py", line 539, in add_block
self.process_metadata(json_parent_runtime_version, parent_hash)
File "/Users/haoming/workspace/proChain/polkascan-pre-harvester/app/processors/converters.py", line 201, in process_metadata
runtime = Runtime.query(self.db_session).get(spec_version)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 959, in get
return self._get_impl(ident, loading.load_on_pk_identity)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 1069, in _get_impl
...skipping...
[2019-12-12 17:54:58,458: WARNING/ForkPoolWorker-1] Metadata: CACHE MISS
[2019-12-12 17:54:58,458: WARNING/ForkPoolWorker-1] 198
[2019-12-12 17:54:58,462: DEBUG/ForkPoolWorker-4] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,463: WARNING/ForkPoolWorker-4] Metadata: CACHE MISS
[2019-12-12 17:54:58,463: WARNING/ForkPoolWorker-4] 198
[2019-12-12 17:54:58,464: DEBUG/ForkPoolWorker-2] Starting new HTTP connection (1): localhost:9933
[2019-12-12 17:54:58,468: DEBUG/ForkPoolWorker-3] http://localhost:9933 "POST / HTTP/1.1" 200 448
[2019-12-12 17:54:58,468: DEBUG/ForkPoolWorker-2] http://localhost:9933 "POST / HTTP/1.1" 200 595`