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.

Bug 1113092

Summary: `docker run` fails when attaching stderr in tty mode
Product: Red Hat Enterprise Linux 7 Reporter: Lukáš Doktor <ldoktor>
Component: dockerAssignee: Matthew Heon <mheon>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bsarathy, dwalsh, jrieden, mheon, mjenner
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-18 20:45:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1109938    
Attachments:
Description Flags
output of "docker -D run -a stderr -t fedora bash -c exit" command none

Description Lukáš Doktor 2014-06-25 12:25:35 UTC
Created attachment 912078 [details]
output of "docker -D run -a stderr -t fedora bash -c exit" command

Description of problem:
When I try to attach `-a stderr`, the process raises exception with nil pointer dereference.

Version-Release number of selected component (if applicable):
docker-0.11.1-10.el7.x86_64
docker-io-1.0.0-1.fc20.x86_64

How reproducible:
Always

Steps to Reproduce:
1. docker -D run -a stderr -t fedora bash

Actual results:
failure - tb attached

Expected results:
container should start

Additional info:
In non-tty mode it works perfectly.

Comment 2 Matthew Heon 2014-06-27 17:30:52 UTC
Is there a reason why -a is allowed to be run with -t? Starting with -t implies that the stdin/out/err of the docker run process will all be attached to the new TTY; I don't see how attaching one of these signals again makes sense in that context. Running -a stdout -t, for example, breaks attaching stdin. 

Given this, I propose ignoring -a flags if -t is active. I'll raise this with upstream and see if they think this is a reasonable solution.

Comment 3 Daniel Walsh 2014-06-27 17:36:13 UTC
I was thinking the same thing.  We can make the -a and -t conflict with each other if upstream agrees.

Comment 4 Matthew Heon 2014-06-27 17:54:41 UTC
Issue created upstream about this: https://github.com/dotcloud/docker/issues/6736

Comment 5 Lukáš Doktor 2014-06-30 14:11:26 UTC
It would be nice to make -a and -t conflict.

Comment 6 Matthew Heon 2014-07-16 15:13:07 UTC
Upstream feels that there are use cases where -a and -t may be used together.

I've identified the root cause of the bug, though, and will be submitting a patch for it soon (https://github.com/dotcloud/docker/issues/6983)

Comment 7 Matthew Heon 2014-07-18 13:27:43 UTC
Patch has been accepted by upstream. We'll be carrying it in our builds of Docker for RHEL7.

Comment 8 Matthew Heon 2014-07-18 20:36:06 UTC
Fixed in docker-1.1.1-1

Comment 9 Lukáš Doktor 2014-07-21 14:32:42 UTC
Hi Matthew, I can confirm it's not crashing. Unluckily I'm not convinced it works fine yet. I tested it with `ls non_existing_file` which should print into stderr "ls: cannot access non_existing_file: No such file or directory". When I use tty mode, it's printing it into stdout, when I use non-tty mode it prints it correctly into stderr:

TTY:
[root@localhost ~]# docker run -t -a stderr fedora ls non_existing_file
[root@localhost ~]# docker run -t -a stdout fedora ls non_existing_file
ls: cannot access non_existing_file: No such file or directory
NON-TTY:
[root@localhost ~]# docker run -a stderr fedora ls non_existing_file
ls: cannot access non_existing_file: No such file or directory
[root@localhost ~]# docker run -a stdout fedora ls non_existing_file

Comment 10 Matthew Heon 2014-07-21 14:44:11 UTC
Confirmed, I can reproduce this locally.

This looks to be a server-side issue - in TTY mode, the server seems to multiplex stdout into stderr, which the client is unaware of. I'll look into fixing this.

Comment 11 Lukáš Doktor 2014-07-21 15:17:10 UTC
OK, thank you. I'll set this to `verified` as it's not crashing now and create new BZ for the stdout/stderr multiplex issue to not lost the track...

Comment 12 Lukáš Doktor 2014-07-21 15:27:06 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1121689

Comment 13 errata-xmlrpc 2014-09-18 20:45:53 UTC
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.

http://rhn.redhat.com/errata/RHBA-2014-1266.html