# httpCIient() HTTP Timeout from Project Script

**URL:** <https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [May 15, 2025, 12:41pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295 "2025-05-15T12:41:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 15, 2025, 12:41pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/1 "2025-05-15T12:41:32Z")

</div>

v8.1.44  
I have a project script with a top-level variable holding a reference to a `system.net.httpClient()`

```python
client = system.net.httpClient()

```

In another project script, I reference the client variable to call an API.

```python
client = logistics.api.http.client
apiMethod = 'locations'
url = logistics.api.http.formatUrl(apiClass, apiMethod)
	
session_token = logistics.api.http.getSessionToken()
params = {'session_token':session_token}
#------------------------------------------------------------------------------------------------#
response = client.get(url, params=params)
...

```

Some days everything works perfect in the perspective project. Then other days, I get nothing but http timeout errors when calling the APIs. Copy/paste the URL into a browser and it runs perfect.

> **Gateway Error**
>
> ```python
> com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 2, in runAction File "", line 157, in refreshList at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:104) at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:308) at jdk.internal.reflect.GeneratedMethodAccessor1490.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.io.IOException: java.io.IOException: Unable to GET https://api.gpsinsight.com/v2/driver/list?session_token=<myToken>
> at org.python.core.Py.JavaError(Py.java:545)
> at org.python.core.Py.JavaError(Py.java:536)
> at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:192)
> at org.python.core.PyObject. __call__ (PyObject.java:422)
> at org.python.core.PyMethod.instancemethod ___call__ (PyMethod.java:237)
> at org.python.core.PyMethod. __call__ (PyMethod.java:228)
> at org.python.pycode._pyx185424.refreshList$2(:167)
> at org.python.pycode._pyx185424.call_function()
> at org.python.core.PyTableCode.call(PyTableCode.java:173)
> at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
> at org.python.core.PyBaseCode.call(PyBaseCode.java:112)
> at org.python.core.PyFunction. __call__ (PyFunction.java:406)
> at org.python.pycode._pyx185423.runAction$1(:2)
> at org.python.pycode._pyx185423.call_function()
> at org.python.core.PyTableCode.call(PyTableCode.java:173)
> at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
> at org.python.core.PyFunction.function ___call__ (PyFunction.java:474)
> at org.python.core.PyFunction. __call__ (PyFunction.java:469)
> at org.python.core.PyFunction. __call__ (PyFunction.java:464)
> at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)
> at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:829)
> at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:868)
> at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:1010)
> at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:950)
> at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:161)
> at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:98)
> at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:80)
> at com.inductiveautomation.perspective.gateway.action.ActionDecorator.runAction(ActionDecorator.java:18)
> at com.inductiveautomation.perspective.gateway.action.SecuredAction.runAction(SecuredAction.java:44)
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)
> at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)
> at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
> at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at com.inductiveautomation.perspective.gateway.threading.BlockingWork$BlockingWorkRunnable.run(BlockingWork.java:58)
> at java.base/java.lang.Thread.run(Unknown Source)
> Caused by: org.python.core.PyException: java.io.IOException: java.io.IOException: Unable to GET https://api.gpsinsight.com/v2/driver/list?session_token=<myToken>
> ... 40 common frames omitted
> Caused by: java.io.IOException: Unable to GET https://api.gpsinsight.com/v2/driver/list?session_token=<myToken>
> at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:104)
> at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:308)
> at jdk.internal.reflect.GeneratedMethodAccessor1490.invoke(Unknown Source)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.base/java.lang.reflect.Method.invoke(Unknown Source)
> at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:190)
> ... 37 common frames omitted
> Caused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out
> at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
> at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
> at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:102)
> ... 42 common frames omitted
> java.net.http.HttpConnectTimeoutException: HTTP connect timed out
> at java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(Unknown Source)
> at java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(Unknown Source)
> at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
> at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
> at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
> at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
> at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
> at java.net.http/jdk.internal.net.http.Exchange.checkCancelled(Unknown Source)
> at java.net.http/jdk.internal.net.http.Exchange.cancel(Unknown Source)
> at java.net.http/jdk.internal.net.http.MultiExchange.cancel(Unknown Source)
> at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectTimerEvent.handle(Unknown Source)
> at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(Unknown Source)
> at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)
> Caused by: java.net.ConnectException: HTTP connect timed out
> ... 13 common frames omitted
> 
> ```

---

<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:** [May 15, 2025, 12:50pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/2 "2025-05-15T12:50:28Z")

</div>

> [@dkhayes117](#):
>
> `HTTP connect timed out`

That's pretty definitively **not** an Ignition problem. That is a network issue or firewall issue between your gateway and your API server. Or, perhaps, a rate limiter on the API server.

(Testing elsewhere is meaningless.)

You will need IT help to pinpoint it. You probably should use wireshark to capture traffic when this happens. It will almost certainly show unanwered SYN packets for the connection attempts.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 15, 2025, 12:57pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/3 "2025-05-15T12:57:09Z")

</div>

As soon as I fired up wireshark on the gateway, it started working 🤦‍♂️ I'll have to wait for the next outage before I can capture anything.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 10, 2025, 7:05pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/4 "2025-07-10T19:05:21Z")

</div>

I still haven't figured this out yet, but I wanted to note that every time I start getting timeout errors, opening WireShark on the gateway immediately fixes the problem. Note I'm not doing anything in WireShark, simply opening it. 🤔

---

<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:** [July 10, 2025, 7:10pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/5 "2025-07-10T19:10:50Z")

</div>

Gateway is on Windows, I'm going to guess? (I suspect your windows firewall, which WS has to modify to work with raw Ethernet frames.)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 10, 2025, 7:13pm UTC](https://forum.inductiveautomation.com/t/httpciient-http-timeout-from-project-script/106295/6 "2025-07-10T19:13:13Z")

</div>

Yes, Windows Server 2019. The goal is to move to Linux at some point, but we aren't there yet.
