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

"ULID must be 26 characters" after 2023.4 upgrade when using adaptive lighting custom component #90887

Closed
Coder84619 opened this issue Apr 6, 2023 · 8 comments
Assignees

Comments

@Coder84619
Copy link

The problem

I'm seeing a number of log entries complaining about ULID length. Appears to be limited to Philips Hue lights.

"Error while processing event EventTask(event=<Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.office, transition=45.0, brightness=255, color_temp_kelvin=3755>): ULID must be 26 characters"

This seems to be happening on a lot of my lights.

What version of Home Assistant Core has the issue?

core-2023.4.0

What was the last working version of Home Assistant Core?

2023.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Philips Hue

Link to integration documentation on our website

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

Diagnostics information

config_entry-hue-d7dc657c10ad8cd0238aee966afd9d13.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Error while processing event EventTask(event=<Event state_changed[L]: entity_id=light.office, old_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3717, color_temp=269, hs_color=(26.983, 40.252), rgb_color=(255, 198, 152), xy_color=(0.439, 0.37), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>, new_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3703, color_temp=270, hs_color=(26.994, 40.533), rgb_color=(255, 198, 151), xy_color=(0.44, 0.371), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>>): ULID must be 26 characters
Error while processing event EventTask(event=<Event state_changed[L]: entity_id=light.office, old_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3703, color_temp=270, hs_color=(26.994, 40.533), rgb_color=(255, 198, 151), xy_color=(0.44, 0.371), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>, new_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3717, color_temp=269, hs_color=(26.983, 40.252), rgb_color=(255, 198, 152), xy_color=(0.439, 0.37), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>>): ULID must be 26 characters
Error while processing event EventTask(event=<Event state_changed[L]: entity_id=light.office_lights_all, old_state=<state light.office_lights_all=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, 'onoff', <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3707, color_temp=269, hs_color=(26.991, 40.453), rgb_color=(255, 198, 151), xy_color=(0.44, 0.371), effect=None, entity_id=['light.office', 'light.office_benq_desk_light', 'light.office_floor_lamp', 'light.office_desk_led_strip'], icon=mdi:lightbulb-group, friendly_name=Office Lights - All, supported_features=LightEntityFeature.TRANSITION|FLASH|EFFECT @ 2023-04-05T15:53:00.441768-07:00>, new_state=<state light.office_lights_all=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, effect_list=['None', 'candle', 'fire'], supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, 'onoff', <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3712, color_temp=269, hs_color=(26.987, 40.352), rgb_color=(255, 198, 152), xy_color=(0.439, 0.37), effect=None, entity_id=['light.office', 'light.office_benq_desk_light', 'light.office_floor_lamp', 'light.office_desk_led_strip'], icon=mdi:lightbulb-group, friendly_name=Office Lights - All, supported_features=LightEntityFeature.TRANSITION|FLASH|EFFECT @ 2023-04-05T15:53:00.441768-07:00>>): ULID must be 26 characters
Error while processing event EventTask(event=<Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.office, transition=45.0, brightness=255, color_temp_kelvin=3675>): ULID must be 26 characters
Error while processing event EventTask(event=<Event state_changed[L]: entity_id=light.office, old_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3703, color_temp=270, hs_color=(26.994, 40.533), rgb_color=(255, 198, 151), xy_color=(0.44, 0.371), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>, new_state=<state light.office=on; min_color_temp_kelvin=2000, max_color_temp_kelvin=6535, min_mireds=153, max_mireds=500, supported_color_modes=[<ColorMode.COLOR_TEMP: 'color_temp'>, <ColorMode.XY: 'xy'>], color_mode=color_temp, brightness=255, color_temp_kelvin=3676, color_temp=272, hs_color=(27.015, 41.078), rgb_color=(255, 197, 150), xy_color=(0.441, 0.37), is_hue_group=True, hue_scenes={'Morning', 'Evening'}, hue_type=room, lights={'Office desk LED strip', 'Office front left', 'Office rear right', 'Office Floor Lamp', 'Office rear left', 'Office front right'}, dynamics=False, icon=mdi:light-recessed, friendly_name=Office Ceiling Lights, supported_features=LightEntityFeature.TRANSITION|FLASH @ 2023-04-05T15:52:59.421792-07:00>>): ULID must be 26 characters

@home-assistant
Copy link

home-assistant bot commented Apr 6, 2023

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

Code owner commands

Code owners of hue 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 hue Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


hue documentation
hue source
(message by IssueLinks)

@Coder84619
Copy link
Author

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 825, in _guarded_process_one_task_or_recover
self._process_one_task_or_recover(task)
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 836, in _process_one_task_or_recover
return task.run(self)
File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 281, in run
instance._process_one_event(self.event)
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 944, in _process_one_event
self._process_non_state_changed_event_into_session(event)
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 953, in _process_non_state_changed_event_into_session
dbevent = Events.from_event(event)
File "/usr/src/homeassistant/homeassistant/components/recorder/db_schema.py", line 276, in from_event
context_id_bin=ulid_to_bytes_or_none(event.context.id),
File "/usr/src/homeassistant/homeassistant/components/recorder/models/context.py", line 15, in ulid_to_bytes_or_none
return ulid_to_bytes(ulid)
File "src/ulid_transform/_ulid_impl.pyx", line 22, in ulid_transform._ulid_impl._ulid_to_bytes
ValueError: ULID must be 26 characters

@bdraco
Copy link
Member

bdraco commented Apr 6, 2023

Which integration is triggering the hue to change state?

bdraco added a commit that referenced this issue Apr 6, 2023
changelog: bdraco/ulid-transform@v0.5.1...v0.6.0

to find the source of the invalid ulids in #90887
@bdraco bdraco mentioned this issue Apr 6, 2023
20 tasks
bdraco added a commit that referenced this issue Apr 6, 2023
changelog: bdraco/ulid-transform@v0.5.1...v0.6.0

to find the source of the invalid ulids in #90887
bdraco added a commit that referenced this issue Apr 6, 2023
Ensures states can still be recorded if the context
has an invalid ULID attached as seen in #90887
cgarwood pushed a commit that referenced this issue Apr 6, 2023
* Bump ulid-transform 0.6.0

changelog: bdraco/ulid-transform@v0.5.1...v0.6.0

to find the source of the invalid ulids in #90887
@bdraco
Copy link
Member

bdraco commented Apr 6, 2023

It looks like https://github.com/basnijholt/adaptive-lighting is creating non-ULID contexts

@bdraco
Copy link
Member

bdraco commented Apr 6, 2023

basnijholt/adaptive-lighting#493

@bdraco bdraco changed the title "ULID must be 26 characters" after 2023.4 upgrade (Hue Philips Lights) "ULID must be 26 characters" after 2023.4 upgrade when using adaptive lighting custom component Apr 6, 2023
@tivoo
Copy link

tivoo commented Apr 6, 2023

Same issue here with Home Assistant 2023.4.0. Also because of AL.

@frenck
Copy link
Member

frenck commented Apr 6, 2023

Custom integrations are not supported by the Home Assistant project.

In this case, an issue is available upstream:

basnijholt/adaptive-lighting#493

Please follow that issue for the progress of this specific issue.

Going to close this issue on our end, as there is nothing we can do.

../Frenck

@frenck frenck closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
balloob pushed a commit that referenced this issue Apr 6, 2023
* Bump ulid-transform 0.6.0

changelog: bdraco/ulid-transform@v0.5.1...v0.6.0

to find the source of the invalid ulids in #90887
@stiltjack
Copy link

stiltjack commented Apr 22, 2023

Not using MariaDB or adaptive lighting.

` Logger: homeassistant.components.recorder.models.context
Source: components/recorder/models/context.py:19
Integration: Recorder (documentation, issues)
First occurred: 13:40:32 (19 occurrences)
Last logged: 13:41:12

Error converting ulid ec_e56e04_f82f60003d5d21ce4a5c21a782 to bytes: ULID must be a 26 character string: ec_e56e04_f82f60003d5d21ce4a5c21a782
Error converting ulid ec_81753b_93053bed2cbb9f2d9ad89019ab to bytes: ULID must be a 26 character string: ec_81753b_93053bed2cbb9f2d9ad89019ab
Error converting ulid ec_6a1a74_97cceafec57a710407f3c796ed to bytes: ULID must be a 26 character string: ec_6a1a74_97cceafec57a710407f3c796ed
Error converting ulid ec_f4996a_b22bfa72f35aa6cd5c901b7b95 to bytes: ULID must be a 26 character string: ec_f4996a_b22bfa72f35aa6cd5c901b7b95
Error converting ulid ec_f4996a_f756ad87fc75d19ef5e7b2b9e1 to bytes: ULID must be a 26 character string: ec_f4996a_f756ad87fc75d19ef5e7b2b9e1
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/models/context.py", line 19, in ulid_to_bytes_or_none
return ulid_to_bytes(ulid)
File "src/ulid_transform/_ulid_impl.pyx", line 23, in ulid_transform._ulid_impl._ulid_to_bytes
ValueError: ULID must be a 26 character string: ec_bdb7fe_2cd631f22f52bdc69a502dacf0
`

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

No branches or pull requests

7 participants