peribeir / homeassistant-rademacher

This custom integration provides access to Rademacher Devices connected to a HomePilot (or Start2Smart) bridge.
GNU General Public License v3.0
56 stars 11 forks source link

Rademacher component blocks shutdown/restart #37

Closed michelde closed 2 years ago

michelde commented 2 years ago

Hi,

I just saw this information in my HA logs, so I wanted to report it, maybe it's worth to follow up. Otherwise, just close the issue.

My Home Assistant setup:

arch: aarch64
channel: stable
docker: 20.10.9
hassos: "7.4"
homeassistant: 2022.2.9
hostname: hassio
logging: info
machine: raspberrypi4-64
operating_system: Home Assistant OS 7.4
supervisor: 2022.01.1
supported: true
supported_arch:
- aarch64
- armv7
- armhf
timezone: Europe/Berlin

Here the log entries which I'm wondering about when restarting:

2022-02-28 08:14:36 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_16] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 77, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homematic/entity.py", line 268, in _update_variables
    variables = self._homematic.getAllSystemVariables(self._name)
  File "/usr/local/lib/python3.9/site-packages/pyhomematic/connection.py", line 117, in getAllSystemVariables
    return self._server.getAllSystemVariables(remote)
  File "/usr/local/lib/python3.9/site-packages/pyhomematic/_hm.py", line 793, in getAllSystemVariables
    session = self.jsonRpcLogin(remote)
  File "/usr/local/lib/python3.9/site-packages/pyhomematic/_hm.py", line 760, in jsonRpcLogin
    response = self._rpcfunctions.jsonRpcPost(
  File "/usr/local/lib/python3.9/site-packages/pyhomematic/_hm.py", line 382, in jsonRpcPost
    resp = urllib.request.urlopen(req, context=ctx)
  File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.9/urllib/request.py", line 1375, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.9/urllib/request.py", line 1350, in do_open
    r = h.getresponse()
  File "/usr/local/lib/python3.9/http/client.py", line 1371, in getresponse
    response.begin()
  File "/usr/local/lib/python3.9/http/client.py", line 319, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.9/http/client.py", line 280, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)

Also I see this in the log when restarting HA:

2022-02-28 08:33:59 WARNING (MainThread) [homeassistant.core] Something is blocking Home Assistant from wrapping up the start up phase. We're going to continue anyway. Please report the following info at https://github.com/home-assistant/core/issues: rademacher, energy, stream, analytics, media_player, binary_sensor.rademacher, sensor.mobile_app, sensor.rademacher, network, sensor.mqtt, template, input_boolean, homematic, switch.tasmota, input_number, logbook, influxdb, camera.foscam, switch.fritzbox, person, fritzbox, sensor, group, foscam, map, telegram_bot, blueprint, ssdp, timer, recorder, mqtt, homeassistant, climate, sensor.utility_meter, notify.telegram, utility_meter, device_tracker.mobile_app, switch.rademacher, diagnostics, button.rademacher, sensor.hacs, onboarding, media_player.onkyo, system_log, http, webrtc, lovelace, binary_sensor.hassio, sensor.ios, notify, input_button, device_automation, button, fan.tasmota, input_text, webhook, weather.met, sun, script, updater, ipp, sensor.fritzbox, binary_sensor.mobile_app, cover.tasmota, tts.google_translate, notify.ios, sensor.tasmota, dhcp, usb, met, image, api, light, zone, mobile_app, persistent_notification, switch.esphome, rest, notify.mobile_app, sensor.esphome, light.fritzbox, tag, input_select, system_health, sensor.rest, tasmota, history, binary_sensor.esphome, sensor.ipp, climate.rademacher, cover, device_tracker, input_datetime, light.tasmota, search, counter, fan, ios, switch.mqtt, default_config, camera, binary_sensor, media_source, sensor.energy, frontend, config, websocket_api, cloud, hassio, esphome, climate.fritzbox, camera.generic, auth, automation, tts, sensor.template, scene.homeassistant, scene, sensor.hassio, binary_sensor.fritzbox, trace, weather, binary_sensor.tasmota, rest_command, my, zeroconf, cover.rademacher, hacs, switch, binary_sensor.updater

Regards, Michel

peribeir commented 2 years ago

Hi Michel

Thanks for reporting that, but I'm not so sure that this component is the reason for the exception you are showing.

In the stack you see that it's coming from "homematic" component (pyhomematic library).

It's true that the log from HA shows rademacher in the first place, but I believe that this doesn't mean it is the cause. I think this log is only showing everything that was still running at the time, and you can see the "homematic" is also referenced in this message.

Do you see any other reason to think this might be related to the Rademacher integration?

BR, Pedro.

michelde commented 2 years ago

Hi Pedro,

probably you're right. It was a failure on my side. I also experienced issues with the new homematic version. So, I would probably think the issue is originating from this component. Thanks for your work and the integration!