Bug 1591617 - virt-make-fs fails with: "libguestfs: error: tar_in: write error on directory: /:"
Summary: virt-make-fs fails with: "libguestfs: error: tar_in: write error on directory...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-15 06:21 UTC by Ciro Santilli
Modified: 2018-06-17 12:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-15 09:00:39 UTC
Embargoed:


Attachments (Terms of Use)
debug output (51.70 KB, text/plain)
2018-06-15 06:21 UTC, Ciro Santilli
no flags Details

Description Ciro Santilli 2018-06-15 06:21:29 UTC
Created attachment 1451784 [details]
debug output

Bionic beaver 18.04 libguetfs-tools 1:1.36.13-1ubuntu3:

    sudo apt-get install libguestfs-tools
    mkdir sysroot
    # Just a test file.
    dd if=/dev/urandom of=sysroot/myfile bs=1024 count=1024
    sudo virt-make-fs --format=qcow2 --type=ext2 sysroot sysroot.ext2.qcow2

fails with:

    libguestfs: error: tar_in: write error on directory: /:

Without sudo:

    virt-make-fs --format=qcow2 --type=ext2 sysroot sysroot.ext2.qcow2

fails with:

    libguestfs: error: /usr/bin/supermin exited with error status 1.
    To see full error messages you may need to enable debugging.
    Do:
    export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
    and run the command again. For further information, read:
    http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
    You can also run 'libguestfs-test-tool' and post the *complete* output
    into a bug report or message to the libguestfs mailing list.

but I think it is an unrelated problem.

Original command with debug vars:

    sudo LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 virt-make-fs --format=qcow2 --size=+200M sysroot/ output.img

attached as a file.

Launchpad report: https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1777058

Comment 1 Richard W.M. Jones 2018-06-15 07:48:39 UTC
The without sudo thing is probably because of the usual
Ubuntu kernel bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
See also the libguestfs FAQ.

The error reported here seems to be a bug in the tar command.
We're running:

  tar -C /sysroot/ -xf - 2> /tmp/tarLvFy1o

and tar prints:

  write error on directory: /: 

but doesn't say what the actual error is.

Comment 3 Richard W.M. Jones 2018-06-15 08:15:46 UTC
In fact the message:

  write error on directory: /: 

comes from libguestfs, but what's after the second colon is
supposed to be the output from the failed tar command.  Unfortunately
tar prints nothing at all so I'm still no closer to understanding
what the actual error message is.

Suggest varying the type of the filesystem, contents you want
to upload, etc until you can get it to work to see what the
confounding factor is.

Comment 4 Pino Toscano 2018-06-15 09:00:39 UTC
This is because the appliance does not contain dash.  This was fixed upstream with
- https://github.com/libguestfs/libguestfs/commit/0cca7f9061455d29a7f893e715028cd3e75c19fd
  (in libguestfs >= 1.39.1)
- https://github.com/libguestfs/libguestfs/commit/e2e3248377e52314ce9ac60a9cb1fed9ec209ad4
  (in libguestfs >= 1.38.1)

The workaround is to manually include dash:
# echo dash > /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/zz-dash-packages
then remove the cache:
$ rm -rf /var/cache/.guestfs-$UID

The commit above must be backported in Ubuntu (good luck, since it has no maintainer there).

Comment 5 Ciro Santilli 2018-06-15 10:15:49 UTC
Thanks Pino and Richard,

As a good member of the Ubuntu community, I will immediately... revert back to dd with random image size and losetup :-)

@Richard: the sudo thing was exactly what you mentioned, thanks.

If you want to become even more famous through your awesome library, I would recommend that you maintain the Ubuntu package :-) I wonder if you can legally do that as a Red Hat employee, but I suppose yes?

Also, get a more modern website design. Current one scared me when I first saw it :-) Partly due to the 2009-2014 Fish thing :-)

libguestfs is just awesome, shame it has so many system dependencies that Debian can't get it to work :-(

Ubuntu and Fedora should just merge into a single distro :-(

Comment 6 Pino Toscano 2018-06-15 11:24:04 UTC
(In reply to Ciro Santilli from comment #5)
> Thanks Pino and Richard,
> 
> As a good member of the Ubuntu community, I will immediately... revert back
> to dd with random image size and losetup :-)

Why? I even wrote down a working workaround, which has no drawbacks.
Did you test it?

> libguestfs is just awesome, shame it has so many system dependencies that
> Debian can't get it to work :-(

The Debian maintainer of libguestfs, Hilko Bengen, does a good job in maintaining it, and as Debian user I can assure that it works fine there.

Comment 7 Ciro Santilli 2018-06-15 11:31:15 UTC
> Why? I even wrote down a working workaround, which has no drawbacks.
> Did you test it?

Thanks, for the workarounds,

I didn't have the time to test them yet (changed to work computer :-)), but I'm writing what I hope will be highly stable and automated image generation scripts for other people to use, so I'd rather not rely on workarounds.

Comment 8 Ciro Santilli 2018-06-17 12:14:00 UTC
The workaround works on Ubuntu 18.04:

The workaround is to manually include dash:
# echo dash > /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/zz-dash-packages
then remove the cache:
$ rm -rf /var/cache/.guestfs-$UID


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