cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Is this a bug for neo4j 4.2.1?

lingvisa
Graph Fellow

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.

2 REPLIES 2

Afaik this is just a warning / the retry should happen under the hood.

Is the index created at the end?

from one of our folks

for instance, in that get_all_indexes() method, they should be consuming and returning the results of the transaction. That’s technically not happening with that lambda usage...it might work sometimes, but per our docs