Bug 1345731 - MariaDB image ,"TERM environment variable not set." when executing "mysql" in container
Summary: MariaDB image ,"TERM environment variable not set." when executing "mysql" in...
Keywords:
Status: CLOSED DUPLICATE of bug 1317778
Alias: None
Product: OKD
Classification: Red Hat
Component: Image
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-13 05:07 UTC by Wang Haoran
Modified: 2016-06-20 19:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-20 19:32:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wang Haoran 2016-06-13 05:07:45 UTC
Description of problem:
After deploy the MariaDB image, and run mysql command inside the container , get the error : "TERM environment variable not set."

Version-Release number of selected component (if applicable):

registry.access.redhat.com/rhscl/mariadb-100-rhel7
registry.access.redhat.com/rhscl/mariadb-101-rhel7

How reproducible:
Always

Steps to Reproduce:
1.Deploy the MariaDB image
  $oc run mariadb --image=registry.access.redhat.com/rhscl/mariadb-100-rhel7 --env=MYSQL_ROOT_PASSWORD=test
2.oc rsh to the pod and run mysql
  $oc rsh <pod>
  $mysql

Actual results:
TERM environment variable not set.

Expected results:
Should can use the mysql client to connect to the db.

Additional info:
export the TERM env in the console can resolve , like this: export TERM=dumb
There is also some discuss here: https://github.com/dockerfile/mariadb/issues/3

Comment 1 Ben Parees 2016-06-13 14:18:51 UTC
I'm somewhat inclined to say this is an openshift bug that it rsh should be setting a TERM, we've discussed this before but i don't think we reached a resolution.

Comment 2 Ben Parees 2016-06-13 14:19:30 UTC
(I would vote for a least common denominator term like vt100, or pick the term from the oc client env)

Comment 3 Andy Goldstein 2016-06-20 16:54:06 UTC
When you 'docker run' something, it will set the value of TERM based on whether or not you run with a tty (-t). If you do, then TERM will be set to something like xterm. If you don't run with a tty, then it's either not set, or it gets set to dumb (I don't recall when it's empty vs dumb).

We already have a bz to have 'oc rsh' set TERM: bug 1317778. That can be fixed after my terminal resizing PR (https://github.com/kubernetes/kubernetes/pull/25273) merges, which will be sometime after Kubernetes is accepting post-1.3 merges to master.

Do you want to close this as a dupe of 1317778?

Comment 4 Ben Parees 2016-06-20 19:32:21 UTC
yup.  thanks Andy.

*** This bug has been marked as a duplicate of bug 1317778 ***


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