When I try to hit this code, it works sometimes and sometimes it fails. I am also running other sparql which runs fine.
Consolated error log is copied below.
Node code:
console.log(firstName+timezone);
return query.execute(conn,'ps-bot-io', 'select ?greet { ' +
'?s <http://specs.purpleslate.data/conversation#greet> ?greet .' +
'} ORDER BY RAND()', {
limit: 1,
offset: 0
}).then((result ) => {
....}
Error at node console log :
Error getGr`eting() { FetchError: request to http://35.154.253.26:5820/ps-bot-io/query failed, reason: Parse Error
at ClientRequest.<anonymous> (/Users/arun/PurpleSlate/Work/ps-bot-intelligence/ps-bot-io/node_modules/node-fetch/index.js:134:11)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketOnData (_http_client.js:459:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at Socket.Readable.push (_stream_readable.js:211:10)
at TCP.onread (net.js:585:20)
name: 'FetchError',
message: 'request to http://35.154.253.26:5820/ps-bot-io/query failed, reason: Parse Error',
type: 'system',
errno: 'HPE_UNEXPECTED_CONTENT_LENGTH',
code: 'HPE_UNEXPECTED_CONTENT_LENGTH' }
Error greeting match for Link or text: TypeError: Cannot read property 'match' of undefined
at getGreeting.then (/Users/arun/PurpleSlate/Work/ps-bot-intelligence/ps-bot-io/routes/greeting.js:79:77)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Error log @ stardog.log:
ERROR 2017-09-22 06:47:52,905 [XNIO-1 task-5] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(226): An unexpected exception was handled by the server
org.openrdf.query.QueryEvaluationException: Index: 32789, Size: 1
at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:81) ~[stardog-utils-rdf-5.0.2.jar:?]
at org.openrdf.query.QueryResults.report(QueryResults.java:158) ~[sesame-query-4.0.0.jar:?]
at org.openrdf.query.resultio.QueryResultIO.writeTuple(QueryResultIO.java:449) ~[sesame-queryresultio-api-4.0.0.jar:?]
at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:475) ~[stardog-protocols-http-server-5.0.2.jar:?]
at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:446) ~[stardog-protocols-http-server-5.0.2.jar:?]
at com.complexible.stardog.protocols.http.server.SPARQLProtocol.executeQuery(SPARQLProtocol.java:133) ~[stardog-protocols-http-server-5.0.2.jar:?]
at com.complexible.stardog.protocols.http.server.SPARQLProtocol.post(SPARQLProtocol.java:90) ~[stardog-protocols-http-server-5.0.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0.2.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.IndexOutOfBoundsException: Index: 32789, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_131]
at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_131]
at com.complexible.memory.memoryblock.DefaultMemoryBlockChain.get(DefaultMemoryBlockChain.java:246) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.input.impl.MemoryInput.resetIndices(MemoryInput.java:249) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.input.impl.MemoryInput.initMemoryIndices(MemoryInput.java:343) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.input.impl.MemoryInput.init(MemoryInput.java:329) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.input.impl.DefaultTapeElementInputFactory.createMemoryInput(DefaultTapeElementInputFactory.java:78) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseConventionalQuickSorter.compare(BaseConventionalQuickSorter.java:66) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseQuickSorter.compare0(BaseQuickSorter.java:79) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseQuickSorter.isGreaterThanCurrent(BaseQuickSorter.java:53) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.sortPartition(BaseSorter.java:91) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:74) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:75) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:75) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:75) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:75) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.quickSort0(BaseSorter.java:75) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.sort0(BaseSorter.java:36) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.sort.sorters.quick.BaseSorter.sort(BaseSorter.java:24) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.impl.array.sorted.BaseSortedArray.sort(BaseSortedArray.java:391) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.impl.array.sorted.BaseSortedArray.sortDataInBlocks(BaseSortedArray.java:384) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.impl.array.sorted.BaseSortedArray.getTapeIterator(BaseSortedArray.java:166) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.memory.structure.impl.array.sorted.SortableArrayImpl.getTapeIterator(SortableArrayImpl.java:81) ~[stardog-memory-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.AbstractMMSolutionSequence.lambda$iterator$0(AbstractMMSolutionSequence.java:45) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.TapeToSolutionIterator.reset(CursorSolutionIterator.java:42) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.TapeToSolutionIterator.<init>(CursorSolutionIterator.java:36) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.AbstractMMSolutionSequence.iterator(AbstractMMSolutionSequence.java:45) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.OrderByMMSolutionSequence.iterator(OrderByMMSolutionSequence.java:35) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.mmcollections.AbstractMMSolutionSequence.iterator(AbstractMMSolutionSequence.java:28) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.OrderOp.sort(OrderOp.java:155) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.OrderOp.computeNext(OrderOp.java:137) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.OrderOp.computeNext(OrderOp.java:31) ~[stardog-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:83) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:33) ~[stardog-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:110) ~[stardog-5.0.2.jar:?]
at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:34) ~[stardog-5.0.2.jar:?]
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-18.0.jar:?]
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-18.0.jar:?]
at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:77) ~[stardog-utils-rdf-5.0.2.jar:?]
... 13 more