# java.io.IOException: End of stream reached

**URL:** <https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424>\
**Category:** Ignition\
**Created:** [June 3, 2021, 6:57pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424 "2021-06-03T18:57:03Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 3, 2021, 6:57pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/1 "2021-06-03T18:57:03Z")

</div>

I get this error after adding a modbus device. I’m not sure what is causing it. My tag does not work. But when I use a modbus tcp troubleshooting program I can successfully read from the device.

```auto
2021-06-02 11:36:20 AM	SocketIODelegate	[hostname=10.10.0.36,port=502] Socket connection closed, DriverState was Connected.
 	
java.io.IOException: End of stream reached.
at com.inductiveautomation.iosession.socket.AsyncSocketIOSession.run(AsyncSocketIOSession.java:74)
at java.lang.Thread.run(Unknown Source)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 3, 2021, 7:12pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/2 "2021-06-03T19:12:05Z")

</div>

It’s the device closing the TCP connection for some reason.

If you have successful comms using a Modbus test program then capturing those comms with Wireshark is the easiest way to figure out what’s different with your Ignition setup.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 3, 2021, 7:56pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/3 "2021-06-03T19:56:17Z")

</div>

I have never used wireshark and am not even sure what I’m looking at.

Any tips?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 3, 2021, 8:07pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/4 "2021-06-03T20:07:08Z")

</div>

You would run the capture on the Ignition server and optionally filter for the IP address of the Modbus device. Ensure it’s capturing/recording on the right network interface before then communicating with the test program.

You can upload the resulting capture here for us to look at.

You could also call support. Troubleshooting Modbus addressing is a fairly common thing for them and they can walk you through using Wireshark.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 7, 2021, 4:22pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/5 "2021-06-07T16:22:39Z")

</div>

IT is going to run it and send me the results. But from a troubleshooting program and read and write to the device even though it does time out on me. But Ignition just does not want to see it.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 8, 2021, 7:28pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/6 "2021-06-08T19:28:42Z")

</div>

Here are my capture results.

 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e8c9432647d861ef604f1639cb0e2cca3133141.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2021, 8:01pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/7 "2021-06-08T20:01:31Z")

</div>

Please upload the capture file somewhere that it can be downloaded.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 8, 2021, 8:04pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/8 "2021-06-08T20:04:16Z")

</div>

weird enough today when we ran the capture i was not getting the error in the console i was the other day. never the less here is the capture [https://we.tl/t-m5xYnmK65V](https://we.tl/t-m5xYnmK65V)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2021, 8:23pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/9 "2021-06-08T20:23:24Z")

</div>

So, assuming default settings, try making an Ignition tag with an address (OPC Item Path) like this: `[DeviceName]255.C3139`

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 8, 2021, 9:52pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/10 "2021-06-08T21:52:30Z")

</div>

i tired and still get unkown for quality.

but i found this in wireshark  
 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2f21801e4abac5d6df2c22a3441c2b8bec4feb1.png)  
it lookes like it might be reading one off. I tried doing 3140 instead 3139 but still no luck

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2021, 10:50pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/11 "2021-06-08T22:50:42Z")

</div>

Our driver is one-based by default, so you would `C3139` will show up as 3138 at the protocol level and in the capture.

Get a Wireshark of the traffic between Ignition and the device with just that one tag enabled and compare the two.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 9, 2021, 2:27pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/12 "2021-06-09T14:27:14Z")

</div>

How would I go about that, since i can’t disable my other tags.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 9, 2021, 2:36pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/13 "2021-06-09T14:36:48Z")

</div>

Separate device connection or just skip that part and get the Wireshark since it might be related if your other tags are also Coils.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [June 19, 2021, 12:46pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/14 "2021-06-19T12:46:38Z")

</div>

I only have that one bit I am trying for that device.

---

<div class="post-metadata">

**Author:** ![Jayden](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Jayden](https://forum.inductiveautomation.com/u/Jayden)\
**Post date:** [May 8, 2022, 11:24pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/15 "2022-05-08T23:24:40Z")

</div>

I’m wondering if there was a solution to this?

I’m have what seems to be a very similar problem.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [May 9, 2022, 2:40pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/16 "2022-05-09T14:40:13Z")

</div>

Unfortunately not, I didn’t have time to dig into it with support. I just ended up using a ethernet IP device instead I knew I could connect.

---

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [March 4, 2025, 12:44pm UTC](https://forum.inductiveautomation.com/t/java-io-ioexception-end-of-stream-reached/47424/17 "2025-03-04T12:44:16Z")

</div>

I'm a bit late to the party, but I had the same problem recently.  
I'm using Weidmüller UR20 remote I/Os connected directly to Ignition via Modbus TCP.  
In my case, the problem was caused by a too-low Modbus connection timeout set on the Weidmüller side. I simply increased the value from 1 second (default) to 2 seconds, and the problem disappeared.  
Hopefully, this information helps someone.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/5/55cfc5547de233f254bb333b4eede44e5e879416.png)
