# Workflow query error in 1.5.1

**URL:** <https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277>\
**Category:** Community Support\
**Created:** [January 7, 2021, 4:45pm UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277 "2021-01-07T16:45:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [January 7, 2021, 4:45pm UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277/1 "2021-01-07T16:45:55Z")

</div>

I have a long running workflow . when i query this workflow (which is in running state)  
i get the below error in web.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/1X/ff40d58feb56d1885f48207d6198908c06128855.png)

any idea what could be going wrong ?

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [January 7, 2021, 5:09pm UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277/2 "2021-01-07T17:09:59Z")

</div>

seems that if a workflow is in timed sleep state, this occurs. if, after invoking Workflow.sleep().  
looks like a bug

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 7, 2021, 5:31pm UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277/3 "2021-01-07T17:31:40Z")

</div>

Currently query doesn’t support any calls to Workflow… APIs.

I filed an issue to add support for `Workflow.getInfo` calls from query methods.

The workaround is to call getInfo from the main workflow method and store it in a field. Then the query would return the field value.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.temporal.io/u/madhu)\
**Post date:** [January 8, 2021, 4:46am UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277/4 "2021-01-08T04:46:43Z")

</div>

Thanks @maxim, seems this is because of some logging enhancement i did to print to workflow id in all logs (using wofkflow.getinfo.getWorkflowId)

DId not realise that the logging change will have this side effect 🙂

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 8, 2021, 5:37pm UTC](https://community.temporal.io/t/workflow-query-error-in-1-5-1/1277/5 "2021-01-08T17:37:56Z")

</div>

I don’t think there is a need to pass `workflowId` explicitly. The `workflowId` [is already part of the MDC.](https://github.com/temporalio/sdk-java/blob/d1ea450c38d6554c301bba79dddeccf9793f0b24/temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowThreadImpl.java#L94)
