home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.71k stars 30.83k forks source link

Error setting up entry Home Assistant Cloud for netatmo since 2022.3 #67560

Closed atchoum31 closed 2 years ago

atchoum31 commented 2 years ago

The problem

Since the 2022.3 update, the Netatmo integration didn't work. After a delete/reinstall here is the issue. I have one camera and several temperature sensors.

For information the IP address 169.254.214.58 doesn't mean anything, my local IP range is 192.168.x.x

What version of Home Assistant Core has the issue?

core-2022.3.0

What was the last working version of Home Assistant Core?

core-2022.2.9

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Netatmo

Link to integration documentation on our website

https://www.home-assistant.io/integrations/netatmo/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/netatmo/data_handler.py:166 
First occurred: 17:35:38 (2 occurrences) 
Last logged: 19:19:07

Error setting up entry Home Assistant Cloud for netatmo
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('169.254.214.58', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 144, in async_setup_entry
    await data_handler.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls
    await self.async_update_camera_urls(camera_id)
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls
    ] = await self._async_check_url(
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url
    resp = await self.auth.async_post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.214.58:80 ssl:default [Connect call failed ('169.254.214.58', 80)]

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

netatmo documentation netatmo source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @cgtobi, mind taking a look at this issue as it has been labeled with an integration (netatmo) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

cgtobi commented 2 years ago

The statement "the Netatmo integration doesn't work" is a bit broad. Please provide detailed information about what exactly doesn't work.

atchoum31 commented 2 years ago

No data are available on any sensors and the integration says "configuration failure. check the log". I pasted the log in the original ticket.

paki81 commented 2 years ago

Same issue here

Friedrieck commented 2 years ago

Same here! It is the entire integration failing (climate, weather, cameras). I also note there is no 'reload' option in the integration box menu. There is no option to download the diagnostics either. I had issues of this kind in the past, but it was limited to the Presence cameras. If it is the same cause, then now it affects the entire integration setup. Log:

Logger: homeassistant.config_entries
Source: components/netatmo/data_handler.py:166
First occurred: 17:58:12 (1 occurrences)
Last logged: 17:58:12

Error setting up entry Configuration.yaml for netatmo
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('169.xxx.xxx.xxx', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 144, in async_setup_entry
    await data_handler.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls
    await self.async_update_camera_urls(camera_id)
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls
    ] = await self._async_check_url(
  File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url
    resp = await self.auth.async_post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.xxx.xxx.xxx:80 ssl:default [Connect call failed ('169.xxx.xxx.xxx', 80)]
axel2906 commented 2 years ago

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work.

Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now

(netatmo with configuration.yaml)

atchoum31 commented 2 years ago

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work.

Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now

(netatmo with configuration.yaml)

Agree, the previous version of HA works but this bug appears with the 2022.3

axel2906 commented 2 years ago

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work. Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now (netatmo with configuration.yaml)

Agree, the previous version of HA works but this bug appears with the 2022.3

try to restore to the previous version and dlete the netatmo integration (if you use the configuration.yaml delete the netatmo line too)

upgrade to the new version and install again the integration solved the issue for me

paki81 commented 2 years ago

Doesn't worked for me.

Friedi1970 commented 2 years ago

Same here. Since I updated to 2022.3.1 from the latest 2022.2 the Netatmo integration doesn‘t work at all.

`Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:166 First occurred: 14:59:10 (1 occurrences) Last logged: 14:59:10

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 101] Connect call failed ('169.254.72.2', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 144, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup await asyncio.gather( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.72.2:80 ssl:default [Connect call failed ('169.254.72.2', 80)]

`

Friedi1970 commented 2 years ago

Backed up to 2022.2.9 and everything is working fine. @cgtobi please fix 🙏

Flixi1403 commented 2 years ago

+1 same problem

cgtobi commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

axel2906 commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Not for me. I'm using the integration via thé configuration.yaml

Friedi1970 commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

To be honest, I didn‘t know there is another way … Btw. I wrote everything is working fine after roll bach. Not really true: both of the cams are not available :(

axel2906 commented 2 years ago

You can try with this method. With the update version of HA it's work for me

https://www.home-assistant.io/integrations/netatmo/#development--testing-with-your-own-client-id

Flixi1403 commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Yep, introduced with 2022.3

katla50 commented 2 years ago

I'm using the integration via thé configuration.yaml and it dosn't work anymore. But it works with Homekit controller

paki81 commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

HA Cloud Link option

atchoum31 commented 2 years ago

Just to make sure, everyone of you that is having this issue is using the HA Cloud Link option for the Netatmo integration?

Same issue either for configuration.yaml or HA Cloud integration options.

Ottmar0815 commented 2 years ago

Same after Update to 2022.3. Cloud Integration.

Friedrieck commented 2 years ago

It is the entire integration failing (climate, weather, cameras).

Strangely enough, after a new reboot, no more errors in the log and the integration just set up fine (on 2022.3.1).

Ottmar0815 commented 2 years ago

Nothing is working:

Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:166 First occurred: 19:26:42 (1 occurrences) Last logged: 19:26:42

Error setting up entry Home Assistant Cloud for netatmo Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('169.254.79.219', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 144, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup await asyncio.gather( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.79.219:80 ssl:default [Connect call failed ('169.254.79.219', 80)]

Alomon31 commented 2 years ago

You can try with this method. With the update version of HA it's work for me

https://www.home-assistant.io/integrations/netatmo/#development--testing-with-your-own-client-id

Already using this method, but same problem as everyone above here.

cgtobi commented 2 years ago

To be honest, I have no idea where that IPs (e.g. 169.254.79.219) are coming from. Maybe some DNS issue. Can you please run nslookup api.netatmo.com from both the machine you're using as well as the host system that HA is running on and report what that resolves to.

atchoum31 commented 2 years ago

From my machine :

nslookup api.netatmo.com
Server:     192.168.86.176
Address:    192.168.86.176#53

Non-authoritative answer:
api.netatmo.com canonical name = front-azure.netatmo.net.
Name:   front-azure.netatmo.net
Address: 51.145.143.28

From HA:

nslookup api.netatmo.com
Server:     192.168.86.1
Address:    192.168.86.1#53

Non-authoritative answer:
api.netatmo.com canonical name = front-azure.netatmo.net.
Name:   front-azure.netatmo.net
Address: 51.145.143.28

For your information, all my DNS requests go to a AdGuard Home DNS which transfers the request to quad9 DNS

cgtobi commented 2 years ago

Those IPs look perfectly correct.

Did you try to downgrade to 2022.2 already to see if the issue is related to 2022.3 exactly?

atchoum31 commented 2 years ago

No downgrade but when I tested the dev release (actually the 2022.3 version) I had the issue and when I go back to the stable (the 2022.2 at that moment) the issue was gone.

cgtobi commented 2 years ago

Please upgrade to 2022.3.3 and let me know if the issue persists. For now I can't replicate the issue and don't see where it might originate.

paki81 commented 2 years ago

Please upgrade to 2022.3.3 and let me know if the issue persists. For now I can't replicate the issue and don't see where it might originate.

Now is working again. Thank you.

atchoum31 commented 2 years ago

Please upgrade to 2022.3.3 and let me know if the issue persists. For now I can't replicate the issue and don't see where it might originate.

Still the error for me

bdraco commented 2 years ago

169.254 is link local address. It seems something is providing the wrong url

Ottmar0815 commented 2 years ago

On 2022.3.3 it's the same.

Alomon31 commented 2 years ago

Same for me and if i restore the backup made before the upgrade Netatmo still doesn't work.

Edit: i rostore to the previous version and deleted netatmon integration. Instaal the new version and then install again the netatmo integration and everythings works now

(netatmo with configuration.yaml)

How did you delete the integration? Only in the "Devices and services" menu, or in configuration.yaml as well? And did you delete or deactivate it? I'm having hard time trying to reproduce your solution.

Regards

axel2906 commented 2 years ago

I delete (not disable) the netatmo cloud integration in device and services and the lines in configuration.yaml AFTER restoring HA to te previous version (the version where netatmo works Well) I reboot and i upgrade to the last version of HA and then I install integration again

Alomon31 commented 2 years ago

I delete (not disable) the netatmo cloud integration in device and services and the lines in configuration.yaml AFTER restoring HA to te previous version (the version where netatmo works Well) I reboot and i upgrade to the last version of HA and then I install integration again

As soon as I delete the Netatmo integration, I cannot restart anymore because I get the error below when clicking Restart. Any idea?

Logger: homeassistant.components.websocket_api.http.connection Source: components/hassio/init.py:609 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 15:17:38 (1 occurrences) Last logged: 15:17:38

[1761860024] The system cannot restart because the configuration is not valid: Unexpected error calling config validator: 'NoneType' object has no attribute 'model' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 190, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/components/hassio/init.py", line 609, in async_handle_core_service raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Unexpected error calling config validator: 'NoneType' object has no attribute 'model'

katla50 commented 2 years ago

I delete (not disable) the netatmo cloud integration in device and services and the lines in configuration.yaml AFTER restoring HA to te previous version (the version where netatmo works Well) I reboot and i upgrade to the last version of HA and then I install integration again

As soon as I delete the Netatmo integration, I cannot restart anymore because I get the error below when clicking Restart. Any idea?

Logger: homeassistant.components.websocket_api.http.connection Source: components/hassio/init.py:609 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 15:17:38 (1 occurrences) Last logged: 15:17:38

[1761860024] The system cannot restart because the configuration is not valid: Unexpected error calling config validator: 'NoneType' object has no attribute 'model' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 190, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/components/hassio/init.py", line 609, in async_handle_core_service raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Unexpected error calling config validator: 'NoneType' object has no attribute 'model'

I got the same error and needed to install a backup

Alomon31 commented 2 years ago

I got the same error and needed to install a backup

Do you mean an even older backup? Because I get this error after installing a backup.

katla50 commented 2 years ago

I got the same error and needed to install a backup

Do you mean an even older backup? Because I get this error after installing a backup.

yes , an older backup

Alomon31 commented 2 years ago

Okay, just did it bit I still get the initial error after updating to 2022.3.3 then adding Netatmo integration via configuration.yaml.

Logger: homeassistant.config_entries Source: components/netatmo/data_handler.py:166 First occurred: 20:48:07 (1 occurrences) Last logged: 20:48:07

Error setting up entry Configuration.yaml for netatmo Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('169.254.134.109', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/netatmo/init.py", line 144, in async_setup_entry await data_handler.async_setup() File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 108, in async_setup await asyncio.gather( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 210, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 335, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.134.109:80 ssl:default [Connect call failed ('169.254.134.109', 80)]

djfanatix commented 2 years ago

I had the same issue, restarting HA didn't solve the problem. If you restart the host, then the Netatmo integrations starts correctly

cgtobi commented 2 years ago

This looks totally random. My gut feeling is that the Netatmo API is flaky, but I can't prove that.

Alomon31 commented 2 years ago

This looks totally random. My gut feeling is that the Netatmo API is flaky, but I can't prove that.

Still, the Netatmo integration seems to run well on HA core 2022.2.9 and 2022.2.8 (which are my backups versions).

I had the same issue, restarting HA didn't solve the problem. If you restart the host, then the Netatmo integrations starts correctly

Restarting the host didn't help.

Friedi1970 commented 2 years ago

This looks totally random. My gut feeling is that the Netatmo API is flaky, but I can't prove that.

If it'd be radomly why is it working (still) with core 2022.2.9? The trouble have been started with 2022.3.0.

cgtobi commented 2 years ago

It looks random to me because I know many users that don't have issues. And I can't reproduce this in any of my environments with dozens of devices.

djfanatix commented 2 years ago

If I restart my router (and obtain a new external IP address), the Netatmo integration works again. (without rebooting HA)

Friedi1970 commented 2 years ago

If I restart my router (and obtain a new external IP address), the Netatmo integration works again. (without rebooting HA)

Hmm. The thing is I actually get every 24 h a new IP, so why doesn't this work either?

katla50 commented 2 years ago

If I restart my router (and obtain a new external IP address), the Netatmo integration works again. (without rebooting HA)

Amazing... it worked :1st_place_medal:

cgtobi commented 2 years ago

So much about this being not random... ;-)