crun icon indicating copy to clipboard operation
crun copied to clipboard

Inconsistent Error Reporting: runc vs crun for Stopped Containers

Open sohankunkerkar opened this issue 1 year ago • 1 comments
trafficstars

Description:

When attempting to kill a container that is not running, runc returns an error message indicating that the "container not running," while crun returns an error message stating "open pidfd: No such process." This inconsistency can lead to confusion for users who expect similar behavior from both runtimes.

Steps to Reproduce:

  1. Create a container using either runc or crun.
  2. Stop the container.
  3. Attempt to kill the stopped container using the respective command.

Expected Behavior:

crun should return a consistent error message indicating that the container is not running when attempting to kill a stopped container.

Actual Behavior:

  • runc Output:
Error: container not running
  • crun Output:
open pidfd: No such process

xref: https://github.com/cri-o/cri-o/pull/8434

sohankunkerkar avatar Aug 06 '24 18:08 sohankunkerkar

consistency with runc error messages is not a goal, but I agree the error could be improved. Would you like to open a PR to address it?

giuseppe avatar Aug 07 '24 09:08 giuseppe