NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.19k stars 14.2k forks source link

guestmount fails due to mismatched appliance #280881

Closed jchv closed 4 weeks ago

jchv commented 10 months ago

Describe the bug

The current version of libguestfs in nixpkgs is 1.50.1 at the time of writing. However, the current version of the libguestfs appliance in nixpkgs is currently 1.46.0. This causes somewhat confusing errors in guestmount that are only visible when using --no-fork --verbose:

guestfsd: error: dispatch_incoming_message: unknown procedure number 511, set LIBGUESTFS_PATH to point to the matching libguestfs appliance directory

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix shell nixpkgs\#libguestfs-with-appliance -c guestmount -a $DISKIMAGE -m $DEVICE $MOUNTPOINT --ro --no-fork --verbose
  2. ls $MOUNTPOINT
  3. The ls will fail with invalid argument, while errors about unknown procedures will appear in the verbose log.

Expected behavior

The mountpoint should be accessible and functional.

Additional context

The problem exists here because libguestfs-appliance is supposed to match libguestfs, but NixOS does not currently build the libguestfs-appliance, instead downloading the binary directly. Unfortunately, it looks like new libguestfs-appliance binaries are no longer being posted (?), so now the nixpkgs version of libguestfs has become quite newer than the version of libguestfs-appliance.

@minijackson seems to have been recently working on making libguestfs-appliance build inside nixpkgs rather than pulling external binaries in #278954, which would resolve this issue the proper way. However, I wanted to raise this issue because I don't really know if it's obvious enough that libguestfs and libguestfs-appliance need to be the same version. Right now it's possibly preferable to allow them to desync because otherwise libguestfs would be stuck on an old version and not all utilities in libguestfs are broken by this; however, libguestfs-with-appliance is effectively broken right now due to this mismatch. Once it's possible, it would be nice to ensure that these two derivations are always kept in sync.

If I use an overlay to revert back to libguestfs 1.46, everything works as expected again.

Notify maintainers

@offlinehacker

Recent contributors as well, for visibility... @r-vdp @wegank


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

panchoh commented 2 months ago

Unfortunately, it looks like new libguestfs-appliance binaries are no longer being posted (?),

They seem to have published one recently, after almost three years. It's for the development version (1.53), though.

jchv commented 2 months ago

So right now, I'm still patching my local libguestfs to 1.46.0 for now, but I think I'll give up on it: I don't think I have time to commit to fixing the issue with building the guestfs appliance myself, and even if I did dedicate that time I certainly can't dedicate time to maintaining the build for it, and it doesn't seem like many other people have time and are interested.

Instead, I think I'll stick with qemu-nbd as a means to mount virtual disk images. This is a pretty different approach from using guestfs but it works for me.

It would be great to cross this issue off sometime if anyone does have the desire and drive to do so.