I am installing the latest version of 4.2.1 and got an error message when executing a cypher through Bolt driver in Python:
Transaction failed and will be retried in 1.0107646365462932s (Failed to read from defunct connection Address(host='localhost', port=7687) (Address(host='::1', port=7687, flow_info=0, scope_id=0)))
The code is like this:
class KGLoader(object):
def __init__(self):
config = Configuration.get_configs()
self.schemas = config.schemas
self.neo4j_driver = config.get_driver()
with self.neo4j_driver.session() as session:
current_indexes = KGLoader.get_all_indexes(session)
if 'NameIndex' not in current_indexes:
session.write_transaction(lambda tx: tx.run(cypher))
print('\nFull text NameIndex created!')
@staticmethod
def get_all_indexes(session):
all_indexes = set()
indexes = session.read_transaction(
lambda tx:
tx.run("CAll db.indexes"))
for index in indexes:
all_indexes.add(index[1])
return all_indexes
KG_LOADER = KGLoader()
The cypher is this:
CALL db.index.fulltext.createNodeIndex('NameIndex', ['Product', 'Computer'], ['name', 'alias'])
The same code doesn't have this problem in neo4j 4.0.4. Is the Python Bolt Driver for 4.2 not working yet? There is an issue registered here:
https://github.com/neo4j/neo4j-python-driver/issues/294
However, that issue is not exactly the same as mine.