podman icon indicating copy to clipboard operation
podman copied to clipboard

quadlet-generator produces MemoryReservation key triggering "Unknown key" warning in systemd 259

Open upmcplanetracker opened this issue 5 months ago • 2 comments

Issue Description

When using Podman Quadlet to generate a service from a .container file, the quadlet-generator injects MemoryReservation=64M into the [Service] section of the generated unit file. Although MemoryReservation is a valid systemd directive (an alias for MemoryLow), it triggers a persistent "Unknown key" warning in my user-instance systemd logs.

Log output: /run/user/1000/systemd/generator/immich-public-proxy.service:32: Unknown key 'MemoryReservation' in section [Service], ignoring.

Steps to reproduce the issue

Create a .container file (e.g., immich-public-proxy.container) in ~/.config/containers/systemd/.

Include the following in the [Service] section:

[Service]
MemoryReservation=64M

Run systemctl --user daemon-reload.

Observe the warning in the journal: journalctl --user -u immich-public-proxy.service.

I have only seen it so far with immich-public-proxy, https://github.com/alangrainger/immich-public-proxy

Describe the results you received

The container service starts and runs as expected, but every time the unit is loaded or reloaded, systemd emits the following warning:

Unknown key 'MemoryReservation' in section [Service], ignoring.

Describe the results you expected

The service should load without log warnings. Given that MemoryReservation is technically an alias for MemoryLow, it would be ideal if the Quadlet generator either utilized the modern MemoryLow key or verified compatibility with the user-instance systemd to avoid this log noise.

podman info output

host:
  arch: amd64
  buildahVersion: 1.42.1
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.13+ds1-2_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: unknown'
  cpuUtilization:
    idlePercent: 84.41
    systemPercent: 1.66
    userPercent: 13.92
  cpus: 16
  databaseBackend: sqlite
  distribution:
    codename: resolute
    distribution: ubuntu
    version: "26.04"
  eventLogger: journald
  freeLocks: 2003
  hostname: pihole1
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 992
      size: 1
    - container_id: 2
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 7.0.0-22-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 11492712448
  memTotal: 65607725056
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns_1.16.0-3_amd64
      path: /usr/lib/podman/aardvark-dns
      version: aardvark-dns 1.16.0
    package: netavark_1.16.1-3.1_amd64
    path: /usr/lib/podman/netavark
    version: netavark 1.16.1
  ociRuntime:
    name: crun
    package: crun_1.21-1ubuntu3_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.21
      commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt_0.0~git20260120.386b5f5-1_amd64
    version: |
      pasta 0.0~git20260120.386b5f5-1
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.3.3-1_amd64
    version: |-
      slirp4netns version 1.3.3
      commit: 944fa94090e1fd1312232cbc0e6b43585553d824
      libslirp: 4.9.1
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.6.0
  swapFree: 32803860480
  swapTotal: 32803860480
  uptime: 68h 54m 29.00s (Approximately 2.83 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/redacted/.config/containers/storage.conf
  containerStore:
    number: 37
    paused: 0
    running: 37
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/redacted/.local/share/containers/storage
  graphRootAllocated: 1966736678912
  graphRootUsed: 1133561225216
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 50
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/redacted/.local/share/containers/storage/volumes
version:
  APIVersion: 5.7.0
  BuildOrigin: Ubuntu
  Built: 1771860932
  BuiltTime: Mon Feb 23 10:35:32 2026
  GitCommit: ""
  GoVersion: go1.25.0
  Os: linux
  OsArch: linux/amd64
  Version: 5.7.0

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

I have reviewed the release notes for versions 5.7.0 through 5.8.3 and the issue persists/is not addressed in the changelogs.

Host OS: Ubuntu 26.04
systemd version: 259.5-0ubuntu3 (verified via systemctl --user --version)

Additional information

I initially encountered this while migrating an Immich-Public-Proxy Docker Compose setup to Podman Quadlet. Manually editing the generated file in /run/user/1000/systemd/generator/ to use MemoryLow=64M instead of MemoryReservation=64M successfully resolves the warning, which confirms that the underlying systemd instance recognizes MemoryLow but is rejecting the MemoryReservation alias for this specific user-instance configuration.

I realize that this is more of a cosmetic issue than anything else. Thank you.

upmcplanetracker avatar Jun 18 '26 19:06 upmcplanetracker

In the first paragraph you wrote:

the quadlet-generator injects MemoryReservation=64M into the [Service] section of the generated unit file

But, in the steps you wrote:

Include the following in the [Service] section:

So, it's unclear if you are saying that Quadlet adds this line on its own or just copies what you added.

I've looked at the code and run some examples. This line was not added by Quadlet unless I had it in my .container file. So, it seems to be the former. It is added because you add it. If that's the case, and the correct key is MemoryLow why not just use it?

BTW from what I can tell, MemoryReservation is a cgroupv1 parameter while Ubuntu 26.04 uses cgroupv2 by default which no longer supports this value. So, maybe its alias functionality no longer exists. In any case, it does not seem like a Quadlet issue.

ygalblum avatar Jun 19 '26 00:06 ygalblum

Oh shoot. Now I feel stupid. This is 100 percent something I did. My computer was crashing and this was the last container I spun up before the crashes started so I created a debug container that hard logged to my nas in case of crash. I thought I copied over the .container to a podman run command but I obviously blew the clock syntax but not enough to have it not run.

I couldn't figure out for the life of me where that came from, but what you said made it all clear!

Ugh.

I'll close the issue. This was an error by the unit between the chair and keyboard.

Thanks for being so gentle, Ygal.

I'll close it.

On Thu, Jun 18, 2026, 8:35 PM Ygal Blum @.***> wrote:

ygalblum left a comment (podman-container-tools/podman#28972) https://github.com/podman-container-tools/podman/issues/28972#issuecomment-4747247595

In the first paragraph you wrote:

the quadlet-generator injects MemoryReservation=64M into the [Service] section of the generated unit file

But, in the steps you wrote:

Include the following in the [Service] section:

So, it's unclear if you are saying that Quadlet adds this line on its own or just copies what you added.

I've looked at the code and run some examples. This line was not added by Quadlet unless I had it in my .container file. So, it seems to be the former. It is added because you add it. If that's the case, and the correct key is MemoryLow why not just use it?

BTW from what I can tell, MemoryReservation is a cgroupv1 parameter while Ubuntu 26.04 uses cgroupv2 by default which no longer supports this value. So, maybe its alias functionality no longer exists. In any case, it does not seem like a Quadlet issue.

— Reply to this email directly, view it on GitHub https://github.com/podman-container-tools/podman/issues/28972?email_source=notifications&email_token=BUKFPFDH3LKUMMVDBWNEKDL5ASDEZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUG4ZDINZVHE22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4747247595, or unsubscribe https://github.com/notifications/unsubscribe-auth/BUKFPFBFUEIRWVIPMN55PED5ASDEZAVCNFSNUABFKJSXA33TNF2G64TZHMYTAOJRGQ2TKNJTHNEXG43VMU5TINRZGU2TAOBSGYZ2C5QC . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/BUKFPFCALEV7HKCJ2KQJXQL5ASDEZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUG4ZDINZVHE22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG and Android https://github.com/notifications/mobile/android/BUKFPFDSOPGV7N46Q2V56VD5ASDEZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUG4ZDINZVHE22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA. Download it today! You are receiving this because you authored the thread.Message ID: @.***>

upmcplanetracker avatar Jun 19 '26 00:06 upmcplanetracker