Im getting these errors quite alot since upgrading to OH3.
it seems to stay away for a while when restarting the influxdb persistence in console.
Before null it gives these errors:
[internal.handler.ScriptActionHandler] - Script execution of rule with UID 'energie-8' failed: java.net.ProtocolException: Unexpected status line: 4.4 in energie
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: Type: text/plain; charset=utf-8
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: TP/1.1
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: 21HTTP/1.1 400 Bad Request
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: :8086
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: 21HTTP/1.1 400 Bad Request
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: **********
Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ProtocolException: Unexpected status line: hab_db&rp=autogen&precision=n&consistency=one HTTP/1.1
it is hard to track this, debug isn’t very helpful, and it spams the logs in such short time, that all my log files are filled with the same error.
it looks to my as it cannot login in my influxdb or something?
Today was checking a completely different thing and found out that my OH 2.5.10 also keeps crying:
22:12:42.301 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost
retrofit.RetrofitError: Connection refused (Connection refused)
at retrofit.RetrofitError.networkError(RetrofitError.java:27) ~[retrofit-1.9.0.jar:?]
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:395) ~[retrofit-1.9.0.jar:?]
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240) ~[retrofit-1.9.0.jar:?]
at org.influxdb.impl.$Proxy182.writePoints(Unknown Source) ~[?:?]
at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:151) ~[influxdb-java-2.2.jar:?]
at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:171) [influxdb-java-2.2.jar:?]
at org.influxdb.impl.BatchProcessor.put(BatchProcessor.java:188) [influxdb-java-2.2.jar:?]
at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:137) [influxdb-java-2.2.jar:?]
at org.openhab.persistence.influxdb.internal.InfluxDBPersistenceService.store(InfluxDBPersistenceService.java:254) [bundleFile:?]
at org.openhab.core.persistence.internal.PersistenceServiceDelegate.store(PersistenceServiceDelegate.java:59) [bundleFile:?]
at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.handleStateEvent(PersistenceManagerImpl.java:137) [bundleFile:?]
at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.stateChanged(PersistenceManagerImpl.java:437) [bundleFile:?]
at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:261) [bundleFile:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_222]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_222]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_222]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_222]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_222]
at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_222]
at com.squareup.okhttp.internal.Platform.connectSocket(Platform.java:100) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.internal.http.SocketConnector.connectRawSocket(SocketConnector.java:160) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.internal.http.SocketConnector.connectCleartext(SocketConnector.java:67) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Connection.connect(Connection.java:152) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:185) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Call.getResponse(Call.java:273) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201) ~[okhttp-2.4.0.jar:?]
at com.squareup.okhttp.Call.execute(Call.java:81) ~[okhttp-2.4.0.jar:?]
at retrofit.client.OkClient.execute(OkClient.java:53) ~[retrofit-1.9.0.jar:?]
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326) ~[retrofit-1.9.0.jar:?]
… 14 more
Why http? What is it trying to send and where ? I did not set up any cloud connectivity.
Hi! Indeed, i was able to figure out myself that the influx server was not running. Attempt to start it caused some unexplained errors with some dump in /var/log/faillog.
I know that yesterday i shut down my system for some HW maintenance and did not do it the proper way, just killed the power. The EXT4 hard drive with the database got corrupted. I fixed the problem using fsck.
By the way, any advice how to prevent such breakage in future ?
Not sure on the corruption side (I have the odd power trip but not seen that)
I use my grafana to alert me when values are missing in my graphs, which usually is due to me taking something off line (or my wife unplugging the zwave sensor in our bedroom)
Similar issue for me this morning (OH 3.0.1). For every item change which leads to an influx entry I got the following exception in the log:
2021-04-14 08:02:00.451 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent.
Data will be lost
java.lang.NullPointerException: null
at okio.Segment.push(Segment.java:111) ~[bundleFile:?]
at okio.Buffer.writableSegment(Buffer.java:1307) ~[bundleFile:?]
at okio.Buffer.writeUtf8(Buffer.java:980) ~[bundleFile:?]
at okio.Buffer.writeUtf8(Buffer.java:961) ~[bundleFile:?]
at okio.RealBufferedSink.writeUtf8(RealBufferedSink.java:53) ~[bundleFile:?]
at okhttp3.internal.http1.Http1ExchangeCodec.writeRequest(Http1ExchangeCodec.java:196) ~[bundleFile:?]
at okhttp3.internal.http1.Http1ExchangeCodec.writeRequestHeaders(Http1ExchangeCodec.java:141) ~[bundleFile:?]
at okhttp3.internal.connection.Exchange.writeRequestHeaders(Exchange.java:72) ~[bundleFile:?]
Restarting the influx bundle helped but rather than putting that in a rule I would like to know the root cause. Any idea?
how do you restart the binding? i tried using your items/things/rules but it does not work. Seems like when this error happens the trigger chokes up as well.
I also tried adding the command as a syste cron (using crontab) and restart the bundle every 2 hours, does not have an effect.
Only if apply it manually on CLI it takes effect (/usr/bin/sshpass -p habopen ssh -p 8101 openhab@localhost 'bundle:restart org.openhab.persistence.influxdb')
Running that in cron I would add the related path to the ssh command.
stdout and stderr output is normally sent via mail resp. stored in /var/mail of the user’s account that runs the related cronjob. Is there any error message ? You also may check system log messages.