Bug 591155 - virt-tar prints "tar_in: tar subcommand failed on directory" if a disk image is not writable
virt-tar prints "tar_in: tar subcommand failed on directory" if a disk image ...
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On: 576879 627835
Blocks: 591250
  Show dependency treegraph
Reported: 2010-05-11 11:08 EDT by Richard W.M. Jones
Modified: 2011-07-14 15:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 591250 (view as bug list)
Last Closed: 2011-07-14 15:08:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output of debug virt-tar -u (35.37 KB, text/plain)
2010-05-11 14:07 EDT, Natxo Asenjo
no flags Details

  None (edit)
Description Richard W.M. Jones 2010-05-11 11:08:52 EDT
Description of problem:

virt-tar gives an obscure error if the destination directory is not
writable when uploading.

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


How reproducible:


Steps to Reproduce:

1. Create a phony disk image using guestfish:

$ guestfish -N fs -m /dev/sda1 <<EOF
mkdir /bin
mkdir /boot
mkdir /boot/grub
mkdir /etc
mkdir /usr
touch /boot/grub/menu.lst
upload -<<end /etc/fstab
/dev/sda1 / ext2 defaults 1 2

2. Make it read-only:

$ chmod -w test1.img

3. Check virt-inspector recognizes it:

$ virt-inspector --perl test1.img
[prints some Perl stuff and doesn't give an error]

4. Try uploading something:

$ virt-tar -u test1.img test.tar /
[where 'test.tar' is a random small tarball]

Actual results:

virt-tar says:
tar_in: tar subcommand failed on directory: / at /usr/bin/virt-tar line 246.

Expected results:

Better error message.

Additional info:

Originally reported by Natxo Asenjo here:
Comment 1 Richard W.M. Jones 2010-05-11 11:14:50 EDT
This is generally an instance of bug 576879.
Comment 2 Natxo Asenjo 2010-05-11 14:05:46 EDT
the vm image is on the local hard disk, so local storage. The permissions are 
-rw-------. 1 root root 8589934592 2010-05-11 19:56 wiki-clone.img

and the virt-tar -u command is being run as administrator.

SElinux is in permissive mode.

I attach the debug log using export LIBGUESTFS_DEBUG=1
Comment 3 Natxo Asenjo 2010-05-11 14:07:11 EDT
Created attachment 413213 [details]
output of debug virt-tar -u
Comment 4 Richard W.M. Jones 2010-05-13 05:27:21 EDT
Patches posted upstream to improve the error messages:


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