cancerDHC / ccdh-terminology-service

CCDH Terminology and Mapping Service
3 stars 4 forks source link

Importer: `py2neo.errors.ConnectionBroken: Failed to read message` #124

Open joeflack4 opened 2 years ago

joeflack4 commented 2 years ago

Related issues

126

Description

At random times (and far too often; maybe 1/3 of the time?), python -m ccdh.importers.importer fails to fully run and import data into Neo4J database before reaching this error.

Short err

py2neo.errors.ConnectionBroken: Failed to read message

Long err example

This happens randomly, though it seems to happen during GDC import a lot. Here's an example failure:

INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.methylation_liftover_workflows ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.platform ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.project_id ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.state ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.state_comment ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.submitter_id ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.type ...
INFO:ccdh.importers.importer:Importing NodeAttribute GDC.Methylation Beta Value.updated_datetime ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 156, in read_message
    hi, lo = self.wire.read(2)
  File "/usr/local/lib/python3.8/site-packages/py2neo/wiring.py", line 128, in read
    self.__mark_broken("Network read incomplete "
  File "/usr/local/lib/python3.8/site-packages/py2neo/wiring.py", line 220, in __mark_broken
    raise BrokenWireError(message, idle_time=idle_time,
py2neo.wiring.BrokenWireError: Network read incomplete (received 0 of 2 bytes) after 4.1s idle (146273 bytes sent, 416844 bytes received)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/ccdh/importers/importer.py", line 227, in <module>
    Importer.import_all()
  File "/app/ccdh/importers/importer.py", line 220, in import_all
    Importer(neo4j_graph()).import_node_attributes(GdcImporter.read_data_dictionary())
  File "/app/ccdh/importers/importer.py", line 62, in import_node_attributes
    self.import_node_attribute(node_attribute)
  File "/app/ccdh/importers/importer.py", line 33, in import_node_attribute
    na_node = self.mdr_graph.get_node_attribute(system, entity, attribute)
  File "/app/ccdh/db/mdr_graph.py", line 87, in get_node_attribute
    return NodeMatcher(self.graph).match('NodeAttribute').where(where_stmt).first()
  File "/usr/local/lib/python3.8/site-packages/py2neo/matching.py", line 452, in first
    return self.graph.evaluate(*self._query_and_parameters())
  File "/usr/local/lib/python3.8/site-packages/py2neo/database.py", line 416, in evaluate
    return self.run(cypher, parameters, **kwparameters).evaluate()
  File "/usr/local/lib/python3.8/site-packages/py2neo/database.py", line 405, in run
    return self.auto().run(cypher, parameters, **kwparameters)
  File "/usr/local/lib/python3.8/site-packages/py2neo/database.py", line 992, in run
    self._connector.pull(result, -1)
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/__init__.py", line 1434, in pull
    cx.pull(result, n=n)
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 971, in pull
    self._sync(response)
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 775, in _sync
    self._wait(response)
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 770, in _wait
    self._fetch()
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 745, in _fetch
    tag, fields = self.read_message()
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 672, in read_message
    tag, fields = self._reader.read_message()
  File "/usr/local/lib/python3.8/site-packages/py2neo/client/bolt.py", line 158, in read_message
    raise_from(ConnectionBroken("Failed to read message"), error)
  File "<string>", line 3, in raise_from
py2neo.errors.ConnectionBroken: Failed to read message