NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.69k stars 13.14k forks source link

home-assistant extraComponents "starlink" fails at runtime because of missing "starlink_grpc" dependency #310129

Open zoechi opened 2 months ago

zoechi commented 2 months ago

Describe the bug

A clear and concise description of what the bug is.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure home-assistant

    services = {
    home-assistant = {
      enable = true;
      openFirewall = true;
      configWritable = true;
      config = {
        default_config = {};
    
        http = {
          server_host = [
            "192.168.0.1"
          ];
        };
      };
    
      extraPackages =
        python3Packages:
          with python3Packages; [
          ];
    
      extraComponents = [
        "starlink"
      ];
    };
    };
  2. nixos-rebuild
  3. check home-assistant logs
    Setup failed for 'starlink': Unable to import component: No module named 'starlink_grpc'
    Traceback (most recent call last):
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/setup.py", line 322, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/loader.py", line 996, in async_get_component
    self._component_future.result()
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/loader.py", line 976, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/aav6i2sih47qjwz0shpl4mmpp877v16k-python3-3.12.3/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/loader.py", line 1036, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/util/loop.py", line 144, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/aav6i2sih47qjwz0shpl4mmpp877v16k-python3-3.12.3/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 995, in exec_module
    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/components/starlink/__init__.py", line 10, in <module>
    from .coordinator import StarlinkUpdateCoordinator
    File "/nix/store/xmd4wgr1imr96431h81ral37v5aqxkq8-homeassistant-2024.5.0/lib/python3.12/site-packages/homeassistant/components/starlink/coordinator.py", line 11, in <module>
    from starlink_grpc import (
    ModuleNotFoundError: No module named 'starlink_grpc'

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-shell -p nix-info --run "nix-info -m"
/nix/store/558iw5j1bk7z6wrg8cp96q2rx03jqj1v-stdenv-linux/setup: line 114: sopsImportKeysHook: command not found
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.30, NixOS, 24.05 (Uakari), 24.05.20240505.25865a4`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/3pif36ks3f56py4wb1dkq6sh0nkf3ygj-source`

Add a :+1: reaction to issues you find important.

qbit commented 2 months ago

I was planning on submitting this, but haven't had time to clean it up for inclusion. If anyone wants to run with it, feel free!