Skip to content

Detection issues with systemd services executing podman #277

@apollo13

Description

@apollo13

Hello, I am running a service (haproxy) via podman and systemd. When starting the service the node-agent complains a bit:

Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.484649 1067661 registry.go:359] calculated container id 1067710 -> /system.slice/haproxy.service -> /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.484882 1067661 container.go:1082] "started journald logparser" cg="/system.slice/haproxy.service"
Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.485665 1067661 registry.go:401] "detected a new container" pid=1067710 cg="/system.slice/haproxy.service" id="/system.slice/haproxy.service" app=""
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.638268 1067661 systemd.go:97] failed to get systemd properties: Unit name runtime is neither a valid invocation ID nor unit name.
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.638268 1067661 systemd.go:97] failed to get systemd properties: Unit name runtime is neither a valid invocation ID nor unit name.
Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.638307 1067661 registry.go:359] calculated container id 1067720 -> /system.slice/haproxy.service/runtime -> /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.638325 1067661 registry.go:386] id conflict: /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.638325 1067661 registry.go:386] id conflict: /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674612 1067661 systemd.go:97] failed to get systemd properties: Unit name libpod-payload-786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 is neither a valid invocation ID nor unit name.
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674612 1067661 systemd.go:97] failed to get systemd properties: Unit name libpod-payload-786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 is neither a valid invocation ID nor unit name.
Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.674650 1067661 registry.go:359] calculated container id 1067722 -> /system.slice/haproxy.service/libpod-payload-786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 -> /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674666 1067661 registry.go:386] id conflict: /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674666 1067661 registry.go:386] id conflict: /system.slice/haproxy.service
Jan 30 19:38:48 host coroot-node-agent[1067661]: I0130 19:38:48.829358 1067661 tls.go:132] pid=1067726 libssl_version=v3.5.1: libssl uprobes attached

Looking at systemd-cgls we get:

Control group /:
-.slice
└─system.slice (#63)
  ├─haproxy.service … (#31504)
  │ → user.invocation_id: b29b03321bbe457aa656379f5444f9ef
  │ → user.delegate: 1
  │ → trusted.invocation_id: b29b03321bbe457aa656379f5444f9ef
  │ → trusted.delegate: 1
  │ ├─libpod-payload-786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 (#31593)
  │ │ ├─1067722 /run/podman-init -- docker-entrypoint.sh -Ws -f /usr/local/etc/haproxy
  │ │ ├─1067724 haproxy -W -db -Ws -f /usr/local/etc/haproxy
  │ │ └─1067726 haproxy -W -db -Ws -f /usr/local/etc/haproxy
  │ └─runtime (#31579)
  │   └─1067720 /usr/bin/conmon --api-version 1 -c 786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 -u 786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 -r /usr/bin/crun -b /var/lib/containers/storage/overlay-c>

This is a result of running podman with --cgroups=split so the service cgroup is split and systemd can track the processes nicely. We can see how this causes problems for the node-agent from the logs:

Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.638268 1067661 systemd.go:97] failed to get systemd properties: Unit name runtime is neither a valid invocation ID nor unit name.
Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674612 1067661 systemd.go:97] failed to get systemd properties: Unit name libpod-payload-786f8b8d3873cd57e8c1313df53dc931ead2601b992bee96ff24ca6b20a43d31 is neither a valid invocation ID nor unit name.

The assumption in systemd.go about the unit name might be overly optimistic:

unit := parts[len(parts)-1]

Maybe it would make sense to iterate from the end and take the first part ending in ".service" or similar?

As a followup in the logs we then see:

Jan 30 19:38:48 host coroot-node-agent[1067661]: W0130 19:38:48.674666 1067661 registry.go:386] id conflict: /system.slice/haproxy.service

I am not sure if that is a result from the previous errors or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions