Is this a bug for neo4j 4.2.1?

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:
                print('\nFull text NameIndex created!')
    def get_all_indexes(session):
        all_indexes = set()
        indexes = session.read_transaction(
            lambda tx:
  "CAll db.indexes"))
        for index in indexes:

        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:

However, that issue is not exactly the same as mine.

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 might work sometimes, but per our docs

1 Like