nixos-facter
nixos-facter copied to clipboard
Error: failed to scan
2025/05/07 17:06:40 failed to scan: failed to scan hardware: failed to fetch udev data for device "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.3/1-6.3:1.0/0003:1532:0114.0002/input/input4" with udev data: failed to parse usb: failed to parse model id: strconv.ParseUint: parsing "": invalid syntax
The device is an old keyboard.
Please let me know what other information you need. Thank you for your work.
I think you're seeing the same issue as here: https://github.com/nix-community/nixos-facter/issues/184.
If I'm right, it's an old udev version. I just created https://github.com/nix-community/nixos-facter/releases/tag/v0.4.0 and bumped nixos-facter in nixpkgs https://nixpkgs-tracker.ocfox.me/?pr=406460.
It contains a minimal udev check and some better error messaging.
Thank you, I'll try as soon as possible and report back. Won't close the issue for now
Have I referenced it correctly? @brianmcgee
> sudo $(which nix) --extra-experimental-features "flakes nix-command" run github:nix-community/nixos-facter/v0.4.0 -- --log-level debug -o facter.json
2025/05/14 19:59:13 facter.go:67: DEBUG building report system=x86_64-linux version=1
2025/05/14 19:59:13 facter.go:74: DEBUG scanning hardware features="[memory pci net serial cpu bios monitor scsi usb prom sbus sys sysfs udev block wlan]"
2025/05/14 19:59:13 root.go:140: failed to scan: failed to scan hardware: failed to fetch udev data for device "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.3/1-6.3:1.0/0003:1532:0114.0002/input/input4" with udev data: failed to parse usb: failed to parse model id: strconv.ParseUint: parsing "": invalid syntax
Can confirm similar behaviour as above on determinate nix installed hetzner box ccx33 running ubuntu22.04
curl -fsSL https://install.determinate.systems/nix | sh -s -- install --no-confirm && \
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \
nix run \
--option experimental-features "nix-command flakes" \
--option extra-substituters https://numtide.cachix.org \
--option extra-trusted-public-keys numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE= \
github:numtide/nixos-facter/v0.4.0 -- -o /tmp/facter.json && \
Have I referenced it correctly? @brianmcgee
sudo $(which nix) --extra-experimental-features "flakes nix-command" run github:nix-community/nixos-facter/v0.4.0 -- --log-level debug -o facter.json 2025/05/14 19:59:13 facter.go:67: DEBUG building report system=x86_64-linux version=1 2025/05/14 19:59:13 facter.go:74: DEBUG scanning hardware features="[memory pci net serial cpu bios monitor scsi usb prom sbus sys sysfs udev block wlan]" 2025/05/14 19:59:13 root.go:140: failed to scan: failed to scan hardware: failed to fetch udev data for device "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.3/1-6.3:1.0/0003:1532:0114.0002/input/input4" with udev data: failed to parse usb: failed to parse model id: strconv.ParseUint: parsing "": invalid syntax
It looks correct.
Can you share the output of udevadm --version and the contents of /run/udev/data/+input:input4?
> udevadm --version
249
> cat /run/udev/data/+input:input4
I:6463198
E:ID_INPUT=1
E:ID_INPUT_MOUSE=1
E:ID_VENDOR=Razer
E:ID_VENDOR_ENC=Razer
E:ID_VENDOR_ID=1532
E:ID_MODEL=DeathStalker_Ultimate
E:ID_MODEL_ENC=DeathStalker\x20Ultimate
E:ID_MODEL_ID=0114
E:ID_REVISION=0100
E:ID_SERIAL=Razer_DeathStalker_Ultimate
E:ID_TYPE=hid
E:ID_BUS=usb
E:ID_USB_INTERFACES=:030102:000000:030001:030101:fff000:
E:ID_USB_INTERFACE_NUM=00
E:ID_USB_DRIVER=usbhid
E:ID_PATH=pci-0000:00:14.0-usb-0:6.3:1.0
E:ID_PATH_TAG=pci-0000_00_14_0-usb-0_6_3_1_0
E:ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_6_3_1_0
G:seat
Q:seat
V:1
Ok, there's the issue. We need a udev version of at least 252:
// check udev version
if udevVersion, err := udev.Version(); err != nil {
log.Fatalf("failed to get systemd version: %v", err)
} else if udevVersion < 252 {
log.Fatalf("udev version %d is too old, please upgrade to at least 252", udevVersion)
}
That check is in 0.4.0, I don't know how it's not catching your udev version. The command you shared above for running 0.4.0 looks correct. 🤷