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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add debug more information when splitting entity ID failed #49944
Conversation
Patched it in my running container to see if we can pinpoint the issue before next beta. Thanks Frenck! |
try: | ||
return entity_id.split(".", 1) | ||
except AttributeError as err: | ||
raise HomeAssistantError("Unexpected entity ID format", entity_id) from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you expect to include the entity ID in the message? I don't see how the second arg is used?
Also did you verify every place where this is used to make sure no one was catching attribute error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, it is adding the entity_ids. Patched my running container and got this error after a long wait:
homeassistant.exceptions.HomeAssistantError: ('Unexpected entity ID format', ['switch.grijze_lamp', 'light.window_level', 'switch.staande_lamp', 'switch.zoutlamp', 'climate.woonkamer'])
Full trace in the linked issue.
edit: it's google_assitant
, I was able to reproduce. See issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you expect to include the entity ID in the message?
Yes, see, above. In example linked by @hmmbob
Also did you verify every place where this is used to make sure no one was catching attribute error?
No, but the PR can be closed as the goal of this PR was to find the issue... which has been found. It is caused by this PR:
Send only a single event per incoming Google command
#49449
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL we can just pass tuples to exceptions 馃槅
Proposed change
Small change to a core method, that adds more information as soon as an issue occurs with splitting entity ID's.
Issues from 2 reporters during the beta of 2021.5:
It would help if we knew the contents that it is trying to split to determine the source of the issue.
This PR adjusts the handling, to raise an HomeAssistant error with the entity_id it actually tries to split.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: