TAR command exits with 2 when extracting contents of android studio

Hello Travis community,

My issue is related to the fact that I’m not able to build the android version of my app due to a tar command failure. The iOS version works well, and Android version worked as well three weeks ago, but now it seems to fail without any reason. Here’s a snippet of the travis.yml file where the build is failing:

The error is the following:

tar: write error
e[0Ke[31;1mThe command “tar -xvf android-sdk_r24.4-linux.tgz” failed and exited with 2 during .

I also ran df command and after downloading the archive, the volume is at 24% of its capacity. Here is the output of the df command:

Filesystem 1K-blocks Used Available Use% Mounted on
udev 3817196 4 3817192 1% /dev
tmpfs 765940 300 765640 1% /run
/dev/sda1 72214856 11794492 57363320 18% /
none 4 0 4 0% /sys/fs/cgroup
none 5120 0 5120 0% /run/lock
none 3829684 0 3829684 0% /run/shm
none 102400 0 102400 0% /run/user
none 786432 183032 603400 24% /var/ramfs

Here is the link to the travis.yml file: https://github.com/GrepDev/kitchen-mobile/blob/master/.travis.yml.

Did anyone experience a similar issue? How did you solve it?


Please link to the failed build.

Here is the link to one of the failed builds: https://travis-ci.org/GrepDev/kitchen-mobile/jobs/513520232.

You are passing -v to tar, making it write file names as they are extracted. That’s LOTS of output very fast. It’s possible that Travis can’t handle so much and that “write error” is error from writing to stdout rather than disk.

There are already a few known issues with this, e.g. https://github.com/travis-ci/travis-ci/issues/8189 and https://travis-ci.community/t/characters-in-travis-console-log/ .
Travis is not unique here, either, see e.g. https://stackoverflow.com/questions/37540792/jenkins-script-tar-write-error/38738272 for a similar error with Jenkins.

With the number of files in that archive, it’s possible that this is not a bug at all and you are rather hitting the log size limit!

Thanks a lot! Deleted the -v from the command and it works perfectly.

You are welcome! You can mark a post as a solution by clicking the tick icon below it.