Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

RecoverStaleDirs: an unremovable stale temp dir reports Error on every store operation, but the operation succeeds #2401

Closed

Description

@brianegge

Summary

When RecoverStaleDirs cannot remove a stale temp dir, the failure is joined into a returned error and surfaces as Error: getting store info: ... on ordinary commands. The command then completes and prints its output normally, so the operation has in fact succeeded. The message repeats on every subsequent store operation indefinitely, and does not say what to do about it.

What I saw

A single podman ps -a invocation, printing the error and the container list together:

$ podman ps -a --format "{{.Names}}"
Error: getting store info: error removing stale temp dir: unlinkat /var/home/core/.local/share/containers/storage/overlay/tempdirs/temp-dir-489503836/1-<layer>/diff/usr/local/share/perl/5.34.0/OpenSRF/Transport/Redis/BusConnection.pm: permission denied
evergreen-rag_db_1
evergreen-rag_ollama_1
evergreen-rag_rag_1

This repeated on every store operation for about a month.

Cause, which was mine

I had written files into a container's layer with sudo — real root, outside the rootless user namespace — so when the container was removed, podman moved the layer to tempdirs/ and could not unlink the root-owned files or their parent directories. That part is my own misuse and I am not asking for it to be defended against.

Once I corrected ownership, podman reaped the directory on the next store operation with no further action:

$ sudo chown -R core:core .../tempdirs/temp-dir-489503836
$ podman ps -a --format "{{.Names}}"     # no error; directory gone

The part that seems worth separating from the cause

Removing a stale temp dir is best-effort garbage collection. Whatever makes it fail, the user's command still did what it was asked. Reporting it as Error: on an operation that succeeded is misleading, and because nothing self-heals, it recurs forever.

https://github.com/containers/storage/blob/main/internal/tempdir/tempdir.go

if rmErr := os.RemoveAll(tempDirPath); rmErr != nil && !os.IsNotExist(rmErr) {
    recoveryErrors = append(recoveryErrors, fmt.Errorf("error removing stale temp dir %s: %w", tempDirPath, rmErr))
}
...
return errors.Join(recoveryErrors...)

A warning that leaves the command's own exit status alone would read more accurately, and naming the directory as something safe to remove would make it actionable.

I have no reproducer that does not involve my own misuse, so treat the severity accordingly — I am reporting the handling, not claiming a defect in the cleanup itself.

Version

podman 5.8.1, rootless, overlay driver, Fedora CoreOS podman machine (applehv, aarch64).

🤖 Filed with Claude Code

Activity

  1. github-actions commented on Oct 7, 2026

    @github-actions

    This repository has been migrated to https://github.com/containers/container-libs. Please open your issue there.

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

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