actions / actions/toolkit

@actions/cache Does not support busybox tar

Open
#634 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Using @actions/cache to create a tar file fails when tar is provided by busybox.

To Reproduce
Steps to reproduce the behavior:

  1. Create a github workflow that specifies a container for the job (container must be lightweight and use busybox)
  2. Use actions/cache in the same job that has the task defined (actions/cache action uses @actions/cache from the toolkit)
  3. In action results, look in the post cache step.

Expected behavior
Cache should be populated correctly.

Screenshots
error message that tar doesn't support posix

Example job output

Post job cleanup.
/usr/bin/docker exec  33e75c0db157510df1fc1234ba47c2f781180acf2df39a513342f51b2b1458af sh -c "cat /etc/*release | grep ^ID"
/bin/tar --posix -z -cf cache.tgz -P -C /__w/st2_installer.ansible/st2_installer.ansible --files-from manifest.txt
/bin/tar: unrecognized option: posix
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

Host:

  • OS: Linux (ubuntu-latest in github-actions)
  • Version: Whatever github actions is using

Container:
The container that failed for me: yokogawa/ansible-lint:v4.3.7

Additional context
You can see my workflow and job run here:
https://github.com/cognifloyd/st2_installer.ansible/runs/1394562360?check_suite_focus=true
https://github.com/cognifloyd/st2_installer.ansible/actions/runs/361132480/workflow#L50-L57

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the post cache step and the /bin/tar --posix invocation shown in the issue, then reproduce it using the provided lightweight BusyBox container workflow. Done means the cache is populated successfully without the BusyBox tar error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.