home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

SMTP service cannot work on 2024.5.0/2024.5.1 #116745

Closed lyfqdl closed 2 weeks ago

lyfqdl commented 2 weeks ago

The problem

Error setting up platform smtp

What version of Home Assistant Core has the issue?

2024.5.0

What was the last working version of Home Assistant Core?

2024.4.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

smtp

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

日志: homeassistant.components.notify
来源: components/notify/legacy.py:104
集成: 通知 (文档, 问题)
首次发生: 上午10:19:06 (1 全部发生)
上次记录: 上午10:19:06

Error setting up platform smtp
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 104, in async_setup_platform
    notify_service = await hass.async_add_executor_job(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smtp/notify.py", line 25, in get_service
    return SmtpNotificationService(hass, discovery_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smtp/notify.py", line 35, in __init__
    hass.services.async_register(DOMAIN, 'notify', self.qm.notify)
  File "/usr/src/homeassistant/homeassistant/core.py", line 2522, in async_register
    self._hass.verify_event_loop_thread("async_register")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'smtp' calls async_register from a thread at custom_components/smtp/notify.py, line 35: hass.services.async_register(DOMAIN, 'notify', self.qm.notify). Please report it to the author of the 'smtp' custom integration.

Additional information

No response

home-assistant[bot] commented 2 weeks ago

smtp documentation smtp source

bdraco commented 2 weeks ago

You are running a custom version of smtp. Please remove the custom component custom_components/smtp

lyfqdl commented 2 weeks ago

The problem has been resolved. After deleting the custom version of SMTP, I reconfigured SMTP in configuration.yaml