Neo.TransientError.Transaction.LockAcquisitionTimeout:

Hello Team,

I am getting below error while running the below cypher query:
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM 'file:///granite2csv_path.csv' as row
MATCH (n:SPLITTER1_IN_PORT {SPLITTER1_NAME: row.PATH_ASIDE_EQUIPMENT })
MATCH (m:SPLITTER1_OUT_PORT {SP1_OUT_PORT_NAME: row.PATH_ASIDE_PORT})
MERGE (n)-[r:SP1_INPORT_2_SP1_OUTPORT]->(m)
return r

Error:

Neo.TransientError.Transaction.LockAcquisitionTimeout: The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. Unable to acquire lock within configured timeout. Unable to acquire lock for resource: NODE with id: 245426 within 10000 millis.

Please suggest how to solve this and why this error comes?

From the error message it sounds like you might have another query running which has a lock on a node that you're trying to write to. Are you running multiple queries at the same time?

Hello Mark,

Thanks for a very quick reply.
You mean to say that same query is running twice?

Regards
Akshat

Hi Akshat,

We don't know if it's another execution of the same query or a separate query, but we do know there is a transaction open at the time of that execution that held the lock on the node with id 245426 for at least 10 seconds, preventing the query you ran from acquiring the lock and triggering the lock acquisition timeout.

You may want to use dbms.listQueries() and/or dbms.listTransactions() if you see the timeout again to figure out what else is running that might be holding onto the locks.