DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

permission denied on key "vm.overcommit_memory" in LXC container on update to v9.13

Open jwgn opened this issue 7 months ago • 2 comments

Creating a bug report/issue

  • [X ] I have searched the existing open and closed issues

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9 G_DIETPI_VERSION_SUB=12 G_DIETPI_VERSION_RC=1 G_GITBRANCH='master' G_GITOWNER='MichaIng'
  • Distro version | bookworm
  • Kernel version | Linux nextcloud 6.8.12-10-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-10 (2025-04-18T07:39Z) x86_64 GNU/Linux
  • SBC model | Container (x86_64) on Proxmox
  • Power supply used | none
  • SD card used | none

Additional Information (if applicable)

  • Software title | Nextcloud
  • Was the software title installed freshly or updated/migrated? = Update
  • Can this issue be replicated on a fresh installation of DietPi?
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. Run dietpi-update on nextcloud container

Expected behaviour

  • Upgrade to v9.13 should take place

Actual behaviour

  OK  ] DietPi-Patch | eval echo 'vm.overcommit_memory=1' > /etc/sysctl.d/98-dietpi-redis.conf
[.     ]sysctl: permission denied on key "vm.overcommit_memory".conf
[FAILED] DietPi-Patch | sysctl -p /etc/sysctl.d/98-dietpi-redis.conf
[FAILED] DietPi-Patch | Unable to continue, DietPi-Patch will now terminate.
[FAILED] DietPi-Update | An error occurred during incremental patching. Please check the above log or /var/tmp/dietpi/logs/dietpi-update.log for errors, and rerun "dietpi-update" after the cause has been solved.

Extra details

  • ...

jwgn avatar May 26 '25 08:05 jwgn

Oh that makes sense. In containers, sysctl can generally not work. This is something that would need to be applied on the host. For the update, for now, please use "Change command" and place it with : (colon) or true.

I'll push a live patch to skip this on container systems.

MichaIng avatar May 26 '25 12:05 MichaIng

Live patch merged, so the update will now go through, as well as fresh installs of affected software options: https://github.com/MichaIng/DietPi/pull/7552

However, for next release, we need to implement a warning that respective sysctl settings change is required or recommended, for the software to work properly, and should hence be done at the host system.

Means in your case, check whether sysctl vm.overcommit_memory reports 1 on the host (can be also tested in the guest), else you can do so:

echo 'vm.overcommit_memory=1' | sudo tee /etc/sysctl.d/98-dietpi-redis.conf
sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf

MichaIng avatar May 26 '25 14:05 MichaIng

Properly fixed now for next release: https://github.com/MichaIng/DietPi/commit/1dd3290 When sysctl would be called, but it is a container system, a dialogue will show the changes needed/recommended to be done on the host.

MichaIng avatar Jun 08 '25 23:06 MichaIng