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

Reloading "All YAML Configuration" results in error with transition to new command_line sensors (2023.6.0b4) #94082

Closed
RobertD502 opened this issue Jun 5, 2023 · 4 comments · Fixed by #94085

Comments

@RobertD502
Copy link
Contributor

The problem

I transitioned two affected sensors to the new format for command line sensors that was introduced in the 2023.6.0 beta. The new command line sensors work just as expected. However, there seems to be a bug when reloading all YAML configuration from within developer tools.

  1. For starters, prior to reloading all YAML, the two sensors work as expected:
    image
    (Disregard the naming - I'm using ZWaveJs-UI, but haven't bothered to change the name of my sensors since the naming change happened)

  2. Reloading all YAML configuration (from developer tools), fails as seen below (associated log located at the bottom of this issue):
    reload yaml fail

  3. When this reload happens, the two command line entities are no longer available:
    image

  4. Going back into developer tools and selecting Reload YAML configuration succeeds the second time around:
    reload yaml ok

Although the reload works the second time around, when checking back on those two entities, they are still not available:
image

The only way of getting those two entities back up is to restart Home Assistant.

What version of Home Assistant Core has the issue?

2023.6.0b4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Command Line

Link to integration documentation on our website

https://rc.home-assistant.io/integrations/command_line/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/entity.py:863
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:38:14 PM (1 occurrences)
Last logged: 12:38:14 PM

[140148878758608] Entity binary_sensor.zwavejs2mqtt_status async_remove called twice
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 887, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 339, in async_handle_reload_all
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 887, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 176, in _reload_config
    await async_reload_integration_platforms(hass, domain, platforms)
  File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 53, in async_reload_integration_platforms
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 98, in _resetup_platform
    await _async_reconfig_platform(platform, root_config[integration_platform])
  File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 136, in _async_reconfig_platform
    await platform.async_reset()
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 763, in async_reset
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 863, in async_remove
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity binary_sensor.zwavejs2mqtt_status async_remove called twice

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jun 5, 2023

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

Code owner commands

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

(message by CodeOwnersMention)


command_line documentation
command_line source
(message by IssueLinks)

@RobertD502
Copy link
Contributor Author

RobertD502 commented Jun 6, 2023

Just wanted to provide an update after installing beta 5:

Although reloading the yaml configuration doesn't produce any errors, the command_line binary sensors still become unavailable after the reload. Again, only way to get them back up is to restart Home Assistant.

image

Edit: turned on debugging for the command_line component, but nothing is being logged regarding the sensors going unavailable after a reload.

@gjohansson-ST
Copy link
Member

Would have expected something in the logs but you have checked it hasn't created any new entities or something as such?

@RobertD502
Copy link
Contributor Author

Unfortunately, nothing is logged with debug logging turned on. I can confirm that the logging is working as there are entries showing the command line binary sensors in the logs prior to the reload. However, as soon as the yaml is reloaded from within developer tools, the logs stop.

I checked to see if new entities are being created when this happens and that isn't the case.

Example of what is seen when entity goes unavailable after a reload:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants