# Query Stuck in "Active Queries" on the Gateway

**URL:** <https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051>\
**Category:** Ignition\
**Tags:** ignition79, database, vision\
**Created:** [May 7, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051 "2024-05-07T17:10:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_CARRIERE](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicolas\_CARRIERE](https://forum.inductiveautomation.com/u/Nicolas_CARRIERE)\
**Post date:** [May 7, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/1 "2024-05-07T17:10:26Z")

</div>

Hi all,  
I am having an issue with a tag binding query. I was doing some tests and was changing the query and everything was fine. But at one point, I reached the state where the query wasn't running and I saw in my gateway it was stuck (see screenshot below). I tried to cancel it, I tried to disable the tag but the query is still active. I also tried to run that query in my DB Query browser and the query worked.  
So because this query is stuck, I am not able to change any other query in my application and the tags ,that I tried to change after that fault, are showing me that: ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b7c0fb1dd637cb178870d5de57a9e4c8df77886.png).  
Does anyone know why this is happening and how can I fix it?  
I am using Ignition 7.9 - Vision. The DB is MSSQL.  
Thank you in advance for your time.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/dec9cc2cbb1da1dbeff7780db155bb7ddd5aa1c6.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 7, 2024, 5:25pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/2 "2024-05-07T17:25:35Z")

</div>

Restart your gateway.

---

<div class="post-metadata">

**Author:** ![Nicolas\_CARRIERE](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicolas\_CARRIERE](https://forum.inductiveautomation.com/u/Nicolas_CARRIERE)\
**Post date:** [May 7, 2024, 5:34pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/3 "2024-05-07T17:34:47Z")

</div>

I am trying to find another way to do it because this will cause downtime in the factory production^^' But if this is the only solution, I will do it for sure, thank you.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 7, 2024, 5:39pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/4 "2024-05-07T17:39:31Z")

</div>

MSSQL should have a way to see incoming connections/queries, and presumably some way to kill the query from their side?

---

<div class="post-metadata">

**Author:** ![Nicolas\_CARRIERE](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicolas\_CARRIERE](https://forum.inductiveautomation.com/u/Nicolas_CARRIERE)\
**Post date:** [May 7, 2024, 7:16pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/5 "2024-05-07T19:16:36Z")

</div>

I am trying to get the credential for the DB from my customer, I will keep you posted, thank you.

---

<div class="post-metadata">

**Author:** ![Patrick\_Fuller](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick_fuller/32/61996_2.png) [@Patrick\_Fuller](https://forum.inductiveautomation.com/u/Patrick_Fuller)\
**Post date:** [May 7, 2024, 9:30pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/6 "2024-05-07T21:30:31Z")

</div>

You could disable the DB connection in the Ignition Gateway then re-enable it. That might kill it without restarting the gateway.

---

<div class="post-metadata">

**Author:** ![Nicolas\_CARRIERE](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicolas\_CARRIERE](https://forum.inductiveautomation.com/u/Nicolas_CARRIERE)\
**Post date:** [May 8, 2024, 3:11pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/7 "2024-05-08T15:11:48Z")

</div>

Hi all, The query cleared itself after 24h , I wasn't able to test your suggestions. Thank you for your time ^^

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 8, 2024, 3:31pm UTC](https://forum.inductiveautomation.com/t/query-stuck-in-active-queries-on-the-gateway/90051/8 "2024-05-08T15:31:08Z")

</div>

Consider updating your DB connection properties to add a `queryTimeout` value:

> **[Setting the connection properties - JDBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver16)**
>
> The connection string properties for the Microsoft JDBC Driver for SQL Server can be specified in various ways.

In the 'Extra Connection Properties' section.
