tar exiting with code 1 but no explanation

Viewed 23

I'm having a strange issue with tar. I'm running it in a Dockerfile, so while building an image. To make matters more complicated, this is using buildx on a buildserver to build an arm64 image on an amd64 machine, using qemu. So maybe those things are influencing the behavior I'm seeing.

But the core problem is, I'm downloading a tgz file, which seems to work fine. Then I do:

tar -xvf file.tgz

And I get the following error:

tar: Child returned status 1
tar: Error is not recoverable: exiting now

Everywhere I search, there is an extra line explaining what exactly went wrong (e.g. it isn't a correct tar.gz file). But in my case, there is no extra line. Any ideas how I can investigate this further?

1 Answers

This tar file is compressed so you can first uncompress it and then untar. Or you can do this with one command:

tar xzvf file.tgz
Related