Skip to content

Problems with containers started with --detach=True #174

Closed

Description

@aylen384
./target/debug/podlet generate pod --ignore-infra-conmon-pidfile --ignore-pod-id-file pod-freshrss
Error:
   0: error creating Quadlet file(s) from an existing object
   1: error inspecting one of the pod's containers
   2: error parsing Podman container command from `["podman", "container", "run", "--name", "freshrss", "--env", "TZ=Europe/Berlin", "--env", "CRON_MIN=0,15,30,45", "--env", "FRESHRSS_ENV=production", "--env", "LISTEN=0.0.0.0:8065", "--env", "TRUSTED_PROXY=127.0.0.1", "--env", "OIDC_ENABLED=1", "--env", "OIDC_PROVIDER_METADATA_URL=foo", "--env", "OIDC_CLIENT_ID=bar", "--env", "OIDC_CLIENT_SECRET=baz", "--env", "OIDC_X_FORWARDED_HEADERS=X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host", "--env", "OIDC_SCOPES=openid email profile", "--env", "FRESHRSS_USER=--email a@b.c\n--language de\n--password \"blub\"\n--user dings", "--label", "io.containers.autoupdate=image", "--pod", "pod-freshrss", "--volume", "/var/local/freshrss/data:/var/www/FreshRSS/data", "--volume", "/var/local/freshrss/extensions:/var/www/FreshRSS/extensions", "--detach=True", "docker.io/freshrss/freshrss:1.26.3"]`
   3: error: unexpected value 'True' for '--detach' found; no more were expected

Activity

  1. TheRealBecks commented on Feb 8, 2026

    @TheRealBecks
    Collaborator

    @aylen384 Thank you for your report! Can you please also add your compose.yaml file so we can replicate the issue?

  2. added
    help wantedExtra attention is needed
    questionFurther information is requested
    and removed
    help wantedExtra attention is needed
    on Feb 8, 2026
  3. aylen384 commented on Feb 8, 2026

    @aylen384
    Author
  4. aylen384 commented on Feb 8, 2026

    @aylen384
    Author

    Example .service file:

    # /etc/systemd/system/container-synapse.service
    # container-synapse.service
    # autogenerated by Podman 4.3.1
    # Tue Feb  3 17:42:44 CET 2026
    
    [Unit]
    Description=Podman container-synapse.service
    Documentation=man:podman-generate-systemd(1)
    Wants=network-online.target
    After=network-online.target
    RequiresMountsFor=%t/containers
    BindsTo=pod-pod-matrix.service
    After=pod-pod-matrix.service
    
    [Service]
    Environment=PODMAN_SYSTEMD_UNIT=%n
    Restart=on-failure
    TimeoutStopSec=70
    ExecStartPre=/bin/rm \
            -f %t/%n.ctr-id
    ExecStart=/usr/bin/podman container run \
            --cidfile=%t/%n.ctr-id \
            --cgroups=no-conmon \
            --rm \
            --pod-id-file %t/pod-pod-matrix.pod-id \
            --sdnotify=conmon \
            --replace \
            --name synapse \
            --env SYNAPSE_SERVER_NAME=fooobar.de \
            --env SYNAPSE_REPORT_STATS=False \
            --env SYNAPSE_HTTP_PORT=8008 \
            --label io.containers.autoupdate=image \
            --volume /opt/matrix/synapse:/data \
            --detach=True docker.io/matrixdotorg/synapse:v1.146.0
    ExecStop=/usr/bin/podman stop \
            --ignore -t 10 \
            --cidfile=%t/%n.ctr-id
    ExecStopPost=/usr/bin/podman rm \
            -f \
            --ignore -t 10 \
            --cidfile=%t/%n.ctr-id
    Type=notify
    NotifyAccess=all
  5. TheRealBecks commented on Feb 8, 2026

    @TheRealBecks
    Collaborator

    @k9withabone That code line uses skip_serializing instead of skip_serializing_if - is that a problem when inserting detach=True into the parser instead of detach?

    detach: bool,

  6. added
    bugSomething isn't working
    and removed
    questionFurther information is requested
    on Feb 8, 2026
  7. added this to the v0.3.2 milestone on Feb 8, 2026
  8. k9withabone commented on Feb 8, 2026

    @k9withabone
    Member

    That code line uses skip_serializing instead of skip_serializing_if - is that a problem when inserting detach=True into the parser instead of detach?

    No, those options are for when the struct is serialized into arguments for the value of the PodmanArgs= Quadlet option. The reason skip_serializing is used here instead of skip_serializing_if is, as stated in the comments, that Quadlet automatically adds --detach to the output in the generated .service file.

    The problem here is with parsing --detach=True as opposed to just --detach. It needs to be set up like --tls-verify:

    /// Require HTTPS and verify certificates when contacting registries
    #[arg(long, num_args = 0..=1, require_equals = true, default_missing_value = "true")]
    tls_verify: Option<bool>,

  9. self-assigned this
    on Feb 8, 2026
  10. added a commit that references this issue on Feb 9, 2026
    e2da561
  11. added a commit that references this issue on Mar 9, 2026
    17d9f36
  12. added a commit that references this issue on Apr 11, 2026
    ad595db
  13. rp86 commented on Jun 11, 2026

    @rp86

    I think this is still failing for podman run commands using '-d' instead of '--detach=True':
    error: equal sign is needed when assigning values to '--detach=<DETACH>'

  14. dcermak commented on Sep 15, 2026

    @dcermak

    I think this is still failing for podman run commands using '-d' instead of '--detach=True': error: equal sign is needed when assigning values to '--detach=<DETACH>'

    This is still an issue btw

  15. cyqsimon commented on Sep 21, 2026

    @cyqsimon

    Just ran into this today. It just needs a num_args = 0..=1 to make Clap mirror Cobra's boolean flag parsing behaviour.

    Should be fixed in #229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions