Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydantic fails after update 2023.10.0b1 #101042

Closed
AlbertDijksma opened this issue Sep 28, 2023 · 19 comments · Fixed by #101044
Closed

pydantic fails after update 2023.10.0b1 #101042

AlbertDijksma opened this issue Sep 28, 2023 · 19 comments · Fixed by #101044

Comments

@AlbertDijksma
Copy link

The problem

Invalid config
The following integrations and platforms could not be set up:

radio_browser (Show logs)
zwave_js (Show logs)
unifiprotect (Show logs)
google (Show logs)
nest (Show logs)

What version of Home Assistant Core has the issue?

2023.10.0b1

What was the last working version of Home Assistant Core?

2023.10.0b0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@TheFes
Copy link
Contributor

TheFes commented Sep 28, 2023

Relevant log

  • Setup failed for radio_browser: Unable to import component: Exception importing homeassistant.components.radio_browser
  • Setup failed for rdw: Unable to import component: Exception importing homeassistant.components.rdw
  • Setup failed for google: Unable to import component: Exception importing homeassistant.components.google
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/radio_browser/__init__.py", line 5, in <module>
    from radios import RadioBrowser, RadioBrowserError
  File "/usr/local/lib/python3.11/site-packages/radios/__init__.py", line 8, in <module>
    from .models import Country, Language, Station, Stats, Tag
  File "/usr/local/lib/python3.11/site-packages/radios/models.py", line 12, in <module>
    class Stats(BaseModel):
  File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
TypeError: Argument 'bases' has incorrect type (expected list, got tuple)

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 826, in get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing homeassistant.components.radio_browser
  • Unexpected exception importing component homeassistant.components.radio_browser
  • Unexpected exception importing component homeassistant.components.rdw
  • Unexpected exception importing component homeassistant.components.google
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/radio_browser/__init__.py", line 5, in <module>
    from radios import RadioBrowser, RadioBrowserError
  File "/usr/local/lib/python3.11/site-packages/radios/__init__.py", line 8, in <module>
    from .models import Country, Language, Station, Stats, Tag
  File "/usr/local/lib/python3.11/site-packages/radios/models.py", line 12, in <module>
    class Stats(BaseModel):
  File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
TypeError: Argument 'bases' has incorrect type (expected list, got tuple)

@VinceRMP
Copy link

Seeing the exact same errors/logs for zwave_js and unifiprotect:

Setup failed for zwave_js: Unable to import component: Exception importing homeassistant.components.zwave_js
Setup failed for unifiprotect: Unable to import component: Exception importing homeassistant.components.unifiprotect

@Kippy74
Copy link

Kippy74 commented Sep 28, 2023

Samme issue here.

local_calendar.calendar (Show logs)
radio_browser (Show logs)
google (Show logs)
ourgroceries (Show logs)

@pdsccode
Copy link

Same for

  • XBox

@joostlek joostlek mentioned this issue Sep 28, 2023
20 tasks
@xpl01td
Copy link

xpl01td commented Sep 28, 2023

Same issue for me:

zwave_js (Show logs)
tplink (Show logs)
local_calendar.calendar (Show logs)
abode (Show logs)
radio_browser (Show logs)

@LukaszP2
Copy link

Same issue:

garmin_connect (Show logs)
traccar.device_tracker (Show logs)
google (Show logs)
xbox (Show logs)

@yahav-bot
Copy link

Same issue:

Invalid config
The following integrations and platforms could not be set up:
zwave_js (Show logs)
google (Show logs)
nest(Show logs)

@drjared88
Copy link
Contributor

Same issue:
The following integrations and platforms could not be set up:

tplink (Show logs)
zwave_js (Show logs)
google (Show logs)
nest (Show logs)

@bdraco bdraco changed the title Problems after update 2023.10.0b1 pydantic fails after update 2023.10.0b1 Sep 28, 2023
@konikvranik
Copy link
Contributor

The issue is also in the released version.

@frenck
Copy link
Member

frenck commented Oct 5, 2023

@konikvranik Sorry, it is not. This issue may bubble up again if a custom component bring it in. For example, we know that the custom integration for RoboRock does mess this up right now.

To make sure it is (or isn't) caused by custom integrations, please rename your "custom_components" folder and rebuild Home Assistant ("ha core rebuilt" on a terminal). If the issue persist after that, then your report is correct. In that case, please open a new issue.

../Frenck

@konikvranik
Copy link
Contributor

Hi @frenck , thank you for the hint, but I have no ha command. Just hass. But it doesn't support core rebuild.

Currently I have pydantic (1.10.12)

@frenck
Copy link
Member

frenck commented Oct 5, 2023

Sorry @konikvranik, that is not a common installation type, hence me not taking that into account in my replies usually. Nevertheless, this can still happen if you have cython 3 or newer installed, as Pydantic isn't compatible with that on building.

More information on that specific issue, can be found upstream here: pydantic/pydantic#7689

Please note, this is an issue with Pydantic and your system dependencies.

../Frenck

@konikvranik
Copy link
Contributor

So, how do we revert to the working state? Rollbacking to HA 2023.9.3 didn't help.

@konikvranik
Copy link
Contributor

Sorry @konikvranik, that is not a common installation type, hence me not taking that into account in my replies usually. Nevertheless, this can still happen if you have cython 3 or newer installed, as Pydantic isn't compatible with that on building.

More information on that specific issue, can be found upstream here: pydantic/pydantic#7689

Please note, this is an issue with Pydantic and your system dependencies.

../Frenck

I'm not aware of any cython installations. I have just HA core installed on RPi.

@konikvranik
Copy link
Contributor

I removed custom_components, dropped venv, removed caches, created new one venv and installed HA 2023.9.3 and the problem is still there:

Oct 05 16:26:08 hass.home hass[17066]:   File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
Oct 05 16:26:08 hass.home hass[17066]: TypeError: Argument 'bases' has incorrect type (expected list, got tuple)
Oct 05 16:26:08 hass.home hass[17066]: The above exception was the direct cause of the following exception:
Oct 05 16:26:08 hass.home hass[17066]: Traceback (most recent call last):
Oct 05 16:26:08 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/setup.py", line 215, in _async_setup_component
Oct 05 16:26:08 hass.home hass[17066]:     component = integration.get_component()
Oct 05 16:26:08 hass.home hass[17066]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:26:08 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 826, in get_component
Oct 05 16:26:08 hass.home hass[17066]:     raise ImportError(f"Exception importing {self.pkg_path}") from err
Oct 05 16:26:08 hass.home hass[17066]: ImportError: Exception importing custom_components.hacs
Oct 05 16:23:05 hass.home hass[17066]: 2023-10-05 16:23:05.776 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component homeassistant.components.rainbird
Oct 05 16:23:05 hass.home hass[17066]: Traceback (most recent call last):
Oct 05 16:23:05 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 818, in get_component
Oct 05 16:23:05 hass.home hass[17066]:     ComponentProtocol, importlib.import_module(self.pkg_path)
Oct 05 16:23:05 hass.home hass[17066]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:23:05 hass.home hass[17066]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
Oct 05 16:23:05 hass.home hass[17066]:     return _bootstrap._gcd_import(name[level:], package, level)
Oct 05 16:23:05 hass.home hass[17066]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
Oct 05 16:23:05 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Oct 05 16:23:05 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/rainbird/__init__.py", line 4, in <module>
Oct 05 16:23:05 hass.home hass[17066]:     from pyrainbird.async_client import AsyncRainbirdClient, AsyncRainbirdController
Oct 05 16:23:05 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/pyrainbird/async_client.py", line 26, in <module>
Oct 05 16:23:05 hass.home hass[17066]:     from .data import (
Oct 05 16:23:05 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/pyrainbird/data.py", line 196, in <module>
Oct 05 16:23:05 hass.home hass[17066]:     class WifiParams(BaseModel):
Oct 05 16:23:05 hass.home hass[17066]:   File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
Oct 05 16:23:05 hass.home hass[17066]: TypeError: Argument 'bases' has incorrect type (expected list, got tuple)
 16:28:35 hass.home hass[17066]: 2023-10-05 16:28:35.282 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.zwave_js.device_trigger
Oct 05 16:28:35 hass.home hass[17066]: Traceback (most recent call last):
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 838, in get_platform
Oct 05 16:28:35 hass.home hass[17066]:     cache[full_name] = self._import_platform(platform_name)
Oct 05 16:28:35 hass.home hass[17066]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 855, in _import_platform
Oct 05 16:28:35 hass.home hass[17066]:     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
Oct 05 16:28:35 hass.home hass[17066]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
Oct 05 16:28:35 hass.home hass[17066]:     return _bootstrap._gcd_import(name[level:], package, level)
Oct 05 16:28:35 hass.home hass[17066]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/__init__.py", line 10, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     from zwave_js_server.client import Client as ZwaveClient
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 23, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     from .event import Event
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/event.py", line 16, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     class BaseEventModel(BaseModel):
Oct 05 16:28:35 hass.home hass[17066]:   File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
Oct 05 16:28:35 hass.home hass[17066]: TypeError: Argument 'bases' has incorrect type (expected list, got tuple)
Oct 05 16:28:35 hass.home hass[17066]: 2023-10-05 16:28:35.259 ERROR (MainThread) [homeassistant.setup] Setup failed for zwave_js: Unable to import component: Exception importing homeassistant.components.zwave_js
Oct 05 16:28:35 hass.home hass[17066]: Traceback (most recent call last):
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 818, in get_component
Oct 05 16:28:35 hass.home hass[17066]:     ComponentProtocol, importlib.import_module(self.pkg_path)
Oct 05 16:28:35 hass.home hass[17066]:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
Oct 05 16:28:35 hass.home hass[17066]:     return _bootstrap._gcd_import(name[level:], package, level)
Oct 05 16:28:35 hass.home hass[17066]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
Oct 05 16:28:35 hass.home hass[17066]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/zwave_js/__init__.py", line 10, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     from zwave_js_server.client import Client as ZwaveClient
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/client.py", line 23, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     from .event import Event
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/zwave_js_server/event.py", line 16, in <module>
Oct 05 16:28:35 hass.home hass[17066]:     class BaseEventModel(BaseModel):
Oct 05 16:28:35 hass.home hass[17066]:   File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
Oct 05 16:28:35 hass.home hass[17066]: TypeError: Argument 'bases' has incorrect type (expected list, got tuple)
Oct 05 16:28:35 hass.home hass[17066]: The above exception was the direct cause of the following exception:
Oct 05 16:28:35 hass.home hass[17066]: Traceback (most recent call last):
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/setup.py", line 215, in _async_setup_component
Oct 05 16:28:35 hass.home hass[17066]:     component = integration.get_component()
Oct 05 16:28:35 hass.home hass[17066]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 05 16:28:35 hass.home hass[17066]:   File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 826, in get_component
Oct 05 16:28:35 hass.home hass[17066]:     raise ImportError(f"Exception importing {self.pkg_path}") from err
Oct 05 16:28:35 hass.home hass[17066]: ImportError: Exception importing homeassistant.components.zwave_js

@jove01
Copy link

jove01 commented Oct 5, 2023

same problem with modbus.
I ignore this update

@ALaDoffe
Copy link

ALaDoffe commented Oct 6, 2023

Hi
Same issue for me
Any news ?

@tanuva
Copy link

tanuva commented Oct 6, 2023

I can confirm this still persists:

@frenck
Copy link
Member

frenck commented Oct 6, 2023

This is a closed issue. The issue original reported in the OP has been resolved and confirmed working.

If you are experiencing an issue, please raise a new one.

Thanks! 👍

../Frenck

@home-assistant home-assistant locked and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.