Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

"begin: extracttar error: exit status 1, output: error extracting tar". Unable to create image from tarball rootfs, GNU sparse unsupported #263

Open
pmariani opened this issue Oct 17, 2016 · 3 comments

Comments

@pmariani
Copy link

pmariani commented Oct 17, 2016

Hi,

I am trying to create a complete Ubuntu image, starting from an Ubuntu-provided tarball.

I am using the current master of acbuild (4c0e077), built locally with ./build.

My script is the following:

#!/bin/bash

set -o nounset
set -o errexit
set -o xtrace
set -o pipefail

rootfs_img=$1

workpath='/home/vagrant'
acbuild="sudo /vagrant/acbuild/bin/acbuild --debug --work-path ${workpath}"

acbuildend () {
    export EXIT=$?
    echo "trapped error"
    $acbuild end
    exit $EXIT
}

$acbuild begin $rootfs_img
trap acbuildend EXIT

$acbuild set-name localhost/testbox
$acbuild write testbox.aci
$acbuild end

It is running on a Trusty vagrant guest:

vagrant@dev:/vagrant/acbuild$ uname -a
Linux dev 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
vagrant@dev:/vagrant/acbuild$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
vagrant@dev:/vagrant/acbuild$

The script invocation fails with the following output:

vagrant@dev:/vagrant$ ./buildscript.sh /home/vagrant/ubuntu-14.04-server-cloudimg-amd64-root.tar.gz
+ set -o pipefail
+ rootfs_img=/home/vagrant/ubuntu-14.04-server-cloudimg-amd64-root.tar.gz
+ workpath=/home/vagrant
+ acbuild='sudo /vagrant/acbuild/bin/acbuild --debug --work-path /home/vagrant'
+ sudo /vagrant/acbuild/bin/acbuild --debug --work-path /home/vagrant begin /home/vagrant/ubuntu-14.04-server-cloudimg-amd64-root.tar.gz
Beginning build with /home/vagrant/ubuntu-14.04-server-cloudimg-amd64-root.tar.gz
begin: extracttar error: exit status 1, output: error extracting tar
vagrant@dev:/vagrant$

Local acbuild edits and print-based debugging showed that the issue was with attempting to untar /usr/lib/locale/locale-archive which is compressed with GNUSparse.
The error comes from this line and the corresponding header type flag is 83.

Manually untarring the image and pointing acbuild at the resulting directory produces a working image.

@pmariani pmariani changed the title ""begin: extracttar error: exit status 1, output: error extracting tar. Unable to create image from tarball rootfs, GNU sparse unsupported "begin: extracttar error: exit status 1, output: error extracting tar". Unable to create image from tarball rootfs, GNU sparse unsupported Oct 17, 2016
@J-Swift
Copy link

J-Swift commented Nov 29, 2016

This is also the case when using acbuild begin docker://debian:jessie-slim

@cgonyeo
Copy link
Member

cgonyeo commented Jan 17, 2017

Sorry about taking forever to get around to this.

I can't seem to reproduce the error in acbuild currently when I try to begin from jessie-slim:

derek@proton ~> acbuild begin docker://debian:jessie-slim
Downloading sha256:a3ed95caeb0 [=============================]       32 B / 32 B
Downloading sha256:b5161f7f177 [=============================] 29.5 MB / 29.5 MB
acbuild begin docker://debian:jessie-slim  8.13s user 0.54s system 48% cpu 17.867 total
derek@proton ~>

Maybe the image has changed on the docker hub since then? I'll see if I can create an image that reproduces this and find a fix.

@sharedprophet
Copy link

This seems like another issue with VM shared file systems...

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

No branches or pull requests

4 participants