Skip to content
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

called Result::unwrap() on an Err value: InitSeccompContext #1

Closed
rcambrj opened this issue Jan 21, 2025 · 10 comments
Closed

called Result::unwrap() on an Err value: InitSeccompContext #1

rcambrj opened this issue Jan 21, 2025 · 10 comments

Comments

@rcambrj
Copy link
Owner

rcambrj commented Jan 21, 2025

This error was first spotted in bicipi's github actions. I assume that this error also happens in this repo's github actions, as I sincerely doubt that it's anything specific to bicipi, though I've yet to test it.

Cannot upgrade nixpkgs beyond 7cf092925906d588daabc696d663c100f2bbacc6 due to:

nixos-disk-image> [    1.869078] EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: . Quota mode: disabled.
nixos-disk-image> [    9.515547] random: crng init done
nixos-disk-image> [   65.064390] reboot: Restarting system
nixos-disk-image> thread 'main' panicked at src/main.rs:829:54:
nixos-disk-image> called `Result::unwrap()` on an `Err` value: InitSeccompContext
nixos-disk-image> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
nixos-disk-image> thread 'main' panicked at src/main.rs:829:54:
nixos-disk-image> called `Result::unwrap()` on an `Err` value: InitSeccompContext
nixos-disk-image> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
nixos-disk-image> qemu-system-aarch64: -chardev socket,id=store,path=virtio-store.sock: Failed to connect to 'virtio-store.sock': No such file or directory

...which only occurs in the github runners (local builds still succeed).

Raised on the offending nixpkgs pull request, will investigate @Mic92's suggestion.

@Mic92
Copy link

Mic92 commented Jan 21, 2025

Potentially you should try to disable sandboxing in virtiofsd in runInLinuxVM. It's a GitHub runner restriction from the looks of it. NixOS is fine with it.

@rcambrj
Copy link
Owner Author

rcambrj commented Jan 21, 2025

Appreciate the further tips @Mic92! I'll find some time to investigate this properly.

I tried bringing up virtiofsd inside the github runner with virtiofsd --xattr --socket-path virtio-store.sock --sandbox none --shared-dir testdir and that succeeded, so I suspect that the failure might happen a bit later, perhaps when something tries to read/write. But let me do some more digging and I'll come back with some useful data.

@Mic92
Copy link

Mic92 commented Jan 21, 2025

@rcambrj
Copy link
Owner Author

rcambrj commented Jan 22, 2025

fixed in NixOS/nixpkgs#375792, waiting for https://nixpk.gs/pr-tracker.html?pr=375792

thanks again @Mic92

@rcambrj
Copy link
Owner Author

rcambrj commented Jan 23, 2025

This is resolved, but latest nixpkgs is broken for another reason (#2). Closing

@rcambrj rcambrj closed this as completed Jan 23, 2025
@kibiz0r
Copy link

kibiz0r commented Jan 23, 2025

FWIW, I just ran into this on a local machine.

Trying to apply the patterns in: NixOS/nixos-hardware#1329
...to a Retroid Pocket 5

[kibiyama@nixos:~/git/build-an-sd-image]$ nix build .#nixosConfigurations.retroidPocket5.config.system.build.diskoImages --show-trace --print-build-logs
retroid-disko-images> Formatting '/nix/store/1lmgc38in1gzva8z54l2c7fv88pxxv3f-retroid-disko-images/main.raw', fmt=raw size=2147483648
retroid-disko-images> qemu-system-aarch64: -chardev socket,id=store,path=virtio-store.sock: Failed to connect to 'virtio-store.sock': No such file or directory
retroid-disko-images> thread 'main' panicked at src/main.rs:829:54:
retroid-disko-images> called `Result::unwrap()` on an `Err` value: InitSeccompContext
retroid-disko-images> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
retroid-disko-images> thread 'main' panicked at src/main.rs:829:54:
retroid-disko-images> called `Result::unwrap()` on an `Err` value: InitSeccompContext
retroid-disko-images> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: builder for '/nix/store/gasg9m1m1j8jr6g9jz9xxsfb2yk6368l-retroid-disko-images.drv' failed with exit code 1;
       last 8 log lines:
       > Formatting '/nix/store/1lmgc38in1gzva8z54l2c7fv88pxxv3f-retroid-disko-images/main.raw', fmt=raw size=2147483648
       > qemu-system-aarch64: -chardev socket,id=store,path=virtio-store.sock: Failed to connect to 'virtio-store.sock': No such file or directory
       > thread 'main' panicked at src/main.rs:829:54:
       > called `Result::unwrap()` on an `Err` value: InitSeccompContext
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       > thread 'main' panicked at src/main.rs:829:54:
       > called `Result::unwrap()` on an `Err` value: InitSeccompContext
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       For full logs, run 'nix log /nix/store/gasg9m1m1j8jr6g9jz9xxsfb2yk6368l-retroid-disko-images.drv'.

@rcambrj
Copy link
Owner Author

rcambrj commented Jan 23, 2025

@kibiz0r good to know.

Does NixOS/nixpkgs#375792 solve the problem for you?

@kibiz0r
Copy link

kibiz0r commented Jan 23, 2025

@rcambrj Yep, that got me past it. Thanks for fixing that!

@rcambrj
Copy link
Owner Author

rcambrj commented Jan 23, 2025

Wish I could take the credit. I was still stumbling around trying to reproduce the problem by the time Mic92 had fixed it.

@kibiz0r
Copy link

kibiz0r commented Jan 23, 2025

Oh, big thanks to @Mic92 as well then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants