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

Image can't be loaded #276

Closed
ChristophCaina opened this issue Apr 29, 2024 · 12 comments
Closed

Image can't be loaded #276

ChristophCaina opened this issue Apr 29, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@ChristophCaina
Copy link
Contributor

After restarting my System, it seems that the images can't be loaded anymore.
All entities are available, except the car-images

grafik
grafik

After reloading the config, all entities were unavailable - and the following error could be seen in the logs.

Logger: homeassistant.components.switch
Quelle: helpers/entity_platform.py:356
Integration: Schalter ([Dokumentation](https://rc.home-assistant.io/integrations/switch), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+switch%22))
Erstmals aufgetreten: 19:45:41 (2 Vorkommnisse)
Zuletzt protokolliert: 19:46:38

Error while setting up skodaconnect platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/skodaconnect/switch.py", line 25, in async_setup_entry
    data = hass.data[DOMAIN][entry.entry_id][DATA]
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'b9414cf02e2eb912fbb7407fea826e2c'

After installing beta 02 from HA 2024.5 - the integration came back, but the images are still not available.

@ChristophCaina ChristophCaina added the bug Something isn't working label Apr 29, 2024
@dvx76
Copy link
Member

dvx76 commented Apr 29, 2024

At first sight the debug doesn't seem related to the issue (the image entities are sensors, not switches).

The image issue reminds me of #191 which turned out to be a temporary glitch in the API responses.

@UnsignedLong
Copy link

I have the same kind of error.
I have two cars configured but there is only one car at a time that'll work. For the not working car I have the same key error as @ChristophCaina for switch, binary_sensor and device_tracker.
If I reload the non working instance it starts working but the other one stops working with the mentioned key errors.

@UnsignedLong
Copy link

UnsignedLong commented May 3, 2024

Downgrading the custom component to 1.2.8 solves my issue, bug was introduces in 1.2.9.
Most obvious change here is the bump of skodaconnect to 1.3.10, but I don't spot anything right now that'll explain this behaviour.

homeassistant-skodaconnect 1.2.8 vs 1.2.9: 1.2.8...1.2.9

skodaconnect 1.3.9 vs 1.3.10: skodaconnect/skodaconnect@1.3.9...1.3.10

@dvx76
Copy link
Member

dvx76 commented May 3, 2024

It might be that the fact of re-installing, rather than the downgrade itself, fixed your issue.

Either way, none of this would be related to the missing model image URL sensors reported in this issue. I am still convinced that is due to a server-side issue. I regularly see owners on forums complain about missing model images in the MySkoda app as well.

If you have persisting issues with KeyErrors in hass.data[DOMAIN][entry.entry_id][DATA] please create a separate issue.

@dvx76
Copy link
Member

dvx76 commented May 3, 2024

FWIW same KeyError was seen in #206

@UnsignedLong
Copy link

Can reproduce it by installing a version > 1.2.8 again. Will create a new issue later on.

@stickpin
Copy link

stickpin commented May 4, 2024

I think in volkswagencarnet we are hitting the same issue after HA 2024.5.x.
It's easily reproducible once you have multiple vehicles configured in the integration.
I am trying to find the root cause as well.

@dvx76
Copy link
Member

dvx76 commented May 4, 2024

Thanks for sharing! I can only test with one car myself. Upgraded to HA 2024.5.1 and no issue (with one car).

@dvx76
Copy link
Member

dvx76 commented May 4, 2024

@ChristophCaina do you still have the issue with the model image URL sensors? I can't reproduce. If you still have the problem please look for matching debug logs.

@ChristophCaina
Copy link
Contributor Author

For a couple of days it seems to work now - anyway, I have removed the Image from the Dashboard recently, so I don't see it immediately - If it would fail

@dvx76
Copy link
Member

dvx76 commented May 5, 2024

Thanks for the update. Please reopen or open a new issue if it happens again and you have logs which suggest it's a client side issue.

@dvx76 dvx76 closed this as completed May 5, 2024
@stickpin
Copy link

stickpin commented May 5, 2024

@dvx76 just to let you know, I believe you have the same issue as we are in the volkwagencarnet:

for component in components:
coordinator.platforms.append(component)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, component)
)
hass.data[DOMAIN][entry.entry_id] = {
UPDATE_CALLBACK: update_callback,
DATA: data,
UNDO_UPDATE_LISTENER: entry.add_update_listener(_async_update_listener),
REMOVE_LISTENER: hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, coordinator.async_logout
),
}

The use of hass.data by the components is happening before it's actually getting assigned.
You need to change the order, see my PR for more details: robinostlund/homeassistant-volkswagencarnet#617

The issue will be visible only if you have more than one vehicle configured in the integration.

dvx76 added a commit to dvx76/homeassistant-skodaconnect that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants