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

Install script throws error on recent Linux kernels without cgroup v1 memory controller support #11829

Closed
sven-sverologos opened this issue Feb 21, 2025 · 1 comment
Assignees

Comments

@sven-sverologos
Copy link

Environmental Info:
k3s version v1.31.5+k3s1 (56ec5dd)
go version go1.22.10

Node(s) CPU architecture, OS, and Version:
Linux leela 6.13.1-1-default #1 SMP PREEMPT_DYNAMIC Mon Feb 3 05:33:25 UTC 2025 (1918d13) x86_64 x86_64 x86_64 GNU/Linux

Cluster Configuration:
single node

Describe the bug:
Recent openSUSE Tumbleweed kernels are compiled without cgroups v1 functions (CONFIG_MEMCG_V1 not set). This causes the cgroup v1 memory controller line to be absent from /proc/cgroups. Which in turn causes the install script to fail at line 1115, i.e.

if [ -f "/proc/cgroups" ] && [ "$(grep memory /proc/cgroups | while read -r n n n enabled; do echo $enabled; done)" -eq 0 ];

Here, "$(grep memory /proc/cgroups | while read -r n n n enabled; do echo $enabled; done)" will be empty, causing the -eq test to fail.

Steps To Reproduce:

  • Install K3s on recent openSUSE Tumbleweed

Expected behavior:
Install script succeeds

Actual behavior:
Install script throws error:
line 1115: [: : integer expression expected

Install does still appear to succeed though.

Additional context / logs:

@angel333
Copy link

angel333 commented Feb 22, 2025

This also applies to Alpine Linux, btw. The error looks a little different (it's BusyBox's shell) but it's the same thing.

~ # test "$(grep memory /proc/cgroups | while read -r n n n enabled; do echo $enabled; done)" -eq 0
sh: out of range

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

No branches or pull requests

3 participants