-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading screen hangs on NixOS #1362
Comments
Hi there! @ert78gb Any ideas? |
@adc17 Sorry for the late reaction. Please do the following steps and after send me the logs. The logs maybe contains personal information so you can send to me directly.
@pshirshov AppImage is also a self-contained solution. I think it is a USB communication issue. |
hi @ert78gb no problem, I checked those logs and this error appears a few times, is it helpful?
|
Please send the whole file. I need other information too because it looks like the udev rules did not apply. If the OS is Linux then the Agent should show the "Permission" screen that set or give an introduction to set the udev rule. I tested what is the return value of the |
FYI. I used the following commands to query the os platform.
|
A permission issue probably. And FlatPak should take care of that. |
@ert78gb here's the whole file having followed your instructions: https://gist.github.com/adc17/a879bfc264d9c257de8bff312f00b8ef
I did see this screen the first time round, but I don't see it anymore. |
I unplugged my uhk while agent was running which got the permissions screen back; here are the logs from that session: https://gist.github.com/adc17/ccbc67ecd4b7c57bd1981555c6f09148 |
@adc17 Until # Ultimate Hacking Keyboard rules
# These are the udev rules for accessing the USB interfaces of the UHK as non-root users.
# Copy this file to /etc/udev/rules.d and physically reconnect the UHK afterwards.
SUBSYSTEM=="input", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", GROUP="input", MODE="0660"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"
KERNEL=="hidraw*", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess" @mondalaci Agent wasn't able to set up permissions via PolicyKit. This is most likely because the <code>polkit</code> package is not installed on your system. Maybe worth write the error message too, to see the root cause. |
I just know see in the opening comment you set the udev rules manually without luck. Please double check the content of the |
Hmm, so I'm pretty new to it, but I believe what nixos does is create a shell (sandbox) environment for running different programs like this to keep dependencies separate. The mostly likely explanation for me is the environment created by @ert78gb I'm interested in these lines from the logs:
It suggests this check is creating a false negative: agent/packages/uhk-usb/src/uhk-hid-device.ts Lines 353 to 355 in a066854
I think I'll need to take a closer look at how app-images are run on nixos before I can help debug this. |
thx for any investigation and help. Currently I don't have time to be familiar with NixOS, how it is separate the context of each shell/application. Maybe after the next week I can spend time on it. The referenced code block returns false if the application context does not have access to the file. |
The |
@ert78gb I think you can leave this one with me ;), I suspect the necessary PR will actually be against the |
@ert78gb it looks like the nix approach to running these builds is to create a chroot environment that mimics a typical distro and include a bunch of typical system libs/binaries in that environment, then run the executable in that context. I've not used agent/packages/uhk-usb/src/uhk-hid-device.ts Lines 353 to 355 in a066854
So it might be that the USB communication is fine, but agent doesn't load because it can't find the udev files and it assumes there's a problem? |
I am talking with @mondalaci about this special use case. |
@ert78gb Nice, it loads now! 🚀. |
I wonder if this could just be packaged for nix, I see this approach used for other appimage builds. I'm only hesitating as I'm not sure how easy it would be to update udev rules as part of the build. |
@adc17 Please let us know which is the innermost directory of /etc/udev/rules.d/50-uhk60.rules which exists in the chroot cage of NixOS. |
@mondalaci I'm not sure how I'd confirm this but I believe it is built here, in which case it looks like |
@adc17 Can't you simply run bash in the same environment you run Agent? If so, it should be a matter of using |
@mondalaci I ran the |
This should be resolved by #1367 and the fix was released in Agent 1.5.5. |
In case someone stumbles about this. { appimageTools, lib, fetchurl, makeWrapper, polkit }:
# It is necessary to add this package to
# services.udev.packages = with pkgs; [
# uhk-agent
# ];
# for the udev rules to be activated
let
pname = "uhk-agent";
version = "1.5.8";
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v${version}/UHK.Agent-${version}-linux-x86_64.AppImage";
name = "${name}.AppImage";
sha256 = "sha256-8VPTw/gNlsl+QneKxlotsYH3wGSPPpepEkRVbitrJI0=";
};
appimageContents = appimageTools.extract {
name = "${pname}-${version}";
inherit src;
};
in appimageTools.wrapType2 {
inherit src name;
extraPkgs = pkgs: with pkgs; [ polkit udev ];
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
# user needs to be in the input group!
install -D -m 644 ${appimageContents}/resources/rules/50-uhk60.rules $out/lib/udev/rules.d/50-uhk60.rules
'';
meta = with lib; {
description = "Agent is the configuration application of the Ultimate Hacking Keyboard.";
homepage = "https://github.com/UltimateHackingKeyboard/agent";
license = licenses.mit;
maintainers = [ ];
platforms = [ "x86_64-linux" ];
};
} |
Hi, I'm trying to run the
AppImage
build of agent for linux, but the loading screen hangs when I execute the file:In the console, I see this output:
I have added the above lines to /etc/udev/rules.d/50-uhk60.rules and rebooted without any luck. My guess is this is related to my operating system,
NixOS 20.03 (Markhor) x86_64
; among other things it requires a package to run AppImages.Is there a way of generating a more detailed stack trace so I can debug?
The text was updated successfully, but these errors were encountered: