Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: failed to unpack image...: error unpacking golden image... #147

Open
wBiOw opened this issue Aug 10, 2022 · 4 comments
Open

Error: failed to unpack image...: error unpacking golden image... #147

wBiOw opened this issue Aug 10, 2022 · 4 comments
Labels

Comments

@wBiOw
Copy link

wBiOw commented Aug 10, 2022

cmd := exec.Command("tar", "-xv", "-C", toDir, "-f", image)

When run from Windows using gitBash instead of cmd gives the error "Error: failed to unpack image...: error unpacking golden image...: exit status 2". The problem is related to the key difference for "tar" when run from cmd or gitBash.

@Kraktorist
Copy link

Hi!
I've just run the example provided in the repo using gitBash console and it works for me.
tar (GNU tar) 1.34 is installed in my gitBash.

Have you checked the image you are using?

@wBiOw
Copy link
Author

wBiOw commented Aug 10, 2022

Hi!
git version 2.37.0.windows.1
cmd tar --version bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp
github tar --version tar (GNU tar) 1.34

Before checking and running, you deleted the already unpacked %virtualbox .box file in a directory %virtualbox (by default it is located in "C:\Users\1.terraform\virtualbox\gold")? Because if it is already unpacked, then it is not unpacked again.

  • if run from github "./terraform apply": create directory %virtualbox in directory: "C:\Users\1.terraform\virtualbox\gold", but not Unpack %virtualbox .box
    and echo "Error: failed to unpack image %virtualbox : error unpacking golden image %virtualbox "
    if in directory: "C:\Users\1.terraform\virtualbox\gold" already an unpacked virtual machine, then everything works.

  • if run from cmd "terraform apply": creat directory %virtualbox in C:\Users\1.terraform\virtualbox\gold and Unpacking %virtualbox.box

This is a fairly common problem (appears for users on different computers).

@Kraktorist
Copy link

Got it. I've reproduced the bug with the couple of different images.

@wBiOw wBiOw changed the title Error: failed to unpack image...: error unpacking golden image... [BUG] Error: failed to unpack image...: error unpacking golden image... Aug 10, 2022
@wBiOw wBiOw changed the title [BUG] Error: failed to unpack image...: error unpacking golden image... Error: failed to unpack image...: error unpacking golden image... [BUG] Aug 10, 2022
@wBiOw wBiOw changed the title Error: failed to unpack image...: error unpacking golden image... [BUG] Error: failed to unpack image...: error unpacking golden image... bug Aug 10, 2022
@wBiOw wBiOw changed the title Error: failed to unpack image...: error unpacking golden image... bug Error: failed to unpack image...: error unpacking golden image... Aug 10, 2022
@essemenoff
Copy link

It is failed in GitBash but it works for me if I run in PowerShell.
GitBash's tar version

tar (GNU tar) 1.34

PowerShell tar version

PS C:\Users\ess\.terraform\virtualbox\machine\asd> tar --version
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp

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

No branches or pull requests

4 participants