Bug 1088259 - "docker top all" doesn't show processes when --tty=false
Summary: "docker top all" doesn't show processes when --tty=false
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: docker-io
Version: 22
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Sally
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1096286
TreeView+ depends on / blocked
 
Reported: 2014-04-16 10:30 UTC by Lukáš Doktor
Modified: 2015-06-02 15:54 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
: 1096286 (view as bug list)
Environment:
Last Closed: 2015-06-02 15:54:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukáš Doktor 2014-04-16 10:30:48 UTC
Description of problem:
Hi guys, when I run docker with --tty=false, the `docker top $NAME all` doesn't show any processes (just headers). When using only `docker top $NAME` it shows them...

Also the `ps` command inside container works, but `ps all` does not.

Version-Release number of selected component (if applicable):
docker-io-0.9.0-3.fc20.x86_64


How reproducible:
always

Steps to Reproduce:
1. docker run -i --tty=false fedora bash
2. docker logs $NAME

Actual results:
F                   UID                 PID                 PPID                PRI                 NI                  VSZ                 RSS                 WCHAN               STAT                TTY                 TIME                COMMAND

Expected results:
F                   UID                 PID                 PPID                PRI                 NI                  VSZ                 RSS                 WCHAN               STAT                TTY                 TIME                COMMAND
1                   0                   24006               23954               20                  0                   11732               540                 -                   R                   pts/14              0:00                bash

Comment 1 Lukáš Doktor 2014-05-05 07:41:35 UTC
Can't reproduce with the upstream Docker version 0.10.0, build dc9c28f/0.10.0 top doesn't work at all (due of https://bugzilla.redhat.com/show_bug.cgi?id=1088125 )

Comment 2 Lukáš Doktor 2014-05-05 07:46:07 UTC
OK I moved it to the old cgroup location and the results are the same. So booth, fedora docker-io-0.9.0-3.fc20.x86_64 and upstream dc9c28f/0.10.0 are unable to list processes using `all` argument in non-tty mode.

Comment 3 Daniel Walsh 2014-05-28 18:18:34 UTC
Your description is not very good, but it seems to work for me in the latest build.

# docker run -i --tty=false fedora sleep 1000 &

# docker top f6346258a527 -x
PID                 TTY                 STAT                TIME                COMMAND
8597                ?                   Ss                  0:00                sleep 1000
# docker top f6346258a527 -Z
LABEL                                             PID                 TTY                 TIME                CMD
system_u:system_r:svirt_lxc_net_t:s0:c203,c1020   8597                ?                   00:00:00            sleep

Comment 4 Lukáš Doktor 2014-05-29 12:50:34 UTC
I'm sorry there is a typo in reproducer:

Steps to Reproduce:
1. docker run -i --tty=false fedora bash
2. docker top $NAME all

The all is important and it generates the same results with docker-0.11.1-6.el7.x86_64 (so no processes listed when "docker top $NAME all" is used, it works fine with "docker top $NAME" and "docker top $NAME -x").

Comment 5 Lukáš Doktor 2014-05-29 12:58:02 UTC
btw using "docker run -i --tty=false fedora sleep 1000 &" leads to the same problem mentioned here:

https://bugzilla.redhat.com/show_bug.cgi?id=1096273

only it's repeating TTIN signals until I reattach it.

Comment 6 Daniel Walsh 2014-05-29 19:20:34 UTC
I am not familiar with all,  I guess this is just the same as ps al, all processes in long format?

Comment 7 Daniel Walsh 2014-05-29 19:22:19 UTC
Perhaps it does not support any bsd options.

Comment 8 Lukáš Doktor 2014-06-02 06:33:47 UTC
Hi Daniel, I probably didn't emphasize the `--tty=False` enough. The problem is, that with `--tty=true` these commands works fine (the only requirement is keep headers and have PID in it).

Comment 9 Lukáš Doktor 2014-06-03 15:35:00 UTC
RHEL version seems to be fixed now ( https://bugzilla.redhat.com/show_bug.cgi?id=1096286 ), but fedora's docker-io-0.11.1-7.fc20.x86_64 still has this (and the cgroup path) problem.

Comment 10 Daniel Walsh 2014-06-03 20:36:52 UTC
Ok lokesh lets push a new version to f20 when on the next update.

Comment 11 Lukáš Doktor 2014-07-18 08:51:40 UTC
Hi Daniel, today I retested this on the latest docker-io-1.0.0-6.fc20.x86_64 and docker-1.0.0-10.el7.x86_64, booth are failing again:

# TERM1
docker run -i --tty=false fedora bash
sleep 1000

# TERM2
docker top a29 all
F                   UID                 PID                 PPID                PRI                 NI                  VSZ                 RSS                 WCHAN               STAT                TTY                 TIME                COMMAND

docker top a29
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                20226               1329                0                   09:45               ?                   00:00:00            bash
root                20409               20226               0                   09:49               ?                   00:00:00            sleep 1000

as you can see with `docker top ... all` no processes are shown, only headers. When `tty=true` it works fine.

Comment 12 Lukáš Doktor 2014-07-18 08:57:25 UTC
^^ the last message is maybe a bit confusing. On the output you can see, that `docker top $id all` doesn't show any processes while `docker top $id` does.

The other sentence about `tty=true` is not visible from the output, but I verified it works in different run...

Comment 13 Daniel Walsh 2014-09-15 19:59:24 UTC
Any change in docker-1.2?

Comment 14 Lukáš Doktor 2014-09-29 08:43:31 UTC
`docker top $id all` still doesn't work on containers without tty on docker-1.2.0-19.el7.x86_64

Comment 15 Daniel Walsh 2015-03-10 00:33:27 UTC
Lukas any miracle if this has been fixed in docker-1.5

Comment 16 Lukáš Doktor 2015-03-10 12:46:50 UTC
Hi Dan, I moved back to qemu, Chris, could you please verify that `docker top $name all` produces only the header and no processes? (without the all it lists all processes correctly)

Comment 18 Chris Evich 2015-03-10 13:52:22 UTC
Dan,

This issue still reproduces in both docker-1.4.1-37.el7.x86_64 and docker-1.5.0-16.el7.x86_64 with and without --tty (as described above).

Comment 19 Fedora End Of Life 2015-05-29 11:35:27 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 20 Sally 2015-06-02 15:35:18 UTC
Docker top shares options with ps, not docker ps.
(See man ps)
To list all processes, type `docker top $id -A` per man ps

Comment 21 Sally 2015-06-02 15:47:03 UTC
Also, `docker top $id -A` is identical to `docker top $id -e`

Comment 22 Chris Evich 2015-06-02 15:54:46 UTC
Thanks for the info, we can close this then.


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