# Gateway Exception : Read Timed Out Caused By SocketTimeoutException

**URL:** <https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352>\
**Category:** Ignition\
**Created:** [August 4, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352 "2020-08-04T13:18:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [August 4, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/1 "2020-08-04T13:18:40Z")

</div>

I had an issue this morning where my users were not able to access a particular project, I had other

running in the same gateway that were working just fine.

The error message that every client received when trying to access the project was the following:

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

I re-started the gateway service and this resolved the issue, however, this is very concerning.

Has anyone run into this error before? If so, what does it mean, what causes it, and how can I prevent

this from happening in the future?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2020, 1:27pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/2 "2020-08-04T13:27:47Z")

</div>

It means that some gateway call in the client took too long and got cut off. There are many possibilities for such behavior, but it is typically a database query that is grabbing an unusually large amount of data, or a query that doesn’t have suitable indexing for efficient operation. The latter is a problem that grows worse as the database stores more and more data.

Any gateway that doesn’t have sufficient resources will push clients into these problems as you add projects and clients and otherwise push the load higher. A common mis-configuration (IMNSHO) is to put the database on the same server as Ignition, for anything but toy deployments.

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [August 4, 2020, 1:35pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/3 "2020-08-04T13:35:14Z")

</div>

The database doesn’t reside on the server but instead I’m utilizing Azure cloud services. Do you have any tips on how I could narrow down the root cause?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2020, 1:39pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/4 "2020-08-04T13:39:34Z")

</div>

Look in in your gateway logs for timeouts, long query warnings, or “clock drift” warnings. The latter are often indicators of insufficient gateway memory (or misconfiguration on older Ignition versions).

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [August 4, 2020, 3:31pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/5 "2020-08-04T15:31:29Z")

</div>

I’ll start some investigation, thank you for the recommendations, appreciated.

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [August 7, 2020, 4:44pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/6 "2020-08-07T16:44:42Z")

</div>

In ignition 8.0.10 version on client side some time because of network fluctuation or internet connection issue system generated error message shows on the user’s screen, it’s ok, but when we get a network or internet connection that time that message box should be removed automatically instead of press OK button on that error message box. Can you please help us how we can show our custom error message box and it should be remove automatically when user got network connection.

We can also use system.util.setReadTimeout(20000) function but how can we identify system called that function so in client window show our custom messagebox.

---

<div class="post-metadata">

**Author:** ![sagar.iparkar](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sagar.iparkar](https://forum.inductiveautomation.com/u/sagar.iparkar)\
**Post date:** [August 8, 2020, 4:38am UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/7 "2020-08-08T04:38:55Z")

</div>

Can you please help us how to custom error message display when gateway throws network related error?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 8, 2020, 1:57pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/8 "2020-08-08T13:57:06Z")

</div>

There's no customization available for Ignition's built-in error popup, AFAIK. I recall scripts posted here on the forum to auto-close the popups, but I haven't used them. You can improve the behavior of scripts with consistent use of jython `try` ... `except` ... clauses, catching errors before they get to the built-in popup. Do note that jython needs two `except` clauses to catch both jython and java errors, like so:

> [@Catch IOException?](http://forum.inductiveautomation.com/t/catch-ioexception/18612/3):
>
> Consider using two except blocks, as jython’s standard Exception won’t catch pure java exceptions. Like so: import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: # java exception

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [June 23, 2022, 1:23pm UTC](https://forum.inductiveautomation.com/t/gateway-exception-read-timed-out-caused-by-sockettimeoutexception/37352/9 "2022-06-23T13:23:48Z")

</div>

I have my ignition gateway on the azure as well.  
whenever I tried change the tag name under the tag browser, there are 50% chance the screen will freeze and around 30 seconds later I will receive this error.

Have you find a solution to it?
