After linux updates the connection to my influxdb is broken

Hi,

after some linux updates I received a week ago on openhabian on raspberry the connection to my influxdb is broken. The configuration worked since Januar 21 last year without issues so I assume I has nothing to do with my configuration that has been untouched since then.Todays update to openHAB 3.2.0.M2 did not fix it. Can anybody please give give advice? Thanks a lot in advance.

2021-09-06 17:32:22.080 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost

org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to /192.168.179.150:8086

	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:831) ~[bundleFile:?]

	at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]

	at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]

	at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]

	at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

Caused by: java.net.ConnectException: Failed to connect to /192.168.179.150:8086

	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265) ~[bundleFile:?]

	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88) ~[bundleFile:?]

	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169) ~[bundleFile:?]

	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at org.influxdb.impl.BasicAuthInterceptor.intercept(BasicAuthInterceptor.java:22) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:42) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:152) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[bundleFile:?]

	at okhttp3.RealCall.execute(RealCall.java:81) ~[bundleFile:?]

	at retrofit2.OkHttpCall.execute(OkHttpCall.java:188) ~[bundleFile:?]

	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:819) ~[bundleFile:?]

	... 10 more

Caused by: java.net.ConnectException: Verbindungsaufbau abgelehnt (Connection refused)

	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]

	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]

	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]

	at java.net.Socket.connect(Socket.java:609) ~[?:?]

	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130) ~[bundleFile:?]

	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263) ~[bundleFile:?]

	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108) ~[bundleFile:?]

	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88) ~[bundleFile:?]

	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169) ~[bundleFile:?]

	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at org.influxdb.impl.BasicAuthInterceptor.intercept(BasicAuthInterceptor.java:22) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:42) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:152) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[bundleFile:?]

	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[bundleFile:?]

	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[bundleFile:?]

	at okhttp3.RealCall.execute(RealCall.java:81) ~[bundleFile:?]

	at retrofit2.OkHttpCall.execute(OkHttpCall.java:188) ~[bundleFile:?]

	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:819) ~[bundleFile:?]

	... 10 more

==> /var/log/openhab/events.log <==


Have you updated openhabian itself, too ?
There recently were one or two issues with influxdb. If I remember right at least for one of them there is a workaround integrated into openhabian.

The error message that you show seems to say that influxdb is not running as the port is not served by the influxdb deamon.
Which influxdb version is installed ?
Can you check the journal by using sudo journalctl to see if there are hints about what is going wrong ?

Hi Wolfgang, Thanks for helping.

InfluxDB shell version: 1.8.9                                                                                                                                         

sudo journalctl

Sep 06 18:54:04 openHABianDevice telegraf[532]: 2021-09-06T16:54:04Z W! [outputs.influxdb] Metric buffer overflow; 19 metrics have been dropped
Sep 06 18:54:04 openHABianDevice telegraf[532]: 2021-09-06T16:54:04Z E! [outputs.influxdb] When writing to [http://127.0.0.1:8086]: failed doing req: Post "http://127
Sep 06 18:54:04 openHABianDevice telegraf[532]: 2021-09-06T16:54:04Z E! [agent] Error writing to outputs.influxdb: could not write any address                                           

Could you try to run

sudo apt-get install --reinstall influxdb

as suggested in this post and a later one in the same thread.

Thanks Wolfgang. Done, but unfortunately the same error as before. I have additionally uninstalled telegraf as I did not use it anyway. The service seems to be in a loop (crash restart) as the maximum time of the service running is just a few seconds:

https://www.reddit.com/r/influxdb/comments/ovulei/cant_start_influxdb_after_last_update/ - this post seems to be the issue. I remember there was an update a last week for influxdb. Nevertheless reinstall and

sudo chown -R openhab:openhab /usr/bin/influxdb

doesn’t fix it.

pi@openHABianDevice:~ $ sudo systemctl status influxdb.service                                                                                                        
● influxdb.service - InfluxDB is an open-source, distributed, time series database                                                                                    
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)                                                                             
   Active: activating (start) since Tue 2021-09-07 09:40:22 CEST; 227ms ago                                                                                           
     Docs: https://docs.influxdata.com/influxdb/                                                                                                                      
Cntrl PID: 25291 (influxd-systemd)                                                                                                                                    
    Tasks: 11 (limit: 4225)                                                                                                                                           
   CGroup: /system.slice/influxdb.service                                                                                                                             
           ├─25291 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh                                                                                    
           ├─25292 /usr/bin/influxd -config /etc/influxdb/influxdb.conf                                                                                               
           └─25322 sleep 1                                                                                                                                            
                                                                                                                                                                      
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.263820Z lvl=info msg="InfluxDB starting" log_id=0WRo3BTl000 version=1.8.9 bra
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.263903Z lvl=info msg="Go runtime" log_id=0WRo3BTl000 version=go1.13.8 maxproc
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: Merging with configuration at: /etc/influxdb/influxdb.conf                                          
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.365704Z lvl=info msg="Using data dir" log_id=0WRo3BTl000 service=store path=/
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.365832Z lvl=info msg="Compaction settings" log_id=0WRo3BTl000 service=store m
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.365895Z lvl=info msg="Open store (start)" log_id=0WRo3BTl000 service=store tr
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.380663Z lvl=info msg="Opened file" log_id=0WRo3BTl000 engine=tsm1 service=fil
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.381078Z lvl=info msg="Opened file" log_id=0WRo3BTl000 engine=tsm1 service=fil
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.388761Z lvl=info msg="Opened file" log_id=0WRo3BTl000 engine=tsm1 service=fil
Sep 07 09:40:22 openHABianDevice influxd-systemd-start.sh[25291]: ts=2021-09-07T07:40:22.388994Z lvl=info msg="

Not nice but you may try if this helps: https://github.com/influxdata/influxdb/issues/22297

1 Like

That fixed it for me - thanks so much :smiley:

1 Like