Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When you execute `docker attach` on a container, which is in the process of shutting down, the process doesn't fail, but hangs for ever.
Even when you remove (`docker rm`) the container afterwards, the process still exists and when you use eg. ctrl+c, it complains about missing container.
When you have stdin attached, it finishes after an input, otherwise you have to use `kill -9` to get rid of it.
Version-Release number of selected component (if applicable):
docker-0.11.1-10.el7.x86_64
docker-io-1.0.0-3.fc20.x86_64
How reproducible:
rarely on RHEL7 (0.11.1), always on Fedora 20 (1.0.0-3)
Steps to Reproduce:
1. in 1st terminal execute: "while :; do sudo docker -D attach `sudo docker ps -l -q`; done"
2a. in 2nd terminal execute: "docker run -i -t fedora bash" and when the first terminal attaches, use `exit` or `ctrl+d` to stop the container.
2b. when the 2a doesn't causes the bug, use this script to start-stop containers in a loop: "while :; do ID=`docker run -d -i -t fedora bash`; sleep 1; echo exit | docker attach $ID; done"
Actual results:
On Fedora after step 2a the attach process in 1st terminal hangs, there is no new input.
On RHEL after a while while executing the 2b script, the attach process in 1st terminal hangs.
Expected results:
The attach process in 1st terminal should finish when the container is destroyed and lots of messages like:
2014/06/26 15:29:55 You cannot attach to a stopped container, start it first
2014/06/26 15:29:55 You cannot attach to a stopped container, start it first
2014/06/26 15:29:55 You cannot attach to a stopped container, start it first
2014/06/26 15:29:55 You cannot attach to a stopped container, start it first
should occur (as we are trying to attach stopped container).
Additional info:
When you use `docker attach --no-stdin ...` you can write anything. After a ctrl+c it realizes the container is not running and finishes. ctrl+p+q doesn't work. In RHEL version when you remove the container by `docker rm` first, ctrl+c generates message in docker daemon, that the container with id ... doesn't exist and the `docker attach` process is still hanged.
When you have stdin attached, after sending any character the process is destoyed with:
[debug] hijack.go:96 [hijack] End of stdout
2014/06/26 15:49:31 You cannot attach to a stopped container, start it first
With docker-1.4.1-27.el7.x86_64,
run the script
# cat 1113608.sh
# /bin/bash
while :; do ID=`docker run -d -i -t rhel7 bash`; sleep 1; echo exit | docker attach $ID; done
generated
FATA[0000] cannot enable tty mode on non tty input
FATA[0000] cannot enable tty mode on non tty input
no hang here, so move to verify
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHSA-2015-0623.html
Description of problem: When you execute `docker attach` on a container, which is in the process of shutting down, the process doesn't fail, but hangs for ever. Even when you remove (`docker rm`) the container afterwards, the process still exists and when you use eg. ctrl+c, it complains about missing container. When you have stdin attached, it finishes after an input, otherwise you have to use `kill -9` to get rid of it. Version-Release number of selected component (if applicable): docker-0.11.1-10.el7.x86_64 docker-io-1.0.0-3.fc20.x86_64 How reproducible: rarely on RHEL7 (0.11.1), always on Fedora 20 (1.0.0-3) Steps to Reproduce: 1. in 1st terminal execute: "while :; do sudo docker -D attach `sudo docker ps -l -q`; done" 2a. in 2nd terminal execute: "docker run -i -t fedora bash" and when the first terminal attaches, use `exit` or `ctrl+d` to stop the container. 2b. when the 2a doesn't causes the bug, use this script to start-stop containers in a loop: "while :; do ID=`docker run -d -i -t fedora bash`; sleep 1; echo exit | docker attach $ID; done" Actual results: On Fedora after step 2a the attach process in 1st terminal hangs, there is no new input. On RHEL after a while while executing the 2b script, the attach process in 1st terminal hangs. Expected results: The attach process in 1st terminal should finish when the container is destroyed and lots of messages like: 2014/06/26 15:29:55 You cannot attach to a stopped container, start it first 2014/06/26 15:29:55 You cannot attach to a stopped container, start it first 2014/06/26 15:29:55 You cannot attach to a stopped container, start it first 2014/06/26 15:29:55 You cannot attach to a stopped container, start it first should occur (as we are trying to attach stopped container). Additional info: When you use `docker attach --no-stdin ...` you can write anything. After a ctrl+c it realizes the container is not running and finishes. ctrl+p+q doesn't work. In RHEL version when you remove the container by `docker rm` first, ctrl+c generates message in docker daemon, that the container with id ... doesn't exist and the `docker attach` process is still hanged. When you have stdin attached, after sending any character the process is destoyed with: [debug] hijack.go:96 [hijack] End of stdout 2014/06/26 15:49:31 You cannot attach to a stopped container, start it first