Hey, I’m having some trouble trying to make it work, do you know what I’m doing wrong?
- I followed all instructions and it looks like all dependencies are installed (I’m doing this on arch linux).
- I placed file “influxdb.yaml” into my working directory, file contents:
host: a0d7b954-influxdb
port: 8086
database: homeassistant
username: homeassistant
password: my_password_here
max_retries: 3
default_measurement: state
- I coppied my database into working directory (home-assistant_v2.db) and executed:
python homeassistant2influxdb.py -t sqlite -d home-assistant_v2.db
- I’m getting following error
Traceback (most recent call last):
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.9/http/client.py", line 950, in send
self.connect()
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fe73b1821c0>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe73b1821c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "home-assistant-core/homeassistant/components/influxdb/__init__.py", line 432, in write_v1
influx.write_points(json, time_precision=precision)
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/influxdb/client.py", line 603, in write_points
return self._write_points(points=points,
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/influxdb/client.py", line 681, in _write_points
self.write(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/influxdb/client.py", line 413, in write
self.request(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/influxdb/client.py", line 332, in request
response = self._session.request(
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/tmp/influx/homeassistant2influxdb/.venv/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe73b1821c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/tmp/influx/homeassistant2influxdb/homeassistant2influxdb.py", line 195, in <module>
main()
File "/tmp/influx/homeassistant2influxdb/homeassistant2influxdb.py", line 97, in main
influx = get_influx_connection(influx_config, test_write=True, test_read=True)
File "home-assistant-core/homeassistant/components/influxdb/__init__.py", line 465, in get_influx_connection
write_v1([])
File "home-assistant-core/homeassistant/components/influxdb/__init__.py", line 438, in write_v1
raise ConnectionError(CONNECTION_ERROR % exc) from exc
ConnectionError: Cannot connect to InfluxDB due to 'HTTPConnectionPool(host='a0d7b954-influxdb', port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe73b1821c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.
Any help would be greatly appreciated