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

HACS broken #119361

Closed
markfear opened this issue Jun 11, 2024 · 3 comments
Closed

HACS broken #119361

markfear opened this issue Jun 11, 2024 · 3 comments

Comments

@markfear
Copy link

The problem

HACS was working. Then I updated Ubuntu, and now it doesn't. Log entry asked to create a bug report here, so log entry is below.

Python issue - something to do with a 'recursive guard'?

What version of Home Assistant Core has the issue?

core-2024.5.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

HACS

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?

Logger: homeassistant.util.loop
Source: util/loop.py:99
First occurred: 07:44:24 (3 occurrences)
Last logged: 07:45:48

Detected blocking call to import_module inside the event loop by custom integration 'waste_collection_schedule' at custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py, line 188: source_module = importlib.import_module( (offender: /home/homeassistant/.homeassistant/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py, line 188: source_module = importlib.import_module(), please report it to the author of the 'waste_collection_schedule' custom integration
Detected blocking call to import_module inside the event loop by integration 'config' at homeassistant/components/config/config_entries.py, line 179: return await super()._post_impl(request, data) (offender: /srv/homeassistant/lib/python3.12/site-packages/homeassistant/loader.py, line 1270: return importlib.import_module(f"{self.pkg_path}.{platform_name}")), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+config%22

Logger: homeassistant.loader
Source: loader.py:1238
First occurred: 07:45:00 (4 occurrences)
Last logged: 07:45:48

Unexpected exception importing platform custom_components.hacs.config_flow
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/loader.py", line 1238, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/loader.py", line 1270, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/loop.py", line 144, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/hacs/__init__.py", line 12, in <module>
    from aiogithubapi import AIOGitHubAPIException, GitHub, GitHubAPI
  File "/srv/homeassistant/lib/python3.12/site-packages/aiogithubapi/__init__.py", line 20, in <module>
    from .device import GitHubDeviceAPI
  File "/srv/homeassistant/lib/python3.12/site-packages/aiogithubapi/device.py", line 14, in <module>
    from .client import GitHubClient
  File "/srv/homeassistant/lib/python3.12/site-packages/aiogithubapi/client.py", line 27, in <module>
    from .legacy.client import AIOGitHubAPIClient as LegacyAIOGitHubAPIClient
  File "/srv/homeassistant/lib/python3.12/site-packages/aiogithubapi/legacy/client.py", line 15, in <module>
    from ..helpers import async_call_api
  File "/srv/homeassistant/lib/python3.12/site-packages/aiogithubapi/helpers.py", line 8, in <module>
    from sigstore.verify import (
  File "/srv/homeassistant/lib/python3.12/site-packages/sigstore/verify/__init__.py", line 54, in <module>
    from sigstore.verify.models import (
  File "/srv/homeassistant/lib/python3.12/site-packages/sigstore/verify/models.py", line 30, in <module>
    from sigstore._internal.rekor import RekorClient
  File "/srv/homeassistant/lib/python3.12/site-packages/sigstore/_internal/rekor/__init__.py", line 19, in <module>
    from .client import RekorClient
  File "/srv/homeassistant/lib/python3.12/site-packages/sigstore/_internal/rekor/client.py", line 45, in <module>
    class RekorBundle(BaseModel):
  File "/srv/homeassistant/lib/python3.12/site-packages/pydantic/main.py", line 286, in __new__
    cls.__try_update_forward_refs__()
  File "/srv/homeassistant/lib/python3.12/site-packages/pydantic/main.py", line 808, in __try_update_forward_refs__
    update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,))
  File "/srv/homeassistant/lib/python3.12/site-packages/pydantic/typing.py", line 554, in update_model_forward_refs
    update_field_forward_refs(f, globalns=globalns, localns=localns)
  File "/srv/homeassistant/lib/python3.12/site-packages/pydantic/typing.py", line 520, in update_field_forward_refs
    field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/pydantic/typing.py", line 66, in evaluate_forwardref
    return cast(Any, type_)._evaluate(globalns, localns, set())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

Additional information

No response

@markfear
Copy link
Author

HACS was refusing to load, so I tried to delete it and re-add it, but now when I try to add it to integrations I get this message:

Error
Config flow could not be loaded: {"message":"Invalid handler specified"}

@markfear
Copy link
Author

“Broken” version was on Ubuntu 22.04 LTS. Issue fixed by building a new 24.04 LTS VM, installing HA and using a backup to move everything over. HACS now working again, so although root cause not found, no longer an immediate issue for me.

@morph027
Copy link

Same for me, core installation on Ubuntu 22.04 w/ Python 3.12.4 (from deadsnakes PPA).

Looking at #119454 , bumping pydantic to 1.10.16 seems to fix the issue. (edit homeassistant/lib/python3.12/site-packages/homeassistant/package_constraints.txt)

@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants