InfluxDB timeout from docker

I seem to have a strange problem with my Openhab running in docker. For some reason I get this error:

2025-10-02 13:13:26.850 [ERROR] [icrometer.influx.InfluxMeterRegistry] - unable to create database ‘openhab’

java.net.SocketTimeoutException: Connect timed out

< a lot of java output >

I can at least ping and run curl http://:8086/health the influxdb server from within the docker container with working result. Since I have tried a lot of stuff both from the serivices file and from the UI I am afraid the config is somewhat broken If I uninstall the Influxdb add-on and reinstall it, removing the userdata/cache directory and restarting the docker container , the old configuration pops up. It even tries to connect to the influxdb even though the add-on is not installed. This container has moved between two servers with rsync , also cpu arch has changed from Intel to ARM. But since this is all java, it should not be a problem I guess ?

So is there a way to purge all the influxdb add-on data?

Both the InfluxDB and OpenHAB docker containers run on the same host.

I have done some more debugging by setting up an InfluxDB on another node and I ran tcpdump there to check if it actually tries to connect. And it seems that it does not. This is my services file:

 # InfluxDB v2 configuration
version=V2
url=http://nod1.mean.net:8086
token=<working token>
organization=MYORG
db=MYORG
bucket=openhab

DNS is working so nod1.mean.net can be resolved. The openHAB log says the following when starting so one might think that it actually can talk to the database:

2025-11-05 09:24:36.222 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - Successfully connected to InfluxDB. Instance pingable=true

2025-11-05 09:24:36.232 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - database status is OK

2025-11-05 09:24:36.233 [INFO ] [.influxdb.InfluxDBPersistenceService] - InfluxDB persistence service started.

After that I only get these errors:

2025-11-05 09:57:45.097 [ERROR] [icrometer.influx.InfluxMeterRegistry] - unable to create database 'openhab'
java.net.SocketTimeoutException: Connect timed out
	at sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) ~[?:?]
	at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]
	at java.net.Socket.connect(Socket.java:751) ~[?:?]
	at sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:282) ~[?:?]
	at sun.net.www.http.HttpClient.New(HttpClient.java:386) ~[?:?]
	at sun.net.www.http.HttpClient.New(HttpClient.java:408) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1320) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1253) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1139) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1068) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1462) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1433) ~[?:?]
	at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98) ~[?:?]
	at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:306) ~[?:?]
	at io.micrometer.influx.InfluxMeterRegistry.createDatabaseIfNecessary(InfluxMeterRegistry.java:113) ~[?:?]
	at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:125) ~[?:?]
	at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafelyOrSkipIfInProgress(PushMeterRegistry.java:64) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.lang.Thread.run(Thread.java:1583) [?:?]
2025-11-05 09:57:46.117 [ERROR] [icrometer.influx.InfluxMeterRegistry] - failed to send metrics to influx
java.net.SocketTimeoutException: Connect timed out
	at sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) ~[?:?]
	at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?]
	at java.net.Socket.connect(Socket.java:751) ~[?:?]
	at sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:282) ~[?:?]
	at sun.net.www.http.HttpClient.New(HttpClient.java:386) ~[?:?]
	at sun.net.www.http.HttpClient.New(HttpClient.java:408) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1320) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1253) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1139) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1068) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1462) ~[?:?]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1433) ~[?:?]
	at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:98) ~[?:?]
	at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:306) ~[?:?]
	at io.micrometer.influx.InfluxMeterRegistry.publish(InfluxMeterRegistry.java:149) ~[?:?]
	at io.micrometer.core.instrument.push.PushMeterRegistry.publishSafelyOrSkipIfInProgress(PushMeterRegistry.java:64) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.lang.Thread.run(Thread.java:1583) [?:?]

Anyone having any pointers ? Or can I just skip this and make OpenHAB push all the values from my devices to a MQTT topic instead ?

It seems that the config file is not read properly.

Current config is this:

version=V2
url=http://influxdb2:8086
token=<token>
db=<myorg>
retentionPolicy=openhabba

The trace log says the following:

2025-12-18 10:26:48.224 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - Successfully connected to InfluxDB. Instance pingable=true
2025-12-18 10:26:48.226 [DEBUG] [rnal.influx2.InfluxDB2RepositoryImpl] - database status is OK
2025-12-18 10:26:48.228 [INFO ] [.influxdb.InfluxDBPersistenceService] - InfluxDB persistence service started.

Later in the log when it acutally tries to write to the database:

2025-12-18 12:48:38.120 [ERROR] [icrometer.influx.InfluxMeterRegistry] - unable to create database 'openhab'
java.net.SocketTimeoutException: Connect timed out
at sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) ~[?:?]

Why is it trying to create the openhab database, and to which host is it trying to connect ?

Should I open an issue on this , since this seems like an erronous behaviour?

At least the trace log should say to which hos it tries to connect.

All this is running in docker and name resolution seems to be working:

root@openhab:/openhab/conf/services# ping influxdb2

PING influxdb2 (172.18.0.4) 56(84) bytes of data.
64 bytes from influxdb2.services_default (172.18.0.4): icmp_seq=1 ttl=64 time=0.068 ms
64 bytes from influxdb2.services_default (172.18.0.4): icmp_seq=2 ttl=64 time=0.062 ms