Skip to content

Podman detection times out in rust-build-release action causing workflow failure #96

@coderabbitai

Description

@coderabbitai

Description

The rust-build-release action is failing when attempting to detect Podman availability on GitHub Actions runners. The podman info command consistently times out after 10 seconds, causing the entire workflow to fail.

Error Details

The failure occurs in .github/actions/rust-build-release/src/main.py at line 114:

podman_present = runtime_available("podman")

The runtime_available function in runtime.py executes podman info with a 10-second timeout, but the command hangs and eventually times out:

TimeoutExpired: Command '['/usr/bin/podman', 'info']' timed out after 9.999988809000115 seconds

Impact

  • Workflow fails completely when Podman detection times out
  • Docker detection works fine (docker_present = True)
  • This prevents the rust-build-release action from completing successfully

Suspected Root Cause

The issue appears to be environmental rather than code-related:

  1. Podman service issues: Podman may not be properly initialized on the GitHub Actions runner
  2. Permission problems: The runner may lack sufficient permissions to query Podman
  3. Configuration issues: Podman configuration might be incomplete or corrupted
  4. Race conditions: Podman setup might not be complete when the detection runs

Potential Solutions

Short-term fixes:

  1. Increase timeout: Extend the 10-second timeout to allow more time for Podman to respond
  2. Graceful degradation: Make Podman detection non-blocking and continue with Docker if Podman fails
  3. Add retry logic: Implement retry mechanism for the Podman detection

Long-term solutions:

  1. Skip Podman detection: If Podman isn't critical, consider removing the detection entirely
  2. Better error handling: Add more specific error handling for different failure modes
  3. Conditional detection: Only check for Podman if explicitly needed

Recommended Fix

Modify the runtime_available function to handle timeouts gracefully and not fail the entire workflow:

def runtime_available(name: str, cwd: Optional[str] = None) -> bool:
    try:
        path = which(name)
        if path is None:
            return False
        
        result = run_validated(
            exec_path,
            ["info"],
            allowed_names=(name, f"{name}.exe"),
            timeout=10,
            cwd=cwd,
            stdout=subprocess.DEVNULL,
            stderr=subprocess.DEVNULL,
        )
        return result.returncode == 0
    except (UnexpectedExecutableError, subprocess.TimeoutExpired):
        return False  # Gracefully handle failures

Environment

  • OS: Ubuntu (GitHub Actions runner)
  • Podman: Available but unresponsive
  • Docker: Working correctly
  • Action: .github/actions/rust-build-release

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions