dial tcp [::1]:8086: connect: connection refused ... sometimes

Hi everyone,

I am new to influxdb and new to this community.
While pushing data to influxdb from the influxdb out node in node-red I sometimes get the error message “dial tcp [::1]:8086: connect: connection refused”.

When refreshing a Grafana dashboard I sometimes get the error “no data”.

influxdb, node-red and Grafana are all executing in the same Raspberry Pi 4 computer.

Trying to isolate the problem, I began manually running queries repeatedly from the inluxdb CLI, most of the times the query runs fine:

select * from “nivelH2o”
name: nivelH2o
time loc nivel_pct nivel_sensor


1632856809973 cisterna 43.19157672813099 3.1938595691434024
1632856829073 cisterna 18.938666672846804 8.715084643526811
1632856829807 cisterna 82.31688393331589 3.3109196817268605
1632856830402 cisterna 33.84850455703954 8.453631839087993
1632856831166 cisterna 66.96669548503591 4.332892746369956
1632856831986 cisterna 62.17128665693119 6.99014719316458
1632856832718 cisterna 86.14980588764973 7.562720683657669
1632856833406 cisterna 92.27048683118184 2.5042919677075903
1632856833986 cisterna 77.91465328894208 9.903400324637403
1632856834635 cisterna 76.35799966183623 2.5247353051019195
1632856835251 cisterna 78.47557824501405 6.635779339042069
1632857080169 cisterna 71.21246528681414 4.666406310115185
1632857108872 cisterna 60.17092746839825 0.6445083826786391
1632857110229 cisterna 61.384538979413314 3.7436960154569054
1632857112525 cisterna 39.65964190953821 4.714468794354798
1632857115661 cisterna 26.574103015043526 4.5839004611283745

but sometimes I get the following :

select * from “nivelH2o”
ERR: Post http://localhost:8086/query?chunked=true&db=speedTest&epoch=ns&q=select+*+from+“nivelH2o”: dial tcp [::1]:8086: connect: connection refused

I am sorry I can’t be more specific than “sometimes”, but it is not always the same. Usually it takes no more than 10 attempts and I don’t find a relation to the time between attempts.

Seems that the TCP port is open by influxdb but sometimes the client times out.

My current setup is:

HARDWARE
Raspberry Pi 4 4GB
No SD card
SSD connected to USB 3.0 port

Operating System
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

influxDB Installation procedure
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo “deb InfluxData - Package Repository buster stable” | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update
sudo apt install influxdb
sudo systemctl unmask influxdb
sudo systemctl enable influxdb

influxDB version
InfluxDB v1.8.9 (git: 1.8 d9b56321d579)

Influxdb.conf
Can be found here:
https://1drv.ms/u/s!Alan3GubZEq3zZJe0cB60dlaiTECTw?e=8ZN4f5

Many thanks!

Hi there,
Welcome to the Influx community :slight_smile: . When you check the system logs for InfluxDB do they provide any further insight on what might be happening? Are you running InfluxDB behind any proxy servers like NGINX.
Look forward to hearing back from you.

Hi Jay,

Thanks a lot for your reply!

I´m not running InfluxDB behind any proxy server.
Listing the system log with sudo journalctl -u influxdb.service I found several occurrences of entries like:

Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: Failed to reach influxdb http endpoint at http://localhost:8086/health
Oct 01 09:52:27 raspberrypi-3 systemd[1]: influxdb.service: Control process exited, code=exited, status=1/FAILURE
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.085155Z lvl=info msg=“Signal received, initializing clean shutdown…” log_id=0Ww5JMgG000
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.085277Z lvl=info msg=“Waiting for clean shutdown…” log_id=0Ww5JMgG000
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: [tcp] 2021/10/01 09:52:27 tcp.Mux: Listener at 127.0.0.1:8088 failed failed to accept a connection, closing all listeners - accept tcp 127.0.0.1:8088: use of closed network connection
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.085660Z lvl=info msg=“Shutting down monitor service” log_id=0Ww5JMgG000 service=monitor
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.085784Z lvl=info msg=“Listener closed” log_id=0Ww5JMgG000 service=snapshot
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.085903Z lvl=info msg=“Terminating storage of statistics” log_id=0Ww5JMgG000 service=monitor
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.086007Z lvl=info msg=“Terminating precreation service” log_id=0Ww5JMgG000 service=shard-precreation
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.086128Z lvl=info msg=“Terminating continuous query service” log_id=0Ww5JMgG000 service=continuous_querier
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.086443Z lvl=info msg=“Closing retention policy enforcement service” log_id=0Ww5JMgG000 service=retention
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.089673Z lvl=info msg=“Closed service” log_id=0Ww5JMgG000 service=subscriber
Oct 01 09:52:27 raspberrypi-3 influxd-systemd-start.sh[21725]: ts=2021-10-01T14:52:27.089794Z lvl=info msg=“Server shutdown completed” log_id=0Ww5JMgG000
Oct 01 09:52:27 raspberrypi-3 systemd[1]: influxdb.service: Failed with result ‘exit-code’.
Oct 01 09:52:27 raspberrypi-3 systemd[1]: Failed to start InfluxDB is an open-source, distributed, time series database.
Oct 01 09:52:27 raspberrypi-3 systemd[1]: influxdb.service: Service RestartSec=100ms expired, scheduling restart.
Oct 01 09:52:27 raspberrypi-3 systemd[1]: influxdb.service: Scheduled restart job, restart counter is at 272.
Oct 01 09:52:27 raspberrypi-3 systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Oct 01 09:52:27 raspberrypi-3 systemd[1]: Starting InfluxDB is an open-source, distributed, time series database…

Maybe the problem I’m having can be related to that?

The contents of the logfile can be found here:

Many thanks!

I found this:

I bumped the sleep time to 5 as suggested, and the problem shows up a lot less frequently. Maybe bumping the sleep time further up makes the problem “disappear”; I don’t think this is a proper solution, maybe just a temporary workaround.

Please let me have your thoughts.

Cheers!

I also found this

which seems related.

Anybody else having this problems?
Thanks for your help!

With version InfluxDB v1.8.10 (git: 1.8 688e697c51fd) released today, the problem seems to be solved; I haven’t had any issues so far