kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.41k stars 369 forks source link

It complains 0.4.4 is not supported anymore on maiden install #856

Closed boardtc closed 1 month ago

boardtc commented 6 months ago

I have been trying to install the latest v0.4.4 on windows today. trying in both cmd and Powershell I get:

This version of Krew is not supported anymore. Please manually migrate:

  1. Uninstall Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/uninstall/
  2. Install latest Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
  3. Install the plugins you used krew home outdated

I have copied krew.exe to %USERPROFILE%.krew\bin, updated path and restarted. Trying to install from my downloads directory with Krew present gets the same results. I never downloaded an older krew and v0.4.4 is current according to the page.

Apologies this reads like a total noob issue maybe it's the day that's in it but not getting past it currently.

sighupper commented 6 months ago

This is not limited to Windows. Is also happening on Mac:


test@test $ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew-darwin_arm64.tar.gz
+ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew-darwin_arm64.tar.gz
test@test $ tar zxvf krew-darwin_arm64.tar.gz
+ tar zxvf krew-darwin_arm64.tar.gz
x ./LICENSE
x ./krew-darwin_arm64
test@test $./krew-darwin_arm64
+ ./krew-darwin_arm64
krew is the kubectl plugin manager.
You can invoke krew through kubectl: "kubectl krew [command]..."

Usage:
  kubectl krew [command]

Available Commands:
  help        Help about any command
  index       Manage custom plugin indexes
  info        Show information about an available plugin
  install     Install kubectl plugins
  list        List installed kubectl plugins
  search      Discover kubectl plugins
  uninstall   Uninstall plugins
  update      Update the local copy of the plugin index
  upgrade     Upgrade installed plugins to newer versions
  version     Show krew version and diagnostics

Flags:
  -h, --help      help for krew
  -v, --v Level   number for the log level verbosity

Use "kubectl krew [command] --help" for more information about a command.
test@test $./krew-darwin_arm64 install
+ ./krew-darwin_arm64 install
This version of Krew is not supported anymore. Please manually migrate:
1. Uninstall Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/uninstall/
2. Install latest Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
3. Install the plugins you used
krew home outdated
ahmetb commented 6 months ago

@sighupper you're manually invoking ./krew-darwin_arm64 install –that's not what you think it does. The command at https://krew.sigs.k8s.io/docs/user-guide/setup/install/ specifically uses Krew to install Krew. So please stick to the command (which does ./"${KREW}" install krew).

If it still fails even by copy pasting the exact command, please provide the full output (and ideally run the last command with -v=7 flag).

Ideally we should remove this code path though so it stops causing issues.

sighupper commented 6 months ago

@ahmetb , thank you for your response.

I am following https://krew.sigs.k8s.io/docs/user-guide/setup/install/

Here is running the commands as suggested in the above install guide:

test@test $  set -x; cd "$(mktemp -d)" &&
>   OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
>   ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
>   KREW="krew-${OS}_${ARCH}" &&
>   curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
>   tar zxvf "${KREW}.tar.gz" &&
>   ./"${KREW}" install krew
++ mktemp -d
+ cd /var/folders/1k/b0c0b49j7x11n5rfwzcyx_580000gp/T/tmp.g9td4oMuGg
++ uname
++ tr '[:upper:]' '[:lower:]'
+ OS=darwin
++ uname -m
++ sed -e s/x86_64/amd64/ -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/'
+ ARCH=arm64
+ KREW=krew-darwin_arm64
+ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-darwin_arm64.tar.gz
+ tar zxvf krew-darwin_arm64.tar.gz
x ./LICENSE
x ./krew-darwin_arm64
+ ./krew-darwin_arm64 install krew
This version of Krew is not supported anymore. Please manually migrate:
1. Uninstall Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/uninstall/
2. Install latest Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
3. Install the plugins you used
krew home outdated
test@test $

and here is running the same commands but adding -v=7 flag:


test@test $  set -x; cd "$(mktemp -d)" &&   OS="$(uname | tr '[:upper:]' '[:lower:]')" &&   ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&   KREW="krew-${OS}_${ARCH}" &&   curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&   tar zxvf "${KREW}.tar.gz" &&   ./"${KREW}" install krew -v=7
+ set -x
++ mktemp -d
+ cd /var/folders/1k/b0c0b49j7x11n5rfwzcyx_580000gp/T/tmp.HM1C7QeLbQ
++ uname
++ tr '[:upper:]' '[:lower:]'
+ OS=darwin
++ uname -m
++ sed -e s/x86_64/amd64/ -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/'
+ ARCH=arm64
+ KREW=krew-darwin_arm64
+ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-darwin_arm64.tar.gz
+ tar zxvf krew-darwin_arm64.tar.gz
x ./LICENSE
x ./krew-darwin_arm64
+ ./krew-darwin_arm64 install krew -v=7
I0515 11:49:34.376854    4993 root.go:238] Ensure creating dir: "/Users/mdavidson/.krew"
I0515 11:49:34.377023    4993 root.go:238] Ensure creating dir: "/Users/mdavidson/.krew/store"
I0515 11:49:34.377028    4993 root.go:238] Ensure creating dir: "/Users/mdavidson/.krew/bin"
I0515 11:49:34.377033    4993 root.go:238] Ensure creating dir: "/Users/mdavidson/.krew/index"
I0515 11:49:34.377037    4993 root.go:238] Ensure creating dir: "/Users/mdavidson/.krew/receipts"
I0515 11:49:34.377131    4993 root.go:132] skipping upgrade check
This version of Krew is not supported anymore. Please manually migrate:
1. Uninstall Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/uninstall/
2. Install latest Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
3. Install the plugins you used
F0515 11:49:34.377209    4993 root.go:80] krew home outdated
sigs.k8s.io/krew/cmd/krew/cmd.preRun
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:153
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:915
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
sigs.k8s.io/krew/cmd/krew/cmd.Execute
        /home/runner/work/krew/krew/cmd/krew/cmd/root.go:78
main.main
        /home/runner/work/krew/krew/cmd/krew/main.go:25
runtime.main
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_arm64.s:1172
chriskim06 commented 6 months ago

to get this error you would need to have a plugin installed without any receipts https://github.com/kubernetes-sigs/krew/blob/master/internal/receiptsmigration/migration.go#L36-L39. on a fresh install though there would be no plugins installed yet (since this runs before the actual install of krew). since !(hasInstalledPlugins && hasNoReceipts) is false in your case you must have no receipts but an installed plugin somehow. could you show the output of ls for both /Users/mdavidson/.krew/bin and /Users/mdavidson/.krew/receipts?

sighupper commented 6 months ago

So, I am using an ansible playbook for set up and it is throwing:

Install krew plugin manager for kubectl...  failed | msg: non-zero return code | stderr: This version of Krew is not supported anymore. Please manually migrate:
1. Uninstall Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/uninstall/
2. Install latest Krew: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
3. Install the plugins you used
krew home outdated

This even fails if mv /Users/mdavidson/.krew/bin{,.bak} and mv /Users/mdavidson/.krew/receipts{,.bak}.

That said, if I even mv those , then the set up guide steps work when doing them "manually".

I will work on my playbook and circle back here if I have need any help.

Thank you!

boardtc commented 6 months ago

@chriskim06 I have nothing installed other than in my OP. Have you tried an install on a clean virtual machine? It does not work :-(

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 month ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/krew/issues/856#issuecomment-2419805198): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.