Fatal transport error: java.net.SocketTimeoutException: Read timed out

I am using the garadget binding of which appears to be working fine. However, i get the following multiple times a minute in my log:

Fatal transport error: java.net.SocketTimeoutException: Read timed out

From what I have read, it appears this may just indicate that there was nothing new to report? Is this expected behavior? I seem to be seeing it more since updating to the latest offline oh2 snapshot.

Thanks

I also see this occasionally under 1.8.3, but I haven’t investigated it yet. I will look into it in the next few days to see its cause.

Any luck?

The log message was misleading, so I’ve changed it and lowered it to DEBUG level. Try the next nightly build and please report back, thanks!

Still seeing it on openhab2-offline 2.0.0~20160925032940

2016-09-25 09:32:17.757 [WARN ] [binding.garadget.internal.Connection] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2016-09-25 09:32:29.235 [WARN ] [binding.garadget.internal.Connection] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2016-09-25 09:34:19.383 [WARN ] [binding.garadget.internal.Connection] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2016-09-25 09:36:32.995 [WARN ] [binding.garadget.internal.Connection] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2016-09-25 09:36:45.244 [WARN ] [binding.garadget.internal.Connection] - Fatal transport error: java.net.SocketTimeoutException: Read timed out

I am doubtful that the openHAB 2 nightly builds pick up the openHAB 1.x addons from the master branch – I was referring to this nightly build, where you would have to grab the JAR from the build artefacts and uninstall the existing in openHAB2, and then add the nightly build version to your addons folder.

I get the same error,
every time I try to send an http POST command to an IP camera:

2016-10-02 19:59:27.568 [ERROR] [g.openhab.io.net.http.HttpUtil] - Fatal transport error: java.net.SocketTimeoutException: Read timed out

The command works as expected, but with a huge (~3sec) delay.
The same command works with no errors and no delay from a curl cli command…
No ‘garadget’ binding installed.
I don’t really mind the logged error. But I do mind the delay of the http POST.
my http command is:

{http=">[*:POST:http://192.168.1.XX:XX/decoder_control.cgi?loginuse=something&loginpas=something&onestep=1&command=%2$s]"}

Best regards watou

There is no obvious reason why there would be a 3 second delay from when the item received the command, and when the HTTP POST is performed. It could be a network configuration issue, overburdened server, or your camera may not be sending an HTTP response properly, or even something else.

The ERROR log message from org.openhab.io.net.http.HttpUtil is sometimes unhelpful, as the far end of the socket might have already closed, producing an IOException that isn’t indicative of a problem. Under OH1 you could alter logback.xml to add a line:

<logger name="org.openhab.io.net.http.HttpUtil" level="OFF"/>

to silence all log messages from this class.

1 Like

I very appreciate your response watou.

My network configuration is definitely not the issue. (I can extendedly justify but there is no point).
executing

curl "http://blabla"

from the same machine as root or pi user works fine and instantly.

I wrote a bash file with that command, and then an exec binding to that bash, and worked fine and fast.

I also tried:

{exec="*:curl \"http://blabla\" "}

gives me a line in the log file that says: executed commandLine 'curl "http://blabla" '
but nothing actually happens!

and finally I tried

{exec="*:/bin/sh@@-c@@curl \"http://blabla\" "}

gives me a line in the log file that says: executed commandLine 'curl "http://blabla" '
but works like a charm…

I run OH-1.8.3 on a Raspberry Pi 2, so far I have about 80 items and 15 rules, most of which, work with MQTT and the rest with exec (bash files).
OH runs as root. I don’t remember when and why I did that.

anyway, to return to the topic,
when I send the same HTTP request, from the same host, with any other method, the camera instantly replies back

var result="ok";

and instantly reacts.

Though,
when I send the same HTTP POST request from OH, 3-4 seconds pass by, and then I get

Fatal transport error: java.net.SocketTimeoutException: Read timed out

and the response from the camera at the same time.

my question is,
is java expecting any particular response for the HTTP POST requests?

It may be that the binding is creating a new HTTP client for each POST and leaving open too many connections to the camera (at least this stackoverflow suggests that might be the issue). On Linux / MacOSX, you could run netstat -an at a prompt right at the time the exception is logged to see if there are many sockets open to the camera.

If that’s the issue, then the binding would have to refactored a bit to not invoke this line for every HTTP method, but instead reuse the HttpClient in some way.

Is this issue fixed or is there a workaround?
I get this which seems related:
…[ERROR] [org.openhab.io.net.http.HttpUtil ] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
…[ERROR] [ab.binding.http.internal.HttpBinding] - No response received from 'http://…

Hello,

I also get exact same behavior for:
{http=">[ON:POST:http://user:password@192.168.x.x/nightmodecontrol.cgi?IRled=1]"}
Command is executed with a 3 secs delay and I get the error in the log:
Fatal transport error: java.net.SocketTimeoutException: Read timed out
Any update on a fix for this?