Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Gremlin with neo4j graph only responding at node count after "No space left on device" error


Our server (docker image) currently crashed after running out of space ("No space left on device") after I tried to export the graph in GraphSON. File took up all space on the container. So deleted the file and restarted the server which had errors related to "gremlin-groovy is not an available GremlinScriptEngine" so wouldn't start. Looked around for solutions and found this to restore the graph from "No space left on device"

I tried to restore the graph from moving the neostore.transactions* files and restarting the server. Graph start without any errors but no query responses from there on (from console I get the prompt back with no response, no error codes). Only query working is the node count

gremlin> g.V().count()

Then decided to use the neo4j-admin check consistency tool to see if there was a way to fix this. Took a while.

At this point count() is still the only think that works. Other queries though return an error now

gremlin> g.V().label().dedup()
Token for id 3
  • Exception with stack trace
[WARN] AbstractEvalOpProcessor - Exception processing a script on request [RequestMessage{, requestId=f032ca5f-6ba1-4f47-b06c-2cdd7639a33d, op='eval', processor='', args={gremlin=g.V().label().dedup(), batchSize=64}}].
org.neo4j.kernel.impl.core.TokenNotFoundException: Token for id 3
        at org.neo4j.kernel.impl.core.DelegatingTokenHolder.getTokenById(
        at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.labelGetName(
        at org.neo4j.kernel.impl.api.OperationsFacade.labelGetName(
        at org.neo4j.kernel.impl.core.NodeProxy.convertToLabel(
        at org.neo4j.kernel.impl.core.NodeProxy.lambda$getLabels$2(
        at org.neo4j.collection.primitive.PrimitiveIntCollections$
        at org.neo4j.helpers.collection.Iterators.addToCollection(
        at org.neo4j.helpers.collection.Iterators.asList(
        at org.neo4j.kernel.impl.core.NodeProxy.getLabels(
        at org.neo4j.tinkerpop.api.impl.Neo4jNodeImpl.labels(
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex.labels(
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex.label(
        at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(
        at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(
        at org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep.processNextStart(
        at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(
        at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(
        at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(
        at org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.handleIterator(
        at org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.lambda$evalOpInternal$5(
        at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(
        at java.util.concurrent.Executors$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

Any suggestions to restore the graph?

  • neo4j version = 3.5.20
  • apache tinkerpop gremlin server = 3.4.7


It seems like the database is likely corrupt, personally I suggest the best approach would be to do the import with enough disk space to finish successfully.

If you have available disk space on the system, it is possible to map volumes to the docker container so that the container doesn't store everything to the default location, including the neo4j db... I always map data storage volumes because (on linux) docker defaults to storing things down in /var/lib/docker, filling up my boot disk in a (sort of) hidden location, and it is also helpful if you want the db to persist beyond the life of the container.