Hi all,
yesterday my influxdb has stopped working after an update…
log errors (plenty) are:
2021-07-30 13:24:28.392 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1: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 localhost/0:0:0:0:0:0:0:1: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: Connection refused (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
journalctl -u influxdb shows:
Jul 30 12:14:27 openHABianDevice systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Jul 30 12:14:27 openHABianDevice systemd[596]: influxdb.service: Failed to execute command: Permission denied
Jul 30 12:14:27 openHABianDevice systemd[596]: influxdb.service: Failed at step EXEC spawning /usr/lib/influxdb/scripts/Jul 30 12:14:27 openHABianDevice systemd[1]: influxdb.service: Control process exited, code=exited, status=203/EXEC
Jul 30 12:14:27 openHABianDevice systemd[1]: influxdb.service: Failed with result 'exit-code'.
Jul 30 12:14:27 openHABianDevice systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series databaJul 30 12:14:27 openHABianDevice systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Jul 30 12:14:27 openHABianDevice systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 1.
Jul 30 12:14:27 openHABianDevice systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
tried several times to restart, stop-start influx with systemctl which outputs:
Job for influxdb.service failed because the control process exited with error code.
See "systemctl status influxdb.service" and "journalctl -xe" for details.
i can however manually start the database with sudo influxd run -config /etc/influxdb/influxdb.conf…
Thank you for this! I’m having the same problem as well after the update, now the error messages related to InfluxDB are all gone after following this workaround.
Thx @samtd!
I‘ve tried it with the ‚fix permissions‘ -option via openhabian-config previously and that didn‘t work. Perhaps someone could add your fix to it
This is about openHABian not openHAB. The ‘stable’ openHABian branch is for OH2 only.
As I said with the latest openHABian version it would have worked. You didn’t even mention the versions and branches you use so we cannot know if that’s really the right and latest one.
2021-10-15 20:16:14.814 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:8086
at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:831) ~[bundleFile:?]
The suggested solution did not work for me.
Is there an option to export my already done work in OH3, because in openhabian_conf in the menu option 4 there seems to be a possibility to “Import an openHAB 3 configuration from file or URL”
I found the option to save the config and restore again → So may be better for me to start again
Then I would do a clean install.
Or any other suggestion how to fix this error now in a way that future updates keep working
Yes you are right. On my system with version 1.8.9 it worked putting the sleep parameter to 10.
I also upgraded to 1.8.10 on my testsystem without problem.
openhabian@hab3:~ $ influxd
8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"
2021-10-16T11:50:32.075358Z info InfluxDB starting {"log_id": "0XEEsNYl000", "version": "1.8.10", "branch": "1.8", "commit": "688e697c51fd"}
2021-10-16T11:50:32.075514Z info Go runtime {"log_id": "0XEEsNYl000", "version": "go1.13.8", "maxprocs": 4}
2021-10-16T11:50:32.179988Z info Using data dir {"log_id": "0XEEsNYl000", "service": "store", "path": "/var/lib/influxdb/data"}
2021-10-16T11:50:32.180666Z info Compaction settings {"log_id": "0XEEsNYl000", "service": "store", "max_concurrent_compactions": 2, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2021-10-16T11:50:32.181091Z info Open store (start) {"log_id": "0XEEsNYl000", "service": "store", "trace_id": "0XEEsNyG000", "op_name": "tsdb_open", "op_event": "start"}
2021-10-16T11:50:32.202230Z error Unable to open series file {"log_id": "0XEEsNYl000", "path": "/var/lib/influxdb/data/openhab/_series", "partition": 0, "error": "open /var/lib/influxdb/data/openhab/_series/00/0000: permission denied"}
2021-10-16T11:50:32.202458Z info Open store (end) {"log_id": "0XEEsNYl000", "service": "store", "trace_id": "0XEEsNyG000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "21.379ms"}
run: open server: open tsdb store: open /var/lib/influxdb/data/openhab/_series/00/0000: permission denied
openhabian@hab3:~ $
The result of
openhabian@hab3:~ $ sudo systemctl status influxdb
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-10-16 00:44:46 CEST; 20h ago
Docs: https://docs.influxdata.com/influxdb/
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
openhabian@hab3:~ $
I just started influx manually and I get following after entering also “journalctl -xe”
openhabian@hab3:~ $ systemctl start influxdb
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password:
==== AUTHENTICATION COMPLETE ===
Job for influxdb.service failed because the control process exited with error code.
See "systemctl status influxdb.service" and "journalctl -xe" for details.
openhabian@hab3:~ $ journalctl -xe
--
-- An ExecStart= process belonging to unit influxdb.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit influxdb.service has entered the 'failed' state with result 'exit-code'.
Oct 16 22:11:51 hab3 systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
-- Subject: A start job for unit influxdb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit influxdb.service has finished with a failure.
--
-- The job identifier is 6246 and the job result is failed.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Automatic restarting of the unit influxdb.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Oct 16 22:11:51 hab3 systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
-- Subject: A stop job for unit influxdb.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit influxdb.service has finished.
--
-- The job identifier is 6309 and the job result is done.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Start request repeated too quickly.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit influxdb.service has entered the 'failed' state with result 'exit-code'.
Oct 16 22:11:51 hab3 systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
-- Subject: A start job for unit influxdb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit influxdb.service has finished with a failure.
--
-- The job identifier is 6309 and the job result is failed.
openhabian@hab3:~ $
and th status is
openhabian@hab3:~ $ 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: failed (Result: exit-code) since Sat 2021-10-16 22:11:51 CEST; 3min 22s ago
Docs: https://docs.influxdata.com/influxdb/
Process: 29440 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh (code=exited, status=1/FAILURE)
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 5.
Oct 16 22:11:51 hab3 systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Start request repeated too quickly.
Oct 16 22:11:51 hab3 systemd[1]: influxdb.service: Failed with result 'exit-code'.
Oct 16 22:11:51 hab3 systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
openhabian@hab3:~ $