This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 747287 - Misleading error message when permission denied opening a disk image
Misleading error message when permission denied opening a disk image
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-19 07:19 EDT by Richard W.M. Jones
Modified: 2011-10-21 11:31 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-21 11:31:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2011-10-19 07:19:59 EDT
Description of problem:

When you try to add a disk image which is read-only, qemu
fails to start up and qemu correctly prints an error message.
However the error message is eaten by libguestfs, and instead
we see this error:

  $ guestfish -a test1.img run : list-devices
  libguestfs: error: unexpected end of file when reading from daemon.
  This usually means the libguestfs appliance failed to start up.  Please
  enable debugging (LIBGUESTFS_DEBUG=1) and rerun the command, then look at
  the debug messages output prior to this error.
  Or you can run 'libguestfs-test-tool' and post the complete output into
  a bug report or message to the libguestfs mailing list.

Version-Release number of selected component (if applicable):

1.13.21

How reproducible:

100%

Steps to Reproduce:

  rm test1.img
  truncate -s 1G test1.img
  sudo chown root.root test1.img
  sudo chmod 0444 test1.img

Now compare opening this test image with and without --ro flag:

$ guestfish -a test1.img --ro run : list-devices
/dev/vda

$ guestfish -a test1.img run : list-devices
libguestfs: error: unexpected end of file when reading from daemon.
This usually means the libguestfs appliance failed to start up.  Please
enable debugging (LIBGUESTFS_DEBUG=1) and rerun the command, then look at
the debug messages output prior to this error.
Or you can run 'libguestfs-test-tool' and post the complete output into
a bug report or message to the libguestfs mailing list.

Adding -v or setting LIBGUESTFS_DEBUG=1 shows the real
error message, although the output is a bit messed up:

[...]
    -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=xterm ' \
    -drive file=/var/tmp/.guestfs-500/root.28300,snapshot=on,if=virtio,cache=unsafeqemu-kvm: -drive file=test1.img,cache=off,if=virtio: could not open disk image test1.img: Permission denied
  
Actual results:

Confusing error message.

Expected results:

Should capture and show the qemu error message.

Additional info:

Note You need to log in before you can comment on or make changes to this bug.