UI icon indicating copy to clipboard operation
UI copied to clipboard

Updated to 1.1.0, enabled install/upgrade custom cards, reauthenticated to Github, now error

Open Calimerorulez opened this issue 2 years ago • 12 comments

Hi,

I just upgraded to 1.1.0. I enabled the custom card install/upgrade via the new integration option. I had to reauthenticate for Github. That was successful, but now the integration throws an error:

Traceback (most recent call last):
  File "/config/custom_components/ui_lovelace_minimalist/__init__.py", line 141, in async_reload_entry
    await async_setup_entry(hass, config_entry)
  File "/config/custom_components/ui_lovelace_minimalist/__init__.py", line 124, in async_setup_entry
    return await async_initialize_integration(hass=hass, config_entry=config_entry)
  File "/config/custom_components/ui_lovelace_minimalist/__init__.py", line 104, in async_initialize_integration
    startup_result = await async_startup()
  File "/config/custom_components/ui_lovelace_minimalist/__init__.py", line 90, in async_startup
    await ulm.configure_community_cards()
  File "/config/custom_components/ui_lovelace_minimalist/base.py", line 280, in configure_community_cards
    content=await self.async_github_get_file(
  File "/config/custom_components/ui_lovelace_minimalist/base.py", line 178, in async_github_get_file
    return decode_content(response.data.content)
  File "/config/custom_components/ui_lovelace_minimalist/utils/decode.py", line 7, in decode_content
    return b64decode(bytearray(content, "utf-8")).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

And so, the theme does not load. Just to try, I enabled all custom cards, maybe that's overenthousiastic ;)

Calimerorulez avatar Aug 05 '22 19:08 Calimerorulez

I'm currently on holiday, could you maybe let us know what card you selected. Maybe it has some windows characters in the file. Like the dashes. Or is it happening on every card you selected.

stokkie90 avatar Aug 05 '22 21:08 stokkie90

It happens on starting up HA. That throws the error when loading UI Minimalist.

The menu item in the side bar isn't loaded either.

On 1.0.3 it was running perfectly, maybe I selected to many custom cards (like all) to be installed 😋

Enjoy your vacation 👍🏻

I will try to debug more.

Calimerorulez avatar Aug 05 '22 22:08 Calimerorulez

It really sounds like a problem in 1 file. We probably need to create some check for it. But I do recommend only select cards you actually use. Otherwise it will slow down startup and your UI to load in all templates.

stokkie90 avatar Aug 06 '22 00:08 stokkie90

Yes, that solves it 😅

Calimerorulez avatar Aug 06 '22 05:08 Calimerorulez

same over here. going to dig

dvbit avatar Aug 08 '22 12:08 dvbit

Please list the cards that are selected. That might help track down the card causing the problem.

If someone could loop over the files and see which one is not using UTF-8 using for example this tool. https://www.npmjs.com/package/detect-file-encoding-and-language that would be great

Thanks.

stokkie90 avatar Aug 08 '22 12:08 stokkie90

media_player_sonos qubino water_heater wsly_pollen myenedis

dvbit avatar Aug 08 '22 12:08 dvbit

@stokkie90: I think I set up everything properly, no warning or error in the logs, Github authenticated, only custom_card_esh_room selected, everything is on the latest version, HAOS restarted, but card still not updated to v2.1.1 (stays on v2.0.0). Any idea as I also went through the documentation already? Thank you.

shift-del1 avatar Aug 16 '22 14:08 shift-del1

@shift-del1 any chance you have it still the old version in the custom cards folder?

stokkie90 avatar Aug 16 '22 18:08 stokkie90

@shift-del1 any chance you have it still the old version in the custom cards folder?

I did not alter anything in config/ui_lovelace_minimalist/custom_cards folder. Still version 2.0.0 in both the above and the corresponding subfolder under custom_components (manually downloaded yaml from the past). Did I miss an important step?

shift-del1 avatar Aug 16 '22 18:08 shift-del1

You need to remove it from the config folder. As now it will overrule the one the integration configures

stokkie90 avatar Aug 16 '22 20:08 stokkie90

You need to remove it from the config folder. As now it will overrule the one the integration configures

Deleting the community cards from the config folder solved my issue, thank you. I also noticed the cards marked for auto-update in the custom components folder's community cards subfolder. Thank you for your help.

shift-del1 avatar Aug 17 '22 12:08 shift-del1