Home Assistant release (hass --version): 0.35.2
Python release (python3 --version): 3.4.2
Component/platform: TTS/iOS
Description of problem: When I run the tts component with iOS app, the iOS notify platform does not load. Here is the error log:
16-12-19 09:36:00 homeassistant.bootstrap: Error during setup of component zeroconf
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 46, in setup
socket.AF_INET, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 51, in setup
socket.AF_INET6, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
16-12-19 09:36:00 homeassistant.bootstrap: Not initializing ios because not all dependencies loaded: zeroconf
16-12-19 09:36:08 homeassistant.bootstrap: Error during setup of component zeroconf
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 46, in setup
socket.AF_INET, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 51, in setup
socket.AF_INET6, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
16-12-19 09:36:10 homeassistant.bootstrap: Component zeroconf failed to setup
16-12-19 09:36:10 homeassistant.bootstrap: Unable to prepare setup for platform notify.ios because dependency ios could not be initialized
Here's the relevant config:
http:
api_password: !secret http_password
ssl_certificate: !secret ssl_certificate
ssl_key: !secret ssl_key
base_url: !secret base_url
trusted_networks:
- 192.168.2.0/24
I tried both with and without https:// in the base_url, but both give the same error. If I run it without base_url, the iOS notify component loads, but the TTS component does not work.
Expected:
Don't add http in your base URL...
@pvizeli I tried both with and without http...same error.
In fact, right now I am using it without http. My secrets.yaml is:
base_url: REDACTED.duckdns.org
with 0.35.2 you need set:
base_url: bla.duckdns.org:8123
Even with
http:
api_password: !secret http_password
ssl_certificate: !secret ssl_certificate
ssl_key: !secret ssl_key
base_url: bla.duckdns.org:8123
trusted_networks:
- 192.168.2.0/24
I get the same errors:
16-12-19 11:43:46 homeassistant.bootstrap: Error during setup of component zeroconf
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 46, in setup
socket.AF_INET, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 51, in setup
socket.AF_INET6, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
16-12-19 11:43:46 homeassistant.bootstrap: Not initializing ios because not all dependencies loaded: zeroconf
16-12-19 11:44:01 homeassistant.bootstrap: Error during setup of component zeroconf
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 46, in setup
socket.AF_INET, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/zeroconf.py", line 51, in setup
socket.AF_INET6, hass.config.api.host),
OSError: illegal IP address string passed to inet_pton
16-12-19 11:44:01 homeassistant.bootstrap: Component zeroconf failed to setup
16-12-19 11:44:01 homeassistant.bootstrap: Unable to prepare setup for platform notify.ios because dependency ios could not be initialized
Look like a bug in zeroconf
But it only happens when I include base_url in the config. Without base_url, zeroconf does not complain.
I'm having the same issue
Same issue, looks like base_url breaks zeroconf which in turn breaks the iOS app notify platform. Since the latest iOS beta expires in 5 days it may be a moot point shortly.
Well....the beta will be renewed and I hope that the issue is fixed soon....at least the issue is reproducible :)
Looks like the issue is due to the zeroconf component expecting the base_url parameter to be just an IP address. Since we are now setting it to be a string that is _not_ a valid IP, the component is failing to parse it and throwing this exception at the socket.inet_pton() function call.
The fix should be as simple as using the auto-detected host IP address or potentially allow it to be configured like in the emulated_hue component (but I suppose that undercuts the whole idea of zeroconf...)
I've found this also occurs with the port. When base_url is set the parameter hass.config.api.port that zeroconf relies on is set to None. This prevents the zeroconf library from initializing the service. Once the IP address issue was fixed this was exposed, so it too will have to be pulled a different way.
I've got a workaround in place on my install, I've just got to clean it up and post a pull request. Interestingly, zeroconf _used_ to be setup like this (i.e. not rely on base_url in this way) but it was changed in https://github.com/home-assistant/home-assistant/commit/e1ffdcc5f12be623633e2abab2041fcb574173ea. However, since that seems to rely on removed parameters, the change makes sense.
Most helpful comment
Looks like the issue is due to the zeroconf component expecting the
base_urlparameter to be just an IP address. Since we are now setting it to be a string that is _not_ a valid IP, the component is failing to parse it and throwing this exception at thesocket.inet_pton()function call.The fix should be as simple as using the auto-detected host IP address or potentially allow it to be configured like in the
emulated_huecomponent (but I suppose that undercuts the whole idea of zeroconf...)I've found this also occurs with the port. When
base_urlis set the parameterhass.config.api.portthat zeroconf relies on is set toNone. This prevents the zeroconf library from initializing the service. Once the IP address issue was fixed this was exposed, so it too will have to be pulled a different way.I've got a workaround in place on my install, I've just got to clean it up and post a pull request. Interestingly, zeroconf _used_ to be setup like this (i.e. not rely on
base_urlin this way) but it was changed in https://github.com/home-assistant/home-assistant/commit/e1ffdcc5f12be623633e2abab2041fcb574173ea. However, since that seems to rely on removed parameters, the change makes sense.