Venky
Venky

Reputation: 406

JanusGraph Error : "Could not find type for id" during a concurrent load operation

While performing a concurrent bulk load operation, I received this error. Subsequently, all my queries failed, and I kept getting the same error .

The exception I got is as follows:

java.lang.NullPointerException: Could not find type for id: 52237 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:250) at org.janusgraph.graphdb.types.vertices.JanusGraphSchemaVertex.name(JanusGraphSchemaVertex.java:57) at org.janusgraph.graphdb.vertices.AbstractVertex.label(AbstractVertex.java:121) at org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceElement.(ReferenceElement.java:57) at org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex.(ReferenceVertex.java:46) at org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory.detach(ReferenceFactory.java:48) at org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory.detach(ReferenceFactory.java:69) at org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory.detach(ReferenceFactory.java:80) at org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy.halt(HaltedTraverserStrategy.java:60) at org.apache.tinkerpop.gremlin.server.util.TraverserIterator.next(TraverserIterator.java:64) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:529) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$4(TraversalOpProcessor.java:382) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Some additional context :

  1. storage.batch-loading was NOT enabled
  2. The bulk write operation I was running was highly concurrent and with high load
  3. I used about 100 instances of gremlin server connecting to Cassandra/ES backend
  4. I did not explicitly define a schema

Would be great if someone could give me an idea about what could have caused this . Thanks !

Upvotes: 3

Views: 534

Answers (1)

syed adeeb
syed adeeb

Reputation: 139

it happens if multiple instance of gremlin-server are running it is because gremlin server was not shutdown or killed properly. it can be because the vm on which gremlin-server is running might have restarted.

so the solution is login to gremlin-console and run your commands based on your backend.in my case it's cassandra and elasticsearch

so i will run

method 1

:remote connect tinkerpop.server conf/remote.yaml session

:remote console session

or

graph=JanusGraphFactory.open('conf/janusgraph-cql-es.properties');

g=graph.traversal()

and if you are running containers then your command must be similar to this

graph=JanusGraphFactory.open('/etc/opt/janusgraph/janusgraph.properties');

g=graph.traversal()

now after running those you can run

mgmt = graph.openManagement()

mgmt.getOpenInstances()

it will display all the instances

eg

ac12000231-a9ffbcbb0e921

ac12000230-a9ffbcbb0e921(current)

except that current instance close other instances

mgmt.forceCloseInstance('ac12000231-a9ffbcbb0e921')

after closing all the instances commit the changes

mgmt.commit()

now restart your gremlin server and run your query it should work

method 2

if the problem persists just kill your gremlin-server and start it again few times...it should work

load command should work

another reason why this happens is if the data is not restored properly.. if you are using cluster take the backup on all the nodes then restore on your destination node or nodes

i used nodetool for backup and sstableloader for restoring data

Upvotes: 0

Related Questions