Bug 1661473 - unexpected return code on podman container ls
Summary: unexpected return code on podman container ls
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: podman
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-21 10:26 UTC by Menanteau Guy
Modified: 2019-01-10 18:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-10 18:33:18 UTC


Attachments (Terms of Use)

Description Menanteau Guy 2018-12-21 10:26:57 UTC
I got a return code 125 on command "podman container ls" when I expect rc=0

I did this test on the Fedora-Server-dvd-ppc64le-Rawhide-20181219.n.1.iso
[root@vm90 ~]# dnf list podman
Installed Packages
podman.ppc64le             2:0.12.2-11.dev.gitc8eaf59.fc30              @rawhide

I have a basic automatic test running with docker as well as with podman and I get different results.
Basic steps:
     # Pull fedora image
     podman image pull registry.fedoraproject.org/fedora

     # run container 
     podman run --name test -dt registry.fedoraproject.org/fedora:latest bash
 
     # check container is running 
     podman ps --filter status=running --format '{{.Image}}'

     # stop container
     podman stop test
 
     # check container is really not running
     podman ps --filter status=running --format '{{.Image}}'
     
     # check image is still there
     podman container ls -l --format '{{.Image}}'
 
     # delete image
     podman rm test    
 
     # check image is really deleted
     podman container ls -l --format '{{.Image}}'

On the last command I get a rc=125 when I expet  rc=0

hereafter is the podman try:
# Pull fedora image
[root@vm90 ~]# podman image pull registry.fedoraproject.org/fedora
[ 1307.788642] overlayfs: unrecognized mount option "nodev" or missing value
Trying to pull registry.fedoraproject.org/fedora...Getting image source signatures
Copying blob sha256:346563a723b2d5553a04f30a1e38a5401e65bcc9f6eb06e942f35c855da44481
 94.15 MB / 94.15 MB  20s
Copying config sha256:823cfe2dac4cf700183081643c9d9cb6cd5e569a0dadeb12c1bcddc417514e1d
 1.27 KB / 1.27 KB  0s
Writing manifest to image destination
Storing signatures
[ 1349.634485] exe (27270) used greatest stack depth: 7792 bytes left
823cfe2dac4cf700183081643c9d9cb6cd5e569a0dadeb12c1bcddc417514e1d
[root@vm90 ~]# echo $?
0

# run container 
 [root@vm90 ~]# podman run --name test -dt registry.fedoraproject.org/fedora:latest bash
[ 1392.004352] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 1392.022686] IPv6: ADDRCONF(NETDEV_UP): veth54901192: link is not ready
[ 1392.023453] cni0: port 1(veth54901192) entered blocking state
[ 1392.023542] cni0: port 1(veth54901192) entered disabled state
[ 1392.023879] device veth54901192 entered promiscuous mode
[ 1392.033577] IPv6: ADDRCONF(NETDEV_CHANGE): veth54901192: link becomes ready
[ 1392.033779] cni0: port 1(veth54901192) entered blocking state
[ 1392.033866] cni0: port 1(veth54901192) entered forwarding state
[ 1392.033998] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 1392.790666] SELinux: mount invalid.  Same superblock, different security settings for (dev mqueue, type mqueue)
bb7c447cd22fb114d52b912581ad645c3464f41640105bbfb76677988614d03e
[root@vm90 ~]# echo $?
0

# check container is running 
[root@vm90 ~]# podman ps --filter status=running --format '{{.Image}}'
registry.fedoraproject.org/fedora:latest
[root@vm90 ~]# echo $?
0

# stop container
[root@vm90 ~]# podman stop test
bb7c447cd22fb114d52b912581ad645c3464f41640105bbfb76677988614d03e
[root@vm90 ~]# [ 1436.064299] cni0: port 1(veth54901192) entered disabled state
[ 1436.091356] device veth54901192 left promiscuous mode
[ 1436.091422] cni0: port 1(veth54901192) entered disabled state
echo $?
0

# check container is really not running
[root@vm90 ~]# podman ps --filter status=running --format '{{.Image}}'
[root@vm90 ~]# echo $?
0

# check image is still there
[root@vm90 ~]# podman container ls -l --format '{{.Image}}'
registry.fedoraproject.org/fedora:latest
[root@vm90 ~]# echo $?
0

# delete image   
[root@vm90 ~]# podman rm test
bb7c447cd22fb114d52b912581ad645c3464f41640105bbfb76677988614d03e
[root@vm90 ~]# echo $?
0

# check image is really deleted
[root@vm90 ~]# podman container ls -l --format '{{.Image}}'
no such container
[root@vm90 ~]# echo $?
125

As you can see the last rc is 125.



hereafter the docker try:
# Pull fedora image
[root@vm90 ~]# docker image pull registry.fedoraproject.org/fedora
Using default tag: latest
Trying to pull repository registry.fedoraproject.org/fedora ... 
sha256:55db4945c1607db142dbc2ffad623566549b70a826bb10ed61b45fcd826350ed: Pulling from registry.fedoraproject.org/fedora
346563a723b2: Pull complete 
Digest: sha256:55db4945c1607db142dbc2ffad623566549b70a826bb10ed61b45fcd826350ed
Status: Downloaded newer image for registry.fedoraproject.org/fedora:latest
[root@vm90 ~]# echo $?
0

# run container 
[root@vm90 ~]# docker run --name test -dt registry.fedoraproject.org/fedora:latest bash
5cdd34d6ccf048111808786b6e51b403a1ecd922b8f5261f630bc999885a481f
[  936.135838] docker0: port 1(veth165fc6f) entered blocking state
[  936.135922] docker0: port 1(veth165fc6f) entered disabled state
[  936.136292] device veth165fc6f entered promiscuous mode
[  936.140669] IPv6: ADDRCONF(NETDEV_UP): veth165fc6f: link is not ready
[  936.635157] SELinux: mount invalid.  Same superblock, different security settings for (dev mqueue, type mqueue)
[  936.767081] eth0: renamed from veth5d8e0bb
[  936.787852] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  936.787997] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  936.788361] IPv6: ADDRCONF(NETDEV_CHANGE): veth165fc6f: link becomes ready
[  936.788614] docker0: port 1(veth165fc6f) entered blocking state
[  936.788703] docker0: port 1(veth165fc6f) entered forwarding state
[  936.788956] IPv6: ADDRCONF(NETDEV_CHANGE): docker0: link becomes ready
[root@vm90 ~]# echo $?
0

# check container is running 
[root@vm90 ~]# docker ps --filter status=running --format '{{.Image}}'
registry.fedoraproject.org/fedora:latest
[root@vm90 ~]# echo $?
0

# stop container
[root@vm90 ~]# docker stop test
[  988.424152] docker0: port 1(veth165fc6f) entered disabled state
[  988.427667] veth5d8e0bb: renamed from eth0
[  988.470488] docker0: port 1(veth165fc6f) entered disabled state
[  988.472997] device veth165fc6f left promiscuous mode
[  988.473064] docker0: port 1(veth165fc6f) entered disabled state
test
[root@vm90 ~]# echo $?
0

# check container is really not running
[root@vm90 ~]# docker ps --filter status=running --format '{{.Image}}'
[root@vm90 ~]# echo $?
0

# check image is still there
[root@vm90 ~]# docker container ls -l --format '{{.Image}}'
registry.fedoraproject.org/fedora:latest
[root@vm90 ~]# echo $?
0

# delete image
[root@vm90 ~]# docker rm test   
test
[root@vm90 ~]# echo $?
0

# check image is really deleted
[root@vm90 ~]# docker container ls -l --format '{{.Image}}'
[root@vm90 ~]# echo $?
0

Comment 1 Daniel Walsh 2019-01-10 16:42:32 UTC
Why do you think docker is correct?

You are asking for the last container created, since there is no container created, it returns an error.  I believe podman behaviour is correct and docker is broken.

Comment 2 Menanteau Guy 2019-01-10 17:21:03 UTC
hum, I guess you are right, podman return is correct. Docker returned like this a long time ago and I don't know why. I don't think podman want to be aligned on this. This depends of how much you want to match the two tools. I don't have any objection if you close this bug.

Comment 3 Brent Baude 2019-01-10 18:33:18 UTC
I'm inclined to close as not a bug ... if we need to revisit, please re-open.


Note You need to log in before you can comment on or make changes to this bug.