maxbec / hassio-diyHue

Fully configurable diyHue add-on for home-assistant.
30 stars 17 forks source link

Can't connect to deconz on 127.0.0.1:8080 after version 1.4.1 #19

Closed sidequestboy closed 2 years ago

sidequestboy commented 3 years ago

I have deconz running on port 8080 as a hassio add-on, it was working with 1.4.0 but upgrading to 1.4.1 it can't connect:

[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
/config/diyhue exists.
Your Architecture is = armv7
Serve HTTPS
2021-04-25 15:47:29,368 - root - INFO - Using Host 172.30.33.2:80
Host MAC given as dca632b72ff3
2021-04-25 15:47:29,368 - root - INFO - dca632b72ff3
Docker Setup Initiated
SSL certificate found
Config file found
Docker Setup Complete
2021-04-25 15:47:29,369 - root - INFO - IP range for light discovery: 0-255
Deconz IP given as 127.0.0.1
2021-04-25 15:47:29,369 - root - INFO - 127.0.0.1
2021-04-25 15:47:29,370 - root - INFO - Online Discovery/Remote API Enabled!
2021-04-25 15:47:29,373 - root - INFO - Config loaded
2021-04-25 15:47:29,397 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1:8080
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 158, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 597, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 167, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xb5ee9190>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 637, in urlopen
    retries = retries.increment(method, url, error=e, _pool=self,
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /api/283145a4e198cc6535/config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5ee9190>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/hue-emulator/HueEmulator3.py", line 1998, in <module>
    scanDeconz()
  File "/opt/hue-emulator/HueEmulator3.py", line 1052, in scanDeconz
    deconz_config = json.loads(sendRequest("http://" + deconz_ip + ":" + str(bridge_config["deconz"]["port"]) + "/api/" + bridge_config["deconz"]["username"] + "/config", "GET", "{}"))
  File "/opt/hue-emulator/functions/request.py", line 19, in sendRequest
    response = requests.get(url, timeout=timeout, headers=head)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 524, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 637, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /api/283145a4e198cc6535/config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5ee9190>: Failed to establish a new connection: [Errno 111] Connection refused'))
2021-04-25 15:47:34,389 - root - INFO - delete rules / 4
[cmd] ./run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.

 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

is there a way to fix this?

foxy82 commented 3 years ago

Try using the ip address of your server i.e. 192.168.1.2

sidequestboy commented 2 years ago

Hi sorry for the late reply it took me until now to try and upgrade again - using the ip address of the server works! Why did the loopback address stop working?