Discussion Forum

Lot of exceptions while running queries using Java Client API

Hi
I am trying to execute a bunch of queries one by one. Sometimes it works just fine. But sometime, it throws out exceptions like below:
1.
2020-09-01 06:46:53,684 [transaction-listener] ERROR g.c.s.r.SessionService$TransactionListener - Runtime Exception in RPC TransactionListener:
grakn.core.graph.core.JanusGraphException: Exception while executing backend operation EdgeStoreQuery
at grakn.core.graph.diskstorage.util.BackendOperation.execute(BackendOperation.java:66)
at grakn.core.graph.diskstorage.BackendTransaction.executeRead(BackendTransaction.java:400)
at grakn.core.graph.diskstorage.BackendTransaction.edgeStoreQuery(BackendTransaction.java:206)
at grakn.core.graph.graphdb.database.StandardJanusGraph.edgeQuery(StandardJanusGraph.java:399)
at grakn.core.graph.graphdb.query.vertex.SimpleVertexQueryProcessor.lambda$getBasicIterator$1(SimpleVertexQueryProcessor.java:120)
at grakn.core.graph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:99)
at grakn.core.graph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:91)
at grakn.core.graph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:83)
at grakn.core.graph.graphdb.query.vertex.SimpleVertexQueryProcessor.lambda$getBasicIterator$2(SimpleVertexQueryProcessor.java:120)
at grakn.core.graph.graphdb.vertices.CacheVertex.loadRelations(CacheVertex.java:69)
at grakn.core.graph.graphdb.query.vertex.SimpleVertexQueryProcessor.getBasicIterator(SimpleVertexQueryProcessor.java:120)
at grakn.core.graph.graphdb.query.vertex.SimpleVertexQueryProcessor.iterator(SimpleVertexQueryProcessor.java:83)
at grakn.core.graph.graphdb.transaction.RelationConstructor$1.(RelationConstructor.java:47)
at grakn.core.graph.graphdb.transaction.RelationConstructor.lambda$readRelation$0(RelationConstructor.java:45)
at grakn.core.graph.graphdb.tinkerpop.optimize.JanusGraphVertexStep.flatMap(JanusGraphVertexStep.java:217)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:49)
at grakn.core.graph.graphdb.tinkerpop.optimize.JanusGraphVertexStep.processNextStart(JanusGraphVertexStep.java:182)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep.standardAlgorithm(BranchStep.java:112)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep.processNextStart(ComputerAwareStep.java:46)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
at org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep.standardAlgorithm(BranchStep.java:130)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep.processNextStart(ComputerAwareStep.java:46)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:37)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep.processNextStart(WherePredicateStep.java:150)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:36)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep.processNextStart(SelectOneStep.java:131)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:37)
at org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep.processNextStart(WherePredicateStep.java:150)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:36)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectStep.processNextStart(SelectStep.java:156)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
at grakn.core.graql.executor.util.LazyMergingStream$1.hasNext(LazyMergingStream.java:61)
at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
at grakn.core.server.rpc.SessionService$Iterators.next(SessionService.java:498)
at grakn.core.server.rpc.SessionService$TransactionListener.next(SessionService.java:466)
at grakn.core.server.rpc.SessionService$TransactionListener.handleRequest(SessionService.java:237)
at grakn.core.server.rpc.SessionService$TransactionListener.lambda$onNext$1(SessionService.java:187)
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)
Caused by: com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT20S
at com.datastax.oss.driver.api.core.DriverTimeoutException.copy(DriverTimeoutException.java:34)
at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:149)
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:53)
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:30)
at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:208)
at com.datastax.oss.driver.api.core.CqlSession.execute(CqlSession.java:51)
at grakn.core.graph.diskstorage.cql.CQLStoreManager.executeOnSession(CQLStoreManager.java:282)
at grakn.core.graph.diskstorage.cql.CQLKeyColumnValueStore.getSlice(CQLKeyColumnValueStore.java:299)
at grakn.core.graph.diskstorage.keycolumnvalue.KCVSProxy.getSlice(KCVSProxy.java:73)
at grakn.core.graph.diskstorage.BackendTransaction$1.call(BackendTransaction.java:209)
at grakn.core.graph.diskstorage.BackendTransaction$1.call(BackendTransaction.java:206)
at grakn.core.graph.diskstorage.util.BackendOperation.execute(BackendOperation.java:53)
… 63 common frames omitted

2020-09-01 07:46:52,169 [JanusGraphID(15)(3)[0]] WARN g.c.g.d.i.ConsistentKeyIDAuthority - Temporary storage exception while acquiring id block - retrying in PT0.6S: {}
grakn.core.graph.diskstorage.TemporaryBackendException: Wrote claim for id block [36080001, 36160001) in PT3.097S => too slow, threshold is: PT0.3S
at grakn.core.graph.diskstorage.idmanagement.ConsistentKeyIDAuthority.getIDBlock(ConsistentKeyIDAuthority.java:321)
at grakn.core.graph.graphdb.database.idassigner.StandardIDPool$IDBlockGetter.call(StandardIDPool.java:263)
at grakn.core.graph.graphdb.database.idassigner.StandardIDPool$IDBlockGetter.call(StandardIDPool.java:233)
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)

This results in high CPU usage in Grakn server and the server seems stuck. Every time i have to restart the server to make it work as before. Please help me out in solving this. If there is anything needed from my side as part of configuration or handling sessions, let me know.

Thanks
Satya

Hi - what version of Grakn and which client & version are you using?
What kind of data loading scenario leads to this - are you multithreading as well?

Hi Joshua,

I am using version 1.6. And the data loading is done sequentially one by one and not by multi-threading. Is there something that I should look at more deeply.

Thanks
Satya

Is there any chance you can update to a more recent version of Grakn? It may be that the issues have already been resolved! I believe 1.6 is already a year or so old

I am using the latest version grakn downloaded today only and using it on windows 10. The grakn server starts but I am unable to use console and it gives me errors.