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

Replace confusing systemd log #8714

Closed
manuelbuil opened this issue Oct 23, 2023 · 4 comments
Closed

Replace confusing systemd log #8714

manuelbuil opened this issue Oct 23, 2023 · 4 comments
Assignees
Milestone

Comments

@manuelbuil
Copy link
Contributor

Some versions of network manager have a bug in the component nm-cloud-setup.service and that's why we check if it exists when starting k3s and fail to start k3s if it does:

k3s/install.sh

Line 907 in 6aef26e

ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'

If if does not exist, we see in the logs:

Failed to get unit file state for nm-cloud-setup.service: No such file or directory

which is fine but it confuses a lot of users that believe that is the source of their problems.

We should find a better log to avoid that confusion

@brandond
Copy link
Member

I guess we could just redirect output of that command to /dev/null?

@manuelbuil
Copy link
Contributor Author

I guess we could just redirect output of that command to /dev/null?

Yes, that could be a good idea. Assuming the log will still be there if nm-cloud-setup.service exists

@brandond
Copy link
Member

We use the --quiet flag, which gives no output if it exists. Unfortunately it does not suppress the error if it doesn't exist.

@manuelbuil manuelbuil changed the title Replace confusing log Replace systemd confusing log Nov 13, 2023
@manuelbuil manuelbuil changed the title Replace systemd confusing log Replace confusing systemd log Nov 13, 2023
@manuelbuil manuelbuil self-assigned this Nov 13, 2023
@manuelbuil manuelbuil added this to the v1.26.11+k3s1 milestone Nov 13, 2023
@rancher-max rancher-max self-assigned this Feb 13, 2024
@rancher-max
Copy link
Contributor

Validated using latest install script

  • On a system that doesn't have these services:
$ journalctl -eu k3s -f
Feb 15 21:29:34 ip-172-31-40-199 sh[1907]: + /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service
Feb 15 21:29:34 ip-172-31-40-199 systemd[1]: Starting Lightweight Kubernetes...
  • On a system that does (and that should fail):
$ journalctl -eu k3s -f
Feb 15 21:30:12 ip-172-31-17-27.us-east-2.compute.internal systemd[1]: Starting Lightweight Kubernetes...
Feb 15 21:30:12 ip-172-31-17-27.us-east-2.compute.internal sh[16306]: + /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service
Feb 15 21:30:12 ip-172-31-17-27.us-east-2.compute.internal systemd[1]: k3s.service: Control process exited, code=exited, status=1/FAILURE
Feb 15 21:30:12 ip-172-31-17-27.us-east-2.compute.internal systemd[1]: k3s.service: Failed with result 'exit-code'.
Feb 15 21:30:12 ip-172-31-17-27.us-east-2.compute.internal systemd[1]: Failed to start Lightweight Kubernetes.

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

No branches or pull requests

4 participants