# Help with: java.io.IOException fixed content-length: X, bytes received: Y

**URL:** <https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 9, 2023, 8:51pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232 "2023-10-09T20:51:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [October 9, 2023, 8:51pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/1 "2023-10-09T20:51:19Z")

</div>

I have dug around and am not finding any examples of this on the forums,

However I have an HttpClient making a `get` request to a flask server, and that flask servers response comes back 95% of the time. However every once in a while I am getting an IOException that my return isn't as large as it should be.

Here is the code being called:

```python
httpClient.get(url, params=params, data=data)

```

### Exception:

```python
EXCEPTION: IOException(<module:API.Flask>, LINE 82 ""): 
java.io.IOException: Unable to GET endpoint/route/connections?node_a=D2012-C404&node_b=CLLR-C404, 
MESSAGE: Error getting request, 
CAUSE: fixed content-length: 41069, bytes received: 11970

```

### Stacktrace:

This is actually a cloned stack trace off of `Throwable().setStackTrace(exception.getCause().getStackTrace())` so I could print it into my logs)

> **Stacktrace**
>
> ```python
> java.lang.Throwable: Error getting request
> 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:101)
> at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:306)
> at jdk.internal.reflect.GeneratedMethodAccessor37.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)
> 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._pyx1756._send_request$11(:119)
> at org.python.pycode._pyx1756.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 org.python.core.PyObject._callextra(PyObject.java:589)
> at org.python.pycode._pyx1759.wrapper$2(:25)
> at org.python.pycode._pyx1759.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:197)
> at org.python.core.PyFunction. __call__ (PyFunction.java:485)
> at org.python.core.PyMethod.instancemethod ___call__ (PyMethod.java:237)
> at org.python.core.PyMethod. __call__ (PyMethod.java:228)
> at org.python.pycode._pyx1756._call_endpoint$9(:50)
> at org.python.pycode._pyx1756.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:197)
> at org.python.core.PyFunction. __call__ (PyFunction.java:485)
> at org.python.core.PyMethod. __call__ (PyMethod.java:187)
> at org.python.pycode._pyx1756.get$4(:19)
> at org.python.pycode._pyx1756.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:197)
> at org.python.core.PyFunction. __call__ (PyFunction.java:485)
> at org.python.core.PyMethod.instancemethod ___call__ (PyMethod.java:237)
> at org.python.core.PyMethod. __call__ (PyMethod.java:228)
> at org.python.pycode._pyx1751.get_manual_jumps$3(:56)
> at org.python.pycode._pyx1751.call_function()
> at org.python.core.PyTableCode.call(PyTableCode.java:173)
> at org.python.core.PyBaseCode.call(PyBaseCode.java:150)
> at org.python.core.PyFunction. __call__ (PyFunction.java:426)
> at org.python.pycode._pyx1714.transform$1(:9)
> at org.python.pycode._pyx1714.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:846)
> at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:828)
> at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:832)
> at com.inductiveautomation.perspective.gateway.binding.transforms.script.ScriptTransform.runFunction(ScriptTransform.java:116)
> at com.inductiveautomation.perspective.gateway.binding.transforms.script.ScriptTransform.synchronousTransformInternal(ScriptTransform.java:162)
> at com.inductiveautomation.perspective.gateway.binding.transforms.AbstractSynchronousTransform.transform(AbstractSynchronousTransform.java:30)
> at com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness$TransformSequencer.transform(AbstractBindingHarness.java:295)
> at com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness$TransformSequencer.run(AbstractBindingHarness.java:308)
> 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)
> 
> ```

Any ideas on what could be causing this? The answers I got from ChatGPT start to send me down some very complicated rabbit holes...

---

<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:** [October 9, 2023, 8:54pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/2 "2023-10-09T20:54:30Z")

</div>

I would think you've triggered some firewall along the path and it substituted an error page after the headers were delivered.

---

<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:** [October 9, 2023, 9:24pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/3 "2023-10-09T21:24:14Z")

</div>

I'll concur with Phil. Can you set up a persistent trace/Wireshark/whatever ( assuming the traffic isn't TLS)?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 9, 2023, 10:07pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/4 "2023-10-09T22:07:22Z")

</div>

> IOException fixed content-length: X byes received: y

Kieth, did your title get garbled?

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [October 10, 2023, 3:58pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/5 "2023-10-10T15:58:19Z")

</div>

Hmmm.... So we are talking about two VMs on the same subnet, one of them being a linux install of Ignition, the other being a linux server running two podman based containers (one for Flask and one for a Graph db)

Per asking the person that setup the infrastructure, it doesnt seem there are any firewalls between the two unless something native with RHEL or Podman could be standing in the way...

Through some rough searches through documentation, it seems like it may be a podman firewall that isn't happy when we send a lot of requests through it, guess there is more searching to do there.

---

<div class="post-metadata">

**Author:** ![Alex\_Spyksma](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Alex\_Spyksma](https://forum.inductiveautomation.com/u/Alex_Spyksma)\
**Post date:** [November 8, 2023, 9:00pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/6 "2023-11-08T21:00:26Z")

</div>

To close the loop on this issue:

The root cause of this issue is due to the implementation of the httpClient calls coming from within a function where the data default value is set to None. This causes intermittent issues with the response.

```auto
def _send_request(self, req_type, endpoint, params=None, data=None):
    ... <other code>
    response = self.client.get(url, params=params, data=data)

```

---

<div class="post-metadata">

**Author:** ![cmaynes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmaynes/32/6852_2.png) [@cmaynes](https://forum.inductiveautomation.com/u/cmaynes)\
**Post date:** [August 13, 2025, 3:48pm UTC](https://forum.inductiveautomation.com/t/help-with-java-io-ioexception-fixed-content-length-x-bytes-received-y/80232/7 "2025-08-13T15:48:46Z")

</div>

Thank you! Never would have thought of this.

Not sure why, but only passing in params when they had values to the client fixed my intermittent java.io.IOException issue as well. Tested Python 3 with requests and Python 2.7.18 with urllib2 in VSCode and both could call the same endpoint in a loop endlessly without issues. system.net.httpClient threw errors after a few loops until I made this change.

So it does not seem to be a firewall issue as previously mentioned in many threads on httpClient, but probably an implementation issue in httpClient itself.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/81e9e5f97b9eba789a6ba737e6c35d3eed3981be.png)
