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
74.11k stars 31.11k forks source link

Husqvarna Automower cannot import name 'make_name_string' #127622

Open Herbs851 opened 1 month ago

Herbs851 commented 1 month ago

The problem

Hi,

Integration broken after update from version 2024.9.3 to version 2024.10.1

According to the error messages, there seems to be an import problem during startup.

Rollback to 2024.9.3 fix the issue.

What version of Home Assistant Core has the issue?

2024.10.1

What was the last working version of Home Assistant Core?

2024.9.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Husqvarna Automower

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Error setting up entry Husqvarna Automower of XXXXX Xxxxxxxx for husqvarna_automower
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/husqvarna_automower/__init__.py", line 76, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2147, in async_forward_entry_setups
    await integration.async_get_platforms(platforms)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
    import_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
    import_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
    import_future.result()
  [Previous line repeated 6 more times]
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms
    platforms.update(self._load_platforms(platform_names))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms
    platform_name: self._load_platform(platform_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 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 "/usr/src/homeassistant/homeassistant/components/husqvarna_automower/calendar.py", line 6, in <module>
    from aioautomower.model import make_name_string
ImportError: cannot import name 'make_name_string' from 'aioautomower.model' (/config/deps/lib/python3.12/site-packages/aioautomower/model.py)

Additional information

No response

home-assistant[bot] commented 1 month ago

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

Code owner commands Code owners of `husqvarna_automower` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign husqvarna_automower` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


husqvarna_automower documentation husqvarna_automower source (message by IssueLinks)

jopaleti commented 1 month ago

@Herbs851 I can work on this

Herbs851 commented 1 month ago

Hi,

@jopaleti do you have any news ?

In any case, thank you for any help you can give ;) !!!

AntorFr commented 1 month ago

Hi,

Same issue on my side. happy to help if I can.

Best

Herbs851 commented 1 month ago

Hi,

I found a workaround today.

image

I can't see directory aioautomower in /config/deps/lib/python3.12/site-packages/ anymore, but integration works again with HA 2024.10.4

And now from inside the container i find model.py here :

/usr/local/lib/python3.12/site-packages/aioautomower/model.py
/root/.cache/uv/archive-v0/t74eDNotkkHX-c4_-HYT6/aioautomower/model.py

I don't know how to explain it, I don't know if it's normal, but it works.