Closed donorp closed 2 years ago
I've looked at the logs (specifically 9_Build and Push kubectl-convert.txt
) and nothing jumps to me. I've also tested this locally as follows:
cd krew-index/plugins
KREW_OS="linux" KREW_ARCH="amd64" kubectl krew install --manifest=ctx.yaml
kubectl krew uninstall ctx
KREW_OS="linux" KREW_ARCH="amd64" kubectl krew install --manifest=ctx.yaml
kubectl krew uninstall ctx
KREW_OS="linux" KREW_ARCH="amd64" kubectl krew install --manifest=ctx.yaml
kubectl krew uninstall ctx
and it does not reproduce for me. Does it only happen on your build environment? Or can you also locally reproduce this issue? I don't have a theory on what would cause this other than something's messing with the filesystem somehow.
I cannot reproduce this on my local machine as well, only github actions have this issue.
Wild guess: one possible cause of this is the timing jitter in github virtual environment, as to my very limited experience, that's far more significant than the usual case.
Are you installing/uninstalling them in parallel? I can't see why a sequential install/uninstall would cause this.
I wish I could say yes, but there is no parallel job in my pipeline, to make sure they are sequential commands, I created a github action to run krew install/uninstall in script, but still no luck: https://github.com/arhat-dev/krew-index/runs/4170194680
Action logs:
I think I have a theory.
https://github.com/kubernetes-sigs/krew/blob/master/internal/receiptsmigration/migration.go
If there are plugins installed (maybe krew itself!) but there are no installation receipts, we give that "krew home outdated" error.
Is it possible to run "tree $HOME/.krew" before the failing command on GitHub actions? That would greatly help us debug how your setup got into that situation.
/kind bug /priority P3
You are right, the receipts dir is always empty before and after the crash, and the plugin is not removed after krew uninstall
.
+ krew -v 10 uninstall convert
I1111 05:05:55.291830 21668 root.go:221] Ensure creating dir: "/home/runner/.krew"
I1111 05:05:55.291873 21668 root.go:221] Ensure creating dir: "/home/runner/.krew/store"
I1111 05:05:55.291879 21668 root.go:221] Ensure creating dir: "/home/runner/.krew/bin"
I1111 05:05:55.291883 21668 root.go:221] Ensure creating dir: "/home/runner/.krew/index"
I1111 05:05:55.291905 21668 root.go:221] Ensure creating dir: "/home/runner/.krew/receipts"
I1111 05:05:55.291998 21668 migration.go:30] Checking if index migration is needed.
I1111 05:05:55.292006 21668 migration.go:33] Index already migrated.
I1111 05:05:55.292024 21668 uninstall.go:47] Going to uninstall plugin convert
I1111 05:05:55.292052 21668 install.go:163] Finding installed version to delete
I1111 05:05:55.293208 21668 root.go:128] skipping upgrade check
I1111 05:05:55.293370 21668 install.go:172] Deleting plugin convert
I1111 05:05:55.293511 21668 install.go:175] Unlink "/home/runner/.krew/bin/kubectl-convert"
I1111 05:05:55.293531 21668 install.go:215] No file found at "/home/runner/.krew/bin/kubectl-convert"
I1111 05:05:55.293538 21668 install.go:181] Deleting path "/home/runner/.krew/store/convert"
I1111 05:05:55.302120 21668 install.go:186] Deleting plugin receipt "/home/runner/.krew/receipts/convert.yaml"
Uninstalled plugin: convert
I1111 05:05:55.302378 21668 root.go:176] Upgrade check was skipped or has not finished
+ krew -v 10 uninstall convert
+ tree /home/runner/.krew
/home/runner/.krew
├── bin
│ └── kubectl-convert.exe -> /home/runner/.krew/store/convert/v1.22.2/kubectl-convert
├── index
│ └── default
│ ├── CONTRIBUTING.md
│ ├── LICENSE
│ ├── OWNERS
│ ├── OWNERS_ALIASES
│ ├── README.md
│ ├── SECURITY_CONTACTS
│ ├── code-of-conduct.md
│ ├── plugins
... omitted ...
│ │ └── whoami.yaml
│ └── plugins.md
├── receipts
└── store
I tried removing windows installation test (on linux) and everything's working (for linux and darwin), and also tried testing windows installation on windows, worked as well.
So I guess it's something related to the KREW_OS
env, and probably it's caused by the cleanup behavior that only happens on windows platform: https://github.com/kubernetes-sigs/krew/blob/master/cmd/krew/cmd/root.go#L165 .
Maybe a quick fix for this would be using runtime.GOOS rather than KREW_OS env to determine host os in this case?
I agree with your findings, although we need to look closely into implications of that (we might be relying on usage of KREW_OS for testing etc).
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
Hi, I was trying to automate the kubectl plugin releasing process within a custom krew-index repo, thus I need to test plugin installation as a part of the automation process to make sure everything's working.
Environment
Host OS:
ubuntu-20.04
(github actions)Krew version:
Could not reproduce this on local macOS.
What you did?
Run krew install and krew uninstall for every os/arch set of a kubectl plugin (
kubectl-convert
in the following example)Expected behavior
krew only raise error when manifest or plugin package is invalid.
What went wrong?
krew stopped working after two installation & uninstallation of the same plugin:
full logs: logs_22.zip