# Error in stardog log when running a query

**URL:** <https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980>\
**Category:** Bug\
**Created:** [May 2, 2018, 12:54pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980 "2018-05-02T12:54:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [May 2, 2018, 12:54pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/1 "2018-05-02T12:54:15Z")

</div>

Hi,

A query is failing on me with the following error in stardog.log (sorry for the formatting, stardog is running in an enterprise environment and all I get is a 80x80 char terminal)

```auto
ERROR 2018-05-02 14:01:41,286 [XNIO-1 task-16] com.complexible.stardog.protocols
.http.server.StardogHttpServiceLoader:accept(231): An unexpected exception was h
andled by the server
org.openrdf.query.QueryEvaluationException: null
        at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(I
teratorAsTupleQueryResult.java:81) ~[stardog-utils-rdf-5.1.0.jar:?]
        at org.openrdf.query.QueryResults.report(QueryResults.java:158) ~[sesame
-query-4.0.0.jar:?]
        at org.openrdf.query.resultio.QueryResultIO.writeTuple(QueryResultIO.jav
a:449) ~[sesame-queryresultio-api-4.0.0.jar:?]
        at com.complexible.stardog.protocols.http.server.ProtocolUtils.writeTupl
eResponse(ProtocolUtils.java:563) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeRe
adQuery(ProtocolUtils.java:470) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeRe
adQuery(ProtocolUtils.java:455) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at com.complexible.stardog.protocols.http.server.SPARQLProtocol.executeQ
uery(SPARQLProtocol.java:134) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at com.complexible.stardog.protocols.http.server.SPARQLProtocol.get(SPAR
QLProtocol.java:82) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$
5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnabl
e.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:71) ~[stardog-protocols-http-server-5.1.0.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142) [?:1.8.0_111-internal]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617) [?:1.8.0_111-internal]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111-internal]
Caused by: java.lang.ArrayIndexOutOfBoundsException

```

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [May 2, 2018, 1:21pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/2 "2018-05-02T13:21:37Z")

</div>

Are you able to get any more of the stardog.log? It looks like the stack trace continues past what you’ve pasted. Also, how are you running the query?

---

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [May 9, 2018, 8:50am UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/3 "2018-05-09T08:50:14Z")

</div>

Hi @stephen

This is the query:

```auto
select ((count (distinct ?id)) as ?count ) WHERE { ?id rdf:type ?type }

```

Run without reasoning.

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [May 9, 2018, 3:42pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/4 "2018-05-09T15:42:19Z")

</div>

Are you running it via CLI, HTTP, Java, Studio…?

---

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [May 9, 2018, 4:00pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/5 "2018-05-09T16:00:12Z")

</div>

Java.

20 characters.

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [May 9, 2018, 4:35pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/6 "2018-05-09T16:35:30Z")

</div>

I seem unable to reproduce this issue locally. I can see that you’re using 5.1.0 server side. Which version of the client jar(s) are you using?

---

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [May 9, 2018, 4:54pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/7 "2018-05-09T16:54:45Z")

</div>

Same. 5.1.0 there too.

Håvard

---

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [May 9, 2018, 4:55pm UTC](https://community.stardog.com/t/error-in-stardog-log-when-running-a-query/980/8 "2018-05-09T16:55:36Z")

</div>

I’m away from the office, so I can’t log back in to check for more logs until Monday earliest. High security for the production systems.

Håvard
