FrobberOfBits
FrobberOfBits

Reputation: 18002

ResourceAcquisitionFailedException while creating a new node

Users of an application that I work on are reporting this particular exception with neo4j 2.1.1. This appears to be sporadic and difficult to reproduce. Is this a known issue, or is it associated with any particular misuse or error? I would love to provide more information on how to reproduce this, but I cannot.

The code that creates this stacktrace is really dead simple:

Node n = null;

try (Transaction tx = db.beginTx()) {           
    n = db.createNode();
    // Lots of extra code snipped here because it never makes it that far...
} 

The exception seems to be thrown on the createNode() method:

SEVERE: Servlet.service() for servlet [Jersey REST Service] in context with path [/plus] threw exception
org.neo4j.kernel.impl.persistence.ResourceAcquisitionFailedException: TM encountered an unexpected error condition.
        at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.enlist(PersistenceManager.java:412)
        at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.forWriting(PersistenceManager.java:394)
        at org.neo4j.kernel.impl.api.KernelTransactionImplementation.ensureWriteTransaction(KernelTransactionImplementation.java:190)
        at org.neo4j.kernel.impl.api.KernelTransactionImplementation.upgradeToDataTransaction(KernelTransactionImplementation.java:220)
        at org.neo4j.kernel.impl.api.KernelStatement.dataWriteOperations(KernelStatement.java:83)
        at org.neo4j.kernel.InternalAbstractGraphDatabase.createNode(InternalAbstractGraphDatabase.java:1107)
        at org.mitre.provenance.db.neo4j.Neo4JStorage.store(Neo4JStorage.java:1101)

(big stack of servlet related exceptions snipped out here that)

At the bottom, there is this:

Caused by: javax.transaction.RollbackException: Tx status is: STATUS_MARKED_ROLLBACK
        at org.neo4j.kernel.impl.transaction.TransactionImpl.enlistResource(TransactionImpl.java:191)
        at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.enlist(PersistenceManager.java:405)
        ... 45 more

Upvotes: 2

Views: 147

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39915

A lot of fixes have been applied since 2.1.1, so make sure to run on the latest stable version (2.1.4 as of today). If the problem persists on 2.1.4, consider filing a github issue at https://github.com/neo4j/neo4j/issues/new

Upvotes: 1

Related Questions