Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 'asdf plugin add <plugin>' broken in alpine #1133

Closed
mathew-fleisch opened this issue Dec 19, 2021 · 5 comments
Closed

bug: 'asdf plugin add <plugin>' broken in alpine #1133

mathew-fleisch opened this issue Dec 19, 2021 · 5 comments
Labels

Comments

@mathew-fleisch
Copy link

Describe the Bug

This change #1117 seems to have broken the asdf plugin add <plugin> functionality in alpine completely. I have a container that is automatically rebuilt occasionally with newest versions of all my favorite asdf plugins. I am also always running the latest version of asdf core as well. A week or two ago this build started to fail and I haven't had a chance to look into it until now. Here is the signal I see when trying to add any plugin:

~ # asdf plugin add awscli
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

	-H	Add 'filename:' prefix
	-h	Do not add 'filename:' prefix
	-n	Add 'line_no:' prefix
	-l	Show only names of files that match
	-L	Show only names of files that don't match
	-c	Show only count of matching lines
	-o	Show only the matching part of line
	-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
	-v	Select non-matching lines
	-s	Suppress open and read errors
	-r	Recurse
	-R	Recurse and dereference symlinks
	-i	Ignore case
	-w	Match whole words only
	-x	Match whole lines only
	-F	PATTERN is a literal (not regexp)
	-E	PATTERN is an extended regexp
	-m N	Match up to N times per file
	-A N	Print N lines of trailing context
	-B N	Print N lines of leading context
	-C N	Same as '-A N -B N'
	-e PTRN	Pattern to match
	-f FILE	Read pattern from file
awscli is invalid. Name must match regex ^[a-zA-Z0-9_-]+$

Steps to Reproduce

dockerfile

FROM alpine:latest
ENV ASDF_DATA_DIR /root/.asdf
ENV ASDF_DIR /root/.asdf

RUN apk add --update bash curl git make jq python3 py3-pip openssh vim \
    && rm /bin/sh && ln -s /bin/bash /bin/sh \
    && ln -s /usr/bin/python3 /usr/local/bin/python

# Install asdf dependencies
WORKDIR /root
COPY .tool-versions /root/.tool-versions
RUN mkdir -p $ASDF_DATA_DIR \
    && git clone --depth 1 https://github.com/asdf-vm/asdf.git $ASDF_DATA_DIR \
    && . $ASDF_DATA_DIR/asdf.sh \
    && echo -e '\n. $ASDF_DATA_DIR/asdf.sh' >> $HOME/.bashrc \
    && echo -e '\n. $ASDF_DATA_DIR/asdf.sh' >> $HOME/.profile \
    && asdf update
CMD /bin/sh -c ". ${ASDF_DATA_DIR}/asdf.sh && /bin/bash"

.tool-versions

awscli 2.4.6
bat 0.18.3
gcloud 367.0.0
helm 3.7.2
kubectl 1.23.1
kubectx 0.9.4
kustomize 4.4.1
rclone 1.57.0
shellcheck 0.8.0
shfmt 3.4.1
sops 3.7.1
terraform 0.12.30
terraform latest
tflint 0.34.0
yq 4.9.8

docker build -t asdf-broken-plugins .
docker run --rm -it asdf-broken-plugins

inside docker

while IFS= read -r line; do asdf plugin add $(echo "$line" | awk '{print $1}'); done < .tool-versions

Expected Behaviour

Before this (i think) change, these plugins were able to be added and installed with a similar script.

Actual Behaviour

all plugins seem to not be able to be installed
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

awscli is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

bat is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

gcloud is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

helm is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

kubectl is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

kubectx is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

kustomize is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

rclone is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

shellcheck is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

shfmt is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

sops is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

terraform is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

terraform is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

tflint is invalid. Name must match regex ^[a-zA-Z0-9_-]+$
grep: unrecognized option: quiet
BusyBox v1.33.1 () multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-R	Recurse and dereference symlinks
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

yq is invalid. Name must match regex ^[a-zA-Z0-9_-]+$

Environment

bash-5.1# asdf info
OS:
Linux 04d826025956 5.10.76-linuxkit #1 SMP Mon Nov 8 10:21:19 UTC 2021 x86_64 Linux

asdf plugins affected (if relevant)

All plugins seem to be broken

@mathew-fleisch
Copy link
Author

@Stratus3D @jthegedus FYI ☝️

@jthegedus
Copy link
Contributor

jthegedus commented Dec 23, 2021

The change in #1117 is only for a test case, not any code on the CLI critical path.

The issue seems from your report to be:

 grep: unrecognized option: quiet

The only code to effect that which changed recently was #1106 which removed the --quiet in favour of the -q shorthand flag specifically to be alpine compatible.

When you say

I am also always running the latest version of asdf core as well

Do you mean you are running asdf update --head? Because that is the version you would need to run the latest code which removed --quiet. Your asdf info output should show the asdf version and commit sha being run, but it doesn't look like it was all copied across correctly. Can you find the exact version of asdf you are running? Can you also try this with asdf update --head to see if it resolves your issue?

@Stratus3D
Copy link
Member

I tested this and confirmed that it works with asdf update --head. Once a new version is tagged this fix will be available with just asdf update.

@theoretick
Copy link

I tested this and confirmed that it works with asdf update --head. Once a new version is tagged this fix will be available with just asdf update.

@Stratus3D had a general question as a follow-up to this: is there an expected release policy for bugfixes like this to go out?

We can pull from --head but just wondering about a timeline for a 0.9.1 release (or an expected cadence for patches)

@Stratus3D
Copy link
Member

@theoretick there isn't a timeline but I expected it to be tagged sometime in the next month or two. And it looks like the next release will be 0.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants