cache-buildkite-plugin icon indicating copy to clipboard operation
cache-buildkite-plugin copied to clipboard

Error on BusyBox - `unrecognized: -ignore_readdir_race`

Open ianks opened this issue 5 years ago • 22 comments

Just thought I'd report this. Hoping it can be solved by installing findutils. Great plugin btw!

find: unrecognized: -ignore_readdir_race
--
  | BusyBox v1.28.4 (2018-12-31 18:05:13 UTC) multi-call binary.

ianks avatar Dec 21 '20 20:12 ianks

Hey @ianks . Thanks for the report. I'm a bit unfamiliar with busybox thing. It seems it's an executable that covers many UNIX tools according to about page. Also according to that page, BusyBox has fewer options than the original ones.

If I understand correctly, you managed to fix this case by installing findutils? Or should I install that via this plugin at some point?

Other option which I only want to do at last stage, is to drop that option for BusyBox if detected.

gencer avatar Dec 21 '20 20:12 gencer

So it looks like installing findutils did not work. The image I am use inherits from cimg/base:2020.09, which I believe comes from Ubuntu. So not sure why it is not working.

ianks avatar Dec 21 '20 20:12 ianks

Instead, maybe we could use -exec with rm -f in the find command?

ianks avatar Dec 21 '20 21:12 ianks

Sad to hear that didn't work out as expected. I have an Ubuntu 20.04 LTS which is findutils installed and find -ignore_readdir_race works perfectly.

Instead, maybe we could use -exec with rm -f in the find command?

Yep. I think that will work too.

gencer avatar Dec 21 '20 21:12 gencer

I think:

find "${CACHE_PREFIX}" -type f -mtime +"${DAYS}" -exec rm -f {} \; 

will be sufficient.

Will push a new version now.

gencer avatar Dec 21 '20 21:12 gencer

@ianks could you please test against master branch? - gencer/cache#master:

gencer avatar Dec 21 '20 21:12 gencer

@gencer the original issue was solved, but now i'm getting: tar: unrecognized option: ignore-failed-read

ianks avatar Dec 21 '20 22:12 ianks

~i'm reading the --warning=no-file-changed might be better~

this does not work either :/

ianks avatar Dec 21 '20 22:12 ianks

here's what works for me 😄

https://github.com/gencer/cache-buildkite-plugin/compare/master...ianks:master

ianks avatar Dec 21 '20 23:12 ianks

@ianks generally removing --ignore-failed-read is a bad idea. However, we can make an exception for busybox. I've added busybox checking to the tar creation.

I have pushed changes to master branch. Could you please test against that branch? Please note that, if you already checkout that branch on your test machine, it might be good idea to delete plugins/*cache* folder before testing. Because buildkite will not checkout master branch twice.

gencer avatar Dec 22 '20 10:12 gencer

Released via v2.3.6.

gencer avatar Dec 26 '20 17:12 gencer

I'm getting the same --ignore-failed-read



[node] - 🔍 Locating source: v1-cache-node-6e9bee060e2c317a3c65153c5b9ec16bb1c80c3b
--
  | [node] - 🔍 Locating cache: node_modules
  | tar: unrecognized option: ignore-failed-read
  | 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
  | 🚨 Error: The plugin cache post-command hook exited with status 1

Here is my plugin config:

- gencer/cache#v2.4.8:
      id: node
      backend: tarball
      compress: true
      key: "v1-cache-{{ id }}-{{ checksum 'yarn.lock' }}" # Calculate whole 'app/javascript' recursively
      restore-keys:
        - 'v1-cache-{{ id }}-'
      paths:
        - node_modules

rasouza avatar Aug 29 '21 02:08 rasouza

@rasouza Somehow, BusyBox check fails on your system. It thinks, it is standard GNU Bash therefore uses that argument. Let me see what I can do.

gencer avatar Aug 29 '21 11:08 gencer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 19 '21 00:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 09 '21 01:10 stale[bot]

Good bot but bad decision. Not stale. ❤️

gencer avatar Oct 09 '21 11:10 gencer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 29 '21 11:10 stale[bot]

Not stale. I am warning you if you stale this one more time i'll kill you and make it look like an accident.

gencer avatar Oct 29 '21 11:10 gencer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 18 '21 21:11 stale[bot]

Bad bot. Not Stale

gencer avatar Nov 19 '21 11:11 gencer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 09 '21 16:12 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 01 '22 21:01 stale[bot]