nimroddolev / chime_tts

A custom Home Assistant integration to play combined audio files before and/or after text-to-speech (TTS) messages
https://nimroddolev.github.io/chime_tts/
MIT License
196 stars 14 forks source link

Configuration Screen Causes Home Assistant to Freeze #132

Closed rgb2017 closed 5 months ago

rgb2017 commented 6 months ago

System Health details

System Information

version core-2024.5.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.29-haos
arch x86_64
timezone America/Phoenix
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 3453 Installed Version | 1.34.0 Stage | running Available Repositories | 1400 Downloaded Repositories | 51
AccuWeather error | failed to load: unknown -- | --
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | January 29, 2025 at 5:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | us-east-1-9.ui.nabu.casa certificate_status | ready instance_id | b62e3ab52b17471f85b3c8b9f3e1c5ee can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.3 -- | -- update_channel | stable supervisor_version | supervisor-2024.05.1 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 30.8 GB disk_used | 14.6 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.14.0), Log Viewer (0.17.0), Studio Code Server (5.15.0), Ring-MQTT with Video Streaming (5.6.4), Mosquitto broker (6.4.0), go2rtc (1.9.1), Samba share (12.3.1), Z-Wave JS UI (3.6.0), openWakeWord (1.10.0), Silicon Labs Multiprotocol (2.4.5), ESPHome (2024.4.2), Silicon Labs Flasher (0.2.3)
Dashboards dashboards | 8 -- | -- resources | 35 views | 37 mode | storage
Recorder oldest_recorder_run | May 2, 2024 at 10:38 PM -- | -- current_recorder_run | May 12, 2024 at 7:43 PM estimated_db_size | 237.79 MiB database_engine | sqlite database_version | 3.44.2

Checklist

Describe the issue

I select Configure for the Chime TTS integration and the configuration pop up is displayed. Without regardless of whether changes are made or not when 'Save' is pressed the screen freezes and Home Assistant hangs and is no longer accessible. The CPU and Memory go into a high usage state. The only way to recover is to force reboot the server.

This occurs on v1 and I also tested Beta 5 and Beta 6.

Reproduction steps

  1. Select Configure
  2. Press Save.
  3. ...

Debug logs

Unable to obtain because the system immediately freezes.

Diagnostics dump

No response

nimroddolev commented 6 months ago

Hi @rgb2017.

Can you please tell me what values you have for each option in the configuration before you press Save?

rgb2017 commented 6 months ago

Hi @rgb2017.

Can you please tell me what values you have for each option in the configuration before you press Save?

Screenshot attached. All 5 of the custom slots are empty.

image
nimroddolev commented 6 months ago

Thank you. There doesn’t seem to be anything wrong with the values you have.

Could you please try removing the default TTS platform value and see if that solves the issue?

rgb2017 commented 6 months ago

I removed the word 'cloud' and then pressed save. Same behavior where it starts to clock, server cpu and memory increases significantly, and I can't start new HA sessions. Force restarted the server, and then went back to the configure UI and confirmed the word 'cloud' was still present.

Just to add to the original description, the service works as is. I would like to be able to add custom sounds though.

troykelly commented 6 months ago

I've tried several settings combinations, and they all result in an infinite restart loop of chime.

Brave Browser - pve003 - Proxmox Virtual Environment 2024-05-14 at 5 25 14 PM

roycwalton commented 6 months ago

I also experienced this same issue. Running Home Assistant with core 2024.5.3, OS 12.3, Supervisor 2024.05.1

When 'save' was clicked - system hung and crashed. Eventually it self-recovered without the need to force restart/power off.

gigawebs commented 6 months ago

I am encountering a similar problem with Home Assistant. I am using core version 2024.5.4, OS 12.3, and Supervisor 2024.05.1. When I clicked 'save,' the system froze and crashed. However, it eventually recovered on its own.

troykelly commented 6 months ago

My experience is that it gets better because it uses up all the resources and restarts, I don't think it's actually recovering.

donburch888 commented 6 months ago

Same. HAOS Just reinstalled, this time the 1.0.0.beta6 Go into configuration screen, make NO changes image click [save] and get the blue circle wait symbol for about 6 minutes before returning image It seems the whole HA is too busy to respond to anything else during this period.

Looking at the Home Assistant Core log, it seems that the system rebooted:

2024-05-20 11:45:02.952 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration mass which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.954 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.954 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration chime_tts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.957 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration zha_toolkit which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.958 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration tuya_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.960 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:02.962 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration bureau_of_meteorology which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-20 11:45:03.450 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly 2024-05-20 11:45:03.487 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=386 from 2024-05-20 00:07:49.797673) 2024-05-20 11:45:05.594 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from rhasspy-0 (192.168.1.86). Requested URL: '/media/local/sounds/temp/chime_tts/cover.png'. (Music Player Daemon 0.21.5) 2024-05-20 11:45:05.614 WARNING (MainThread) [homeassistant.components.switch] Platform broadlink not ready yet: None; Retrying in background in 30 seconds 2024-05-20 11:45:05.625 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from rhasspy-0 (192.168.1.86). Requested URL: '/media/local/sounds/temp/chime_tts/cover.jpg'. (Music Player Daemon 0.21.5) 2024-05-20 11:45:05.641 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from rhasspy-0 (192.168.1.86). Requested URL: '/media/local/sounds/temp/chime_tts/cover.tiff'. (Music Player Daemon 0.21.5) 2024-05-20 11:45:05.647 DEBUG (ImportExecutor_0) [custom_components.chime_tts.queue_manager] Queue reset 2024-05-20 11:45:05.648 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.chime_tts',) in /usr/src/homeassistant/homeassistant/loader.py, line 1041: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop 2024-05-20 11:45:05.649 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Queue reset 2024-05-20 11:45:05.650 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up. 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS Configuration Values: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - queue_timeout: 60 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - tts_platform: '' 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - offset: 0 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - fade_transition: 500 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - temp_chimes_path: '/media/sounds/temp/chime_tts/chimes/' 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - temp_path: '/media/sounds/temp/chime_tts/' 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - www_path: '/config/www/chime_tts/' 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - media_dir: 'local' 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_paths: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_chime_path_1: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_chime_path_2: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_chime_path_3: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_chime_path_4: 2024-05-20 11:45:05.650 DEBUG (MainThread) [custom_components.chime_tts] - custom_chime_path_5: 2024-05-20 11:45:05.653 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited handle = None # Needed to break cycles when an exception occurs. 2024-05-20 11:45:05.666 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from rhasspy-0 (192.168.1.86). Requested URL: '/media/local/sounds/temp/chime_tts/cover.bmp'. (Music Player Daemon 0.21.5) 2024-05-20 11:45:07.294 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues 2024-05-20 11:45:08.124 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/mashumaro/core/meta/types/unpack.py:182: UserWarning: music_assistant.common.models.config_entries.ConfigValueOption.value (typing.Union[str, int, float, bool, tuple[int, int], list[str], list[int], list[tuple[int, int]], None]): In the next release, data marked with Union type containing 'str' and 'bool' will be coerced to the value of the type specified first instead of passing it as is warnings.warn( 2024-05-20 11:45:08.130 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/mashumaro/core/meta/types/unpack.py:182: UserWarning: music_assistant.common.models.config_entries.ConfigEntry.default_value (typing.Union[str, int, float, bool, tuple[int, int], list[str], list[int], list[tuple[int, int]], None]): In the next release, data marked with Union type containing 'str' and 'bool' will be coerced to the value of the type specified first instead of passing it as is warnings.warn( 2024-05-20 11:45:08.134 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/mashumaro/core/meta/types/unpack.py:182: UserWarning: music_assistant.common.models.config_entries.ConfigEntry.value (typing.Union[str, int, float, bool, tuple[int, int], list[str], list[int], list[tuple[int, int]], None]): In the next release, data marked with Union type containing 'str' and 'bool' will be coerced to the value of the type specified first instead of passing it as is warnings.warn( 2024-05-20 11:45:11.307 WARNING (SyncWorker_17) [custom_components.tuya_local.device] PC191HA-106 protocol error 901: Network Error: Unable to Connect 2024-05-20 11:45:23.675 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues 2024-05-20 11:45:59.244 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:46:13.452 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:46:25.292 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:46:39.500 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:46:53.708 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:47:07.916 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:47:22.124 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:47:36.332 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:47:50.540 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:48:04.748 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:48:18.956 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106 2024-05-20 11:48:33.164 ERROR (MainThread) [custom_components.tuya_local.device] Failed to fetch device status for PC191HA-106

gpayer commented 6 months ago

Same here, HA was not responsive anymore.

I had to ssh into HA and remove the integration manually by editing homeassistant/.storage/core.config_entries. Then ha core restart worked and everything was back to normal.

Unfortunately there aren't any useful error messages in the logs.

sven-pb commented 6 months ago

Same here, HA was not responsive anymore.

I had to ssh into HA and remove the integration manually by editing homeassistant/.storage/core.config_entries. Then ha core restart worked and everything was back to normal.

Unfortunately there aren't any useful error messages in the logs.

same here

2024-05-24 19:15:14.082 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.chime_tts',) in /usr/src/homeassistant/homeassistant/loader.py, line 1041: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop
2024-05-24 19:15:14.088 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1973: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited
  handle = self._ready.popleft()
2024-05-24 19:15:17.207 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 642: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-05-24 19:16:02.766 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [135542135713984] Sven from 172.19.0.8: Client unable to keep up with pending messages. Reached 4096 pending messages. The system's load is too high or an integration is misbehaving; Last message was: b'{"type":"event","event":{"event_type":"service_registered","data":{"domain":"chime_tts","service":"clear_cache"},"origin":"LOCAL","time_fired":"2024-05-24T17:16:02.766281+00:00","context":{"id":"01HYNSMETE37GZF6XX413NS7JM","parent_id":null,"user_id":null}},"id":7}'
2024-05-24 19:16:04.108 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [135542308401216] Sven from 192.168.0.* (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0): Client unable to keep up with pending messages. Reached 4096 pending messages. The system's load is too high or an integration is misbehaving; Last message was: b'{"type":"event","event":{"event_type":"service_registered","data":{"domain":"chime_tts","service":"say_url"},"origin":"LOCAL","time_fired":"2024-05-24T17:16:04.108157+00:00","context":{"id":"01HYNSMG4CFK62YW2CRDSJ92V9","parent_id":null,"user_id":null}},"id":16}'
davidjmeier commented 6 months ago

Running into this as I was attempting to install and configure Chime. Is there a different way to try configuration? I'm trying to implement tts.piper. Thank you!

konyee commented 6 months ago

I have same issue, after clicking save button home assistant freeze. I viewed logs and found this endless loop. Last 1500 lines are the same. Meanwhile system load goes above 5.0 (on 2 cores).

2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.365 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.370 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.370 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.370 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.371 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.372 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-05-28 18:03:22.373 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
nimroddolev commented 6 months ago

Thank you al for reporting the issue. I have released a new beta release, v1.1.0-beta7, which hopefully addresses it. I'd appreciate it if you could please upgrade to the new version and let me know if the issue is resolved.

To install the new beta version:

  1. Open the Chime TTS repository in HACS
  2. Click on the button in the top right
  3. Select the ↻ Redownload option
  4. Enable the Show beta versions option (it may take a moment to update the list)
  5. Select version v1.1.0-beta7 from the updated version drop-down list
  6. Restart Home Assistant
sven-pb commented 6 months ago

First of all, thank you for your effort. It's highly appreciated!

I confirm that this issue is resolved for me, however now I have an issue with my Symfonisk Speaker (Sonos). I'll give the details in issue #121

gigawebs commented 6 months ago

Thank you, fixed it for me too!

donburch888 commented 6 months ago

I have rebooted after installing beta7, and still have a couple of warnings in the log:

Logger: homeassistant.util.loop
Source: util/loop.py:70
First occurred: 8:32:56 am (1 occurrences)
Last logged: 8:32:56 am

Detected blocking call to import_module with args ('custom_components.chime_tts',) in /usr/src/homeassistant/homeassistant/loader.py, line 1046: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop

and

Logger: py.warnings
Source: runner.py:190
First occurred: 8:32:56 am (1 occurrences)
Last logged: 8:32:56 am

/usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited handle = None # Needed to break cycles when an exception occurs.

Otherwise, so far so good :-) Able to save configuration.

davidjmeier commented 5 months ago

Thanks much @nimroddolev! Just testing v1.1.0-beta8 this evening and everything seems to be working as expected. Much appreciated! 👍

nimroddolev commented 5 months ago

The fix has been included in the latest stable release, v1.1.0.