pnbruckner / ha-composite-tracker

Home Assistant Composite Device Tracker
The Unlicense
133 stars 11 forks source link

Composite Integration Won't Start #50

Closed CharlesSaint007 closed 11 months ago

CharlesSaint007 commented 1 year ago

The latest 2.8.3 timezone fixes do not correct the issue. This was a yaml configuration that has worked without issue/change for at least six months and broke within the last few weeks with one of the HA updates (not sure which). An update to the latest version of the composite tracker (2.8.3 as of this writing) and a reboot did not fix the issue. The integration hangs on startup and never loads.

image image image image
matteusz88 commented 1 year ago

Same here. Following for solution.

pnbruckner commented 1 year ago

Can you share details from the log?

CharlesSaint007 commented 1 year ago

`Logger: homeassistant.setup Source: setup.py:290 First occurred: 3:09:41 PM (1 occurrences) Last logged: 3:09:41 PM

Setup of composite is taking longer than 300 seconds. Startup will proceed without waiting any longer`

`Logger: homeassistant.util.package Source: util/package.py:107 First occurred: 3:06:33 PM (3 occurrences) Last logged: 3:10:05 PM

Unable to install package timezonefinder==6.2.0: error: subprocess-exited-with-error × Building wheel for h3 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [11 lines of output] Traceback (most recent call last): File "/tmp/pip-build-env-fi9nwej0/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 645, in setup cmkr = cmaker.CMaker(cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-fi9nwej0/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 148, in init self.cmake_version = get_cmake_version(self.cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-fi9nwej0/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version raise SKBuildError(msg) from err Problem with the CMake installation, aborting build. CMake executable is /tmp/pip-build-env-fi9nwej0/overlay/lib/python3.11/site-packages/cmake/data/bin/cmake [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for h3 ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects [notice] A new release of pip is available: 23.1.2 -> 23.2 [notice] To update, run: pip install --upgrade pip Unable to install package timezonefinder==6.2.0: error: subprocess-exited-with-error × Building wheel for h3 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [11 lines of output] Traceback (most recent call last): File "/tmp/pip-build-env-twtetcj2/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 645, in setup cmkr = cmaker.CMaker(cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-twtetcj2/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 148, in init self.cmake_version = get_cmake_version(self.cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-twtetcj2/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version raise SKBuildError(msg) from err Problem with the CMake installation, aborting build. CMake executable is /tmp/pip-build-env-twtetcj2/overlay/lib/python3.11/site-packages/cmake/data/bin/cmake [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for h3 ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects [notice] A new release of pip is available: 23.1.2 -> 23.2 [notice] To update, run: pip install --upgrade pip Unable to install package timezonefinder==6.2.0: error: subprocess-exited-with-error × Building wheel for h3 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [11 lines of output] Traceback (most recent call last): File "/tmp/pip-build-env-w_3eds7o/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 645, in setup cmkr = cmaker.CMaker(cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-w_3eds7o/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 148, in init self.cmake_version = get_cmake_version(self.cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-w_3eds7o/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version raise SKBuildError(msg) from err Problem with the CMake installation, aborting build. CMake executable is /tmp/pip-build-env-w_3eds7o/overlay/lib/python3.11/site-packages/cmake/data/bin/cmake [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for h3 ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects [notice] A new release of pip is available: 23.1.2 -> 23.2 [notice] To update, run: pip install --upgrade pip`

image image
pnbruckner commented 1 year ago

I've also seen that error reported here: https://community.home-assistant.io/t/composite-device-tracker-platform/67345/483. Unfortunately, I don't know what is causing it. I don't see it when I'm running the exact same versions.

This integration uses a non-standard way to install that pypi.org package (controlled via the tz_finder config option.) It's a long story. It's worked for a long time but doesn't seem to work reliably anymore. I think I need to get rid of the tz_finder option, remove the code that tries to install the package accordingly, and just put timezonefinder==6.2.0 in the manifest.json file instead (so HA can deal with the installation.)

I'll work on that change and release a beta version to try, hopefully by sometime tomorrow.

pnbruckner commented 1 year ago

BTW, a temporary work around is to not use device_or_utc or device_or_local for time_as. You'll lose the time zone determination, but it will no longer try to install the timezonefinder package and the integration should be able to start.

pnbruckner commented 1 year ago

@CharlesSaint007 @matteusz88 what is the hardware platform on which you are running HA? And are you both using the HA OS install config?

matteusz88 commented 1 year ago

BTW, a temporary work around is to not use device_or_utc or device_or_local for time_as. You'll lose the time zone determination, but it will no longer try to install the timezonefinder package and the integration should be able to start.

That doesn't seem to work for me 🤷🏻‍♂️

Raspberry Pi 3, with manual install. Has worked great up until the last week or so. Can't quite narrow down when exactly it stopped.

pnbruckner commented 1 year ago

@matteusz88 thanks!

I'm beginning to wonder if the packages that timezonefinder uses (e.g., h3) won't build correctly on ARM processors (like the RPi.)

By manual install, do you mean you create a Python venv and install using pip? If so, that's great. It will be a lot easier for you to test things if you're willing. Let me know.

At a minimum, could you share your composite config?

pnbruckner commented 1 year ago

Another possible work around / fix might be to use timezonefinder v5.2.0 instead of v6.2.0. To give this a try, add the following to your composite config:

composite:
  tz_finder: timezonefinder==5.2.0
  tz_finder_class: TimezoneFinderL

The reason is that it looks like timezonefinder significantly changed its build environment and started using h3 in version 6.x, so going back to the previous version (5.2.0) might allow it to work correctly on ARM based systems.

pnbruckner commented 1 year ago

Raspberry Pi 3, with manual install. Has worked great up until the last week or so. Can't quite narrow down when exactly it stopped.

I'm pretty sure it stopped working sometime on or after July 7, 2023, when the importlib-resources package (that timezonefinderL uses) changed such that it broke timezonefinderL.

timezonefinderL v4.0.2 used to be the default package used by this integration to convert GPS coordinates to a time zone. It now defaults to timezonefinder (without the "L" suffix) v6.2.0, which seems to work on some systems, but not others.

Ultimately, I think I need to determine which version of timezonefinder to use that works on (hopefully) all systems.

CharlesSaint007 commented 1 year ago

@CharlesSaint007 @matteusz88 what is the hardware platform on which you are running HA? And are you both using the HA OS install config?

@pnbruckner I'm using the HA OS on a RPi 4B with stock configuration. So I'm not running anything really custom in terms of my setup. I only use HACS to get device integration from Hubitat and for Composite.

CharlesSaint007 commented 1 year ago
  tz_finder: timezonefinder==5.2.0
  tz_finder_class: TimezoneFinderL

@pnbruckner By the way, I was able to get everything working again by adding these parameters to my config. So at least it works for me for now.

pnbruckner commented 1 year ago

@CharlesSaint007 thanks!

That's another data point that says timezonefinder 6.2.0 (and its requirements) don't work on ARM.

That's great that timezonefinder 5.2.0 works. I think I'll drop the idea of removing the tz_finder config option, and just change the default again, but to 5.2.0. Hopefully that 1) solves the issues, and 2) leave flexibility for the future in case something else like this comes up.

pnbruckner commented 11 months ago

Default timezonefinder version changed in release 2.8.4,