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

reset should fail more graceful when k0s not installed #464

Closed
an-tex opened this issue Feb 21, 2023 · 1 comment · Fixed by #465
Closed

reset should fail more graceful when k0s not installed #464

an-tex opened this issue Feb 21, 2023 · 1 comment · Fixed by #465
Labels
bug Something isn't working

Comments

@an-tex
Copy link

an-tex commented Feb 21, 2023

when running k0sctl reset for a host where k0s has not yet been installed leads to the following output:

INFO[0008] ==> Running phase: Gather k0s facts
INFO[0008] ==> Running phase: Reset controllers
WARN[0008] [ssh] xxxx:22: k0s reported failure: command failed: client exec: ssh session wait: Process exited with status 127
FATA[0008] PANIC: runtime error: invalid memory address or nil pointer dereference

when running with debug flag -d it becomes more apparent:

INFO[0008] ==> Running phase: Gather k0s facts
DEBU[0008] [ssh] xxxxx:22: executing `/usr/local/bin/k0s version`
DEBU[0008] [ssh] xxxxx:22: (stderr) bash: line 1: /usr/local/bin/k0s: No such file or directory
DEBU[0008] [ssh] xxxxx:22: executing `test -e /var/lib/k0s/pki/admin.conf 2> /dev/null`
DEBU[0008] [ssh] xxxxx:22: executing `env "KUBECONFIG=/var/lib/k0s/kubelet.conf" /usr/local/bin/k0s kubectl get -n kube-system namespace kube-system -o template={{.metadata.uid}}`
DEBU[0008] [ssh] xxxxx:22: (stderr) env: ‘/usr/local/bin/k0s’: No such file or directory
DEBU[0008] Preparing phase 'Run Before Reset Hooks'
DEBU[0008] Preparing phase 'Reset workers'
DEBU[0008] 0 workers in total
DEBU[0008] ResetWorkers phase prepared, 0 workers will be reset
DEBU[0008] Preparing phase 'Reset controllers'
DEBU[0008] 3 controllers in total
DEBU[0008] ResetControllers phase prepared, 3 controllers will be reset
INFO[0008] ==> Running phase: Reset controllers
DEBU[0008] [ssh] xxxxx:22: draining node
DEBU[0008] [ssh] xxxxx:22: draining node completed
DEBU[0008] [ssh] xxxxx:22: deleting node...
DEBU[0008] [ssh] xxxxx:22: deleting node
DEBU[0008] [ssh] xxxxx:22: executing `stat /run/systemd/system`
DEBU[0008] [ssh] xxxxx:22: File: /run/systemd/system
DEBU[0008] [ssh] xxxxx:22: Size: 80        	Blocks: 0          IO Block: 4096   directory
DEBU[0008] [ssh] xxxxx:22: Device: 19h/25d	Inode: 368         Links: 3
DEBU[0008] [ssh] xxxxx:22: Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
DEBU[0008] [ssh] xxxxx:22: Access: 2023-02-21 10:28:48.558043986 +0100
DEBU[0008] [ssh] xxxxx:22: Modify: 2023-02-21 10:28:48.550043986 +0100
DEBU[0008] [ssh] xxxxx:22: Change: 2023-02-21 10:28:48.550043986 +0100
DEBU[0008] [ssh] xxxxx:22: Birth: -
DEBU[0008] [ssh] xxxxx:22: executing `systemctl status k0scontroller 2> /dev/null | grep -q "(running)"`
DEBU[0008] [ssh] xxxxx:22: leaving etcd...
DEBU[0008] [ssh] xxxxx:22: leaving etcd completed
DEBU[0008] [ssh] xxxxx:22: resetting k0s...
DEBU[0008] [ssh] xxxxx:22: executing `/usr/local/bin/k0s reset`
DEBU[0008] [ssh] xxxxx:22: (stderr) bash: line 1: /usr/local/bin/k0s: No such file or directory
WARN[0008] [ssh] xxxxx:22: k0s reported failure: command failed: client exec: ssh session wait: Process exited with status 127
DEBU[0008] failed to submit telemetry: the client was already closed
FATA[0008] PANIC: runtime error: invalid memory address or nil pointer dereference
@kke
Copy link
Contributor

kke commented Feb 22, 2023

Yes, panic especially is no good.

@kke kke added the bug Something isn't working label Feb 22, 2023
@kke kke closed this as completed in #465 Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants