Skip to content

Podman: up can hang after "Container started" on create/recreate #1236

Open

Description

@KraXen72

Summary

devcontainer up can hang forever after printing Container started when using Podman and creating/recreating a container. It appears to be waiting for the Podman start event even though the container is already running.

Repro

DCMAN_SSH_PORT=56701 devcontainer up \
  --remove-existing-container \
  --skip-post-create \
  --no-lockfile \
  --docker-path podman \
  --update-remote-user-uid-default never \
  --workspace-folder /path/to/workspace

The workspace a .devcontainer.json very similar to this (some stuff removed). --skip-post-create still reproduces the hang, so postCreateCommand does not appear to be the cause.

{
  "name": "Fedora Sandbox",
  "image": "ghcr.io/kraxen72/fedora-toolchain-base:latest",
  "postCreateCommand": "pnpm add -g typescript npm-check-updates degit repomix @devcontainers/cli",
  "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/workspaces/${localWorkspaceFolderBasename},type=bind,Z",
  "workspaceFolder": "/home/vscode/workspaces/${localWorkspaceFolderBasename}",
  "features": {
    "ghcr.io/kraxen72/devcontainer-features/common-utils-bash-prompt:1": {},
    "ghcr.io/kraxen72/devcontainer-features/pnpm:1": {},
    "ghcr.io/kraxen72/devcontainer-features/codex-cli:1": { "version": "latest", "autoUpdate": true },
    "ghcr.io/kraxen72/devcontainer-features/copilot-cli:1": { "version": "latest", "autoUpdate": true },
    "ghcr.io/kraxen72/devcontainer-features/ssh-zed:2": {}
  },
  "runArgs": [
    "--name=dcman_${localWorkspaceFolderBasename}",
    "--publish=127.0.0.1:${localEnv:DCMAN_SSH_PORT}:2222",
    "--cap-drop=ALL",
    "--cap-add=SETUID",
    "--cap-add=SETGID",
    "--security-opt=no-new-privileges",
    "--tmpfs=/tmp:exec,mode=1777",
    "--pids-limit=2048",
    "--ulimit=nproc=2048:2048",
    "--ulimit=nofile=65536:65536"
  ],
  "remoteUser": "vscode",
  "updateRemoteUserUID": true
}

Expected

After Container started, the CLI should inspect/setup the running container and continue to user commands or finish.

Actual

The CLI hangs after:

Start: Run: podman run ...
Container started

Process inspection shows a live podman events --format json --filter event=start child and the attached podman run child. The container is running and podman events --since ... --filter event=start shows the matching start event with the expected devcontainer.local_folder / devcontainer.config_file labels.

Existing-container devcontainer up completes. --skip-post-create still hangs, so this is before post-create. Running with --log-level debug or trace often makes it pass, which looks like a timing race in the event listener setup.

Versions tested

  • @devcontainers/cli 0.87.0 and 0.86.0
  • Podman 5.8.2
  • Node 24.15.0 and 22.22.3
  • Fedora 43 / Linux 7.0.4

Activity

  1. jankap commented on Sep 9, 2026

    @jankap

    Can confirm.

  2. bvarner commented on Nov 2, 2026

    @bvarner

    Just ran into this one. podman on macos.

  3. simonambler commented on Nov 9, 2026

    @simonambler

    This happens for me as well.

    Microsoft.WSL 3.0.3.0, Podman.CLI 6.1.4, RedHat.Podman-Desktop 1.30.5, Microsoft.VisualStudioCode 1.143.1
    
  4. thosch1800 commented on Nov 25, 2026

    @thosch1800

    I'm seeing this on Win11 with Podman 6.2.0 and DevContainer CLI 0.90.0. In a small local test, startup stalled twice in four attempts while the container was already running. A matching start event was present in podmans event history.

  5. reimer-atb commented on Nov 25, 2026

    @reimer-atb

    Still happens on Arch Linux with Podman 6.2.1 and DevContainer CLI 0.91.0

  6. z002Holpp commented on Nov 25, 2026

    @z002Holpp

    Same here. Win11, Podman 6.2.0, DevContainer CLI 0.90.0.
    Would appreciate a fix, this thing is becoming a blocker for me.

  7. parched commented on Nov 26, 2026

    @parched

    I'm hitting this too, Claude says

    Same hang on Linux with rootless Podman, through VS Code:

    • Fedora 44, kernel 7.3
    • Podman 5.8.9, events_logger = "journald" (the default)
    • Dev Containers extension 0.481.0, which bundles CLI 0.91.0
    • Dockerfile-based config, image fully cached

    The log ends here and nothing follows:

    [19:37:31.314Z] Start: Run: podman events --format json --filter event=start
    [19:37:31.316Z] Start: Starting container
    [19:37:31.316Z] Start: Run: podman run --sig-proxy=false -a STDOUT -a STDERR ...
    [19:37:31.402Z] Container started
    

    The container is running, and its start event is in Podman's history (podman events --since 40m --stream=false --filter event=start lists it). The podman events process the CLI spawned is still alive but never delivered the event.

    The timing suggests a subscribe race rather than lost events: startEventSeen returns as soon as the podman events process is spawned, podman run follows 2 ms later, and with a cached image the container is up about 85 ms after that. With the journald backend, podman events can take longer than that to start following the journal, so the event is written before anyone is listening. #1269 described the same race on Docker; it was closed for inactivity rather than fixed.

    Whatever the cause, log rotation or the subscribe race, the polling fallback in #1363 would cover it, since it checks for the container by label instead of relying on the event arriving.

  8. cdcxd commented on Nov 26, 2026

    @cdcxd

    I'm hitting this too, Claude says

    Same hang on Linux with rootless Podman, through VS Code:

    • Fedora 44, kernel 7.3
    • Podman 5.8.9, events_logger = "journald" (the default)
    • Dev Containers extension 0.481.0, which bundles CLI 0.91.0
    • Dockerfile-based config, image fully cached

    The log ends here and nothing follows:

    [19:37:31.314Z] Start: Run: podman events --format json --filter event=start
    [19:37:31.316Z] Start: Starting container
    [19:37:31.316Z] Start: Run: podman run --sig-proxy=false -a STDOUT -a STDERR ...
    [19:37:31.402Z] Container started
    

    The container is running, and its start event is in Podman's history (podman events --since 40m --stream=false --filter event=start lists it). The podman events process the CLI spawned is still alive but never delivered the event.
    The timing suggests a subscribe race rather than lost events: startEventSeen returns as soon as the podman events process is spawned, podman run follows 2 ms later, and with a cached image the container is up about 85 ms after that. With the journald backend, podman events can take longer than that to start following the journal, so the event is written before anyone is listening. #1269 described the same race on Docker; it was closed for inactivity rather than fixed.
    Whatever the cause, log rotation or the subscribe race, the polling fallback in #1363 would cover it, since it checks for the container by label instead of relying on the event arriving.

    The subscriber race looks real, I can reproduce it with a fake runtime.

    My test with podman got it ready before subscribe, yet it still reproduced the issue.

    So there are at least 2 reasons. The PR did not solve the subscriber race directly.

    The log rotation cause only applies to events_logger="file". Hanging with events_logger="journald" can't be caused by log rotation issue.

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

Metadata

Metadata

Assignees

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