You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tar command uses an option not available in BusyBox #352
/bin/tar: unrecognized option: P
BusyBox v1.31.1 () multi-call binary.
Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]...
Create, extract, or list files from a tar file
c Create
x Extract
t List
-f FILE Name of TARFILE ('-' for stdin/out)
-C DIR Change to DIR before operation
-v Verbose
-O Extract to stdout
-m Don't restore mtime
-o Don't restore user:group
-k Don't replace existing files
-Z (De)compress using compress
-z (De)compress using gzip
-J (De)compress using xz
-j (De)compress using bzip2
-a (De)compress using lzma
-h Follow symlinks
-T FILE File with names to include
-X FILE File with glob patterns to exclude
--exclude PATTERN Glob pattern to exclude
[warning]Tar failed with error: The process '/bin/tar' failed with exit code 1
Would it be possible to solve this problem so anyone could use lighter images for building?
Reacted by Tolsee, Miguel Ferreira, Jeroen Visser, Will, Hitesh Grover, Daiki Kohara, Alex Viscreanu, Christian Haller, Jacob Floyd, Steffen Müller and 10 more
As a workaround you can add tar to your Alpine container in a step prior to running actions/cache. Some Alpine-based images come with Busybox-version of tar, but adding the from the Alpine repository installes a POSIX-compliant version. Proof:
$ docker run -ti --rm --entrypoint sh node:12-alpine
/ # tar --version
tar (busybox) 1.31.1
/ # apk add --no-cache tar
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/2) Installing libacl (2.2.53-r0)
(2/2) Installing tar (1.32-r2)
Executing busybox-1.31.1-r10.trigger
OK: 8 MiB in 18 packages
/ # tar --version
tar (GNU tar) 1.32
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
/ #
So adding a step like this works:
- name: Add build dependencies to container
run: |
apk add --update --no-progress \
tar
Reacted by Bradford, Serenity, Joseph Lawson, Matteo Cristiano and Hannes Leutloff
Activity
miguelaferreira commentedon Jul 10, 2020
I can't seem to find the source for it but this is the line where it goes wrong https://github.com/actions/cache/blob/master/dist/save/index.js#L5270
jeroenvisser101 commentedon Aug 6, 2020
Comes from these two places (first and last line of selection):
https://github.com/actions/toolkit/blob/9ad01e4fd30025e8858650d38e95cfe9193a3222/packages/cache/src/internal/tar.ts#L68-L108
ci(test): can't use alpine due to an issue with tar
ci(test): can't use alpine due to an issue with tar
ci(test): can't use alpine due to an issue with tar
achton commentedon Sep 23, 2021
As a workaround you can add
tarto your Alpine container in a step prior to runningactions/cache. Some Alpine-based images come with Busybox-version oftar, but adding the from the Alpine repository installes a POSIX-compliant version. Proof:So adding a step like this works:
github-actions commentedon May 7, 2022
This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.
github-actions commentedon May 18, 2022
This issue was closed because it has been inactive for 5 days since being marked as stale.
yeldiRium commentedon Dec 23, 2025
Problem still persists, not stale.