# SocketTimeoutException: connect timed out

**URL:** <https://forum.inductiveautomation.com/t/sockettimeoutexception-connect-timed-out/4607>\
**Category:** Ignition\
**Created:** [June 11, 2012, 7:05am UTC](https://forum.inductiveautomation.com/t/sockettimeoutexception-connect-timed-out/4607 "2012-06-11T07:05:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [June 11, 2012, 7:05am UTC](https://forum.inductiveautomation.com/t/sockettimeoutexception-connect-timed-out/4607/1 "2012-06-11T07:05:28Z")

</div>

It seems I get an error window waiting for me every morning if I leave designer running a SQL query running on screen. The error is

``  
java.lang.Exception: Error running query:  
SQLQuery(query=SELECT \*  
from Energy\_Centre\_Engine\_Calculation, database=)@5000ms  
On: test.Root Container.Calculation  
at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:316)  
at java.lang.Thread.run(Unknown Source)  
Caused by: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: connect timed out  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:302)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.getResponse(GatewayInterface.java:440)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:238)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:233)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.runLimitQuery(GatewayInterface.java:688)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.runQuery(GatewayInterface.java:652)  
at com.inductiveautomation.factorypmi.application.gateway.SQLQuery.execute(SQLQuery.java:48)  
at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.execute(QueryManager.java:697)  
at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.access$500(QueryManager.java:670)  
at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:314)  
… 1 more  
Caused by: java.net.SocketTimeoutException: connect timed out  
at java.net.PlainSocketImpl.socketConnect(Native Method)  
at java.net.PlainSocketImpl.doConnect(Unknown Source)  
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)  
at java.net.PlainSocketImpl.connect(Unknown Source)  
at java.net.SocksSocketImpl.connect(Unknown Source)  
at java.net.Socket.connect(Unknown Source)  
at sun.net.NetworkClient.doConnect(Unknown Source)  
at sun.net.www.http.HttpClient.openServer(Unknown Source)  
at sun.net.www.http.HttpClient.openServer(Unknown Source)  
at sun.net.www.http.HttpClient.(Unknown Source)  
at sun.net.www.http.HttpClient.New(Unknown Source)  
at sun.net.www.http.HttpClient.New(Unknown Source)  
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)  
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)  
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)  
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.getResponse(GatewayInterface.java:337)  
… 9 more

Ignition v7.4.1 (b906)  
Java: Sun Microsystems Inc. 1.6.0\_18

``

Any ideas why I would get this every evening/night? The database is on the same server as the gateway.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [June 11, 2012, 3:03pm UTC](https://forum.inductiveautomation.com/t/sockettimeoutexception-connect-timed-out/4607/2 "2012-06-11T15:03:46Z")

</div>

That error means the query is taking longer than 1 minute to complete. Maybe there is a backup happening on the database causing it to go slow (if it is every night). It could also be a virus scanner checking that directory. You can increase the minute timeout to something higher but that will only hide the issue. I would look into a backup or virus scanner.
