Bug 1317784 - oc rsh does not set console geometry
Summary: oc rsh does not set console geometry
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Andy Goldstein
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks: 1356062 1486196
TreeView+ depends on / blocked
 
Reported: 2016-03-15 08:30 UTC by Evgheni Dereveanchin
Modified: 2019-10-10 11:32 UTC (History)
8 users (show)

Fixed In Version: atomic-openshift-3.3.0.10-1.git.0.c419cc7.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-27 09:36:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC
Origin (Github) 2284 None None None 2016-03-15 13:45:47 UTC
Red Hat Knowledge Base (Solution) 2207591 None None None 2016-03-23 13:47:41 UTC

Description Evgheni Dereveanchin 2016-03-15 08:30:52 UTC
Description of problem:
 when running "oc rsh", geometry of the console is not passed to the container, so the shell works with default 80×25 geometry which causes scrollback issues in programs like "less"

Version-Release number of selected component (if applicable):
# oc version
oc v3.1.1.6-21-gcd70c35
kubernetes v1.1.0-origin-1107-g4c8e6f4

How reproducible:
always

Steps to Reproduce:
1. oc rsh <pod>
2. set TERM manually to enable scrollback (bz#1317778)
 export TERM=xterm
3. less /path/to/log

Actual results:
 file opens up, but when trying to scroll back the screen is corrupted as the actual terminal size is different from what the container thinks.

Expected results:
 scrollback works properly in less, other command-line tools also work correctly to make troubleshooting easier.

Additional info:

 Here's the geometry reported by "stty -a" in the container
  speed 38400 baud; rows 0; columns 0; line = 0;

 To work around this issue I did this:
  1) find out the geometry of the shell by running "stty -a" before "oc rsh"
  2) set the same geometry in the container 
    stty rows 62 columns 224
 
 this made less work properly, however it needs to be done each time and will not catch the changes in terminal window size.

Comment 2 Andy Goldstein 2016-07-13 19:48:23 UTC
https://github.com/kubernetes/kubernetes/pull/25273

Comment 3 Andy Goldstein 2016-07-15 14:49:34 UTC
The upstream PR merged. I've opened https://github.com/openshift/origin/pull/9878 to cherry-pick to Origin.

Comment 4 Andy Goldstein 2016-08-04 10:38:44 UTC
Fixed in 3.3.0.10

Comment 5 Weihua Meng 2016-08-05 06:45:30 UTC
Fixed. 
openshift v3.3.0.14
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

sh-4.2$ stty -a
speed 38400 baud; rows 42; columns 114; line = 0;

Comment 7 errata-xmlrpc 2016-09-27 09:36:25 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.

https://access.redhat.com/errata/RHBA-2016:1933


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