NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.88k stars 13.94k forks source link

asusctl: Unknown interface 'org.asuslinux.Platform, possibly mismatching version of asusd service #316538

Closed TheGoudaMan closed 4 months ago

TheGoudaMan commented 4 months ago

Describe the bug

After installing asusctl in systemPackages with unstable (v6.0.9) and enabling asusd service on my ROG Zephyrus G16 GU605MI, following error occurs upon running asusctl:

thread 'main' panicked at asusctl/src/main.rs:61:54:
called `Result::unwrap()` on an `Err` value: MethodError(OwnedErrorName("org.freedesktop.DBus.Error.UnknownInterface"),
Some("Unknown interface 'org.asuslinux.Platform'"), 
Msg { type: Error, serial: 9, sender: UniqueName(":1.159"), reply-serial: 5, body: Signature("s"), fds: [] })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add systemctl unstable to systemPackages
  2. enable services.asusd.enable, services.asusd.enableUserService
  3. rebuild, reboot - start asusd
  4. run asusctl - error occurs

Expected behavior

asusctl working properly

Additional context

If I'm not mistaken, it seems to me it has to deal with asusd service version. When I run "systemctl status asusd" I get following output:

asusd.service - ASUS Notebook Control
     Loaded: loaded (/etc/systemd/system/asusd.service; linked; preset: enable>
     Active: active (running) since Sat 2024-06-01 19:16:34 EDT; 4min 27s ago
    Process: 7952 ExecStartPre=/nix/store/pxf98n8dsxb6kmm0pdvc3dr3gzcqhizi-cor>
   Main PID: 7954 (asusd)
         IP: 0B in, 0B out
         IO: 13.3M read, 8.0K written
      Tasks: 28 (limit: 37993)
     Memory: 10.4M
        CPU: 229ms
     CGroup: /system.slice/asusd.service
             └─7954 /nix/store/chagnplicbmiz40dipfcv35crbj256y8-asusctl-4.7.1/>

In control group it relies on asusctl-4.7.1 - which seems incorrect and very old version. When I check version of asusctl and asusd package that comes with it I get:

 ls -l $(which asusctl)
lrwxrwxrwx 1 root root 69 Dec 31  1969 /run/current-system/sw/bin/asusctl -> /nix/store/j9xl40s15q7lhx1kv8yd2f77b9j20046-asusctl-6.0.9/bin/asusctl
ls -l $(which asusd)
lrwxrwxrwx 1 root root 67 Dec 31  1969 /run/current-system/sw/bin/asusd -> /nix/store/j9xl40s15q7lhx1kv8yd2f77b9j20046-asusctl-6.0.9/bin/asusd

Which shows v6.0.9 and looks correct. Without enabling asusd service asusctl won't work, so I tried to fix it multiple times by tweaking asusd service and failed (most likely due to lack of experience), trying stuff like this: https://nixos.org/manual/nixos/unstable/#sec-replace-modules

Overall, this version mismatch behavior seems wrong unless I'm not aware of something. Is there something I can do to resolve this? Thanks.

Is there something I can do to fix it? Thanks in advance.

Notify maintainers

@K900 @aacebedo

Metadata

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

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.3, NixOS, 23.11 (Tapir), 23.11.7454.25cf937a30bf`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11, nixpkgs-unstable, unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

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

K900 commented 4 months ago

You need to set services.asusd.package = pkgsUnstable.asusctl or something like that.

TheGoudaMan commented 4 months ago

I got this issue resolved - apparently channel version 24.05 got released just after a day I installed nixos, which was unexpected, and system was using asusd from 23.11 channel which didn't had a "package" attribute and it got me really confused.

If by chance someone facing same issue I described above - make sure you're using at least channel v24.05