Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1049759 - [RHS-C] rhsc-log-collector garbles the tty when multiple hosts are gathered and ssh is called with the "-t" flag
[RHS-C] rhsc-log-collector garbles the tty when multiple hosts are gathered a...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: rhsc-log-collector (Show other bugs)
2.1
All Linux
high Severity high
: ---
: ---
Assigned To: Darshan
RHS-C QE
:
Depends On:
Blocks: 1035040
  Show dependency treegraph
 
Reported: 2014-01-08 02:09 EST by Prasanth
Modified: 2015-08-27 03:12 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
When rhsc-log-collector command is run, after collecting logs from different servers, the Terminal becomes garbled and unusable. Workaround: Run 'reset' command.
Story Points: ---
Clone Of: 1041749
Environment:
Last Closed: 2015-08-27 03:12:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 489813 None None None Never

  None (edit)
Description Prasanth 2014-01-08 02:09:25 EST
Cloning this bug for RHSC as the same issue is present in rhsc-log-collector as well.


+++ This bug was initially created as a clone of Bug #1041749 +++


Description of problem:

When rhsc-log-collector is run for multiple hypervisor hosts and invokes ssh with the "-t" flag, it results in a garbled TTY requiring "stty sane" to be run to get it back.

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

rhsc-log-collector-2.1.2.0-0.3.el6rhs.noarch


How reproducible:

I was able to reproduce this 100% of the time if gathering more than one host.  A single host does not exhibit this problem.

Steps to Reproduce:
1.  This problem depends on bug 1010472, which adds the "-t" flag to ssh.  The patch looks like this:

--- rhevm-log-collector.orig    2013-10-07 10:40:57.000000000 -0400
+++ rhevm-log-collector 2013-12-12 12:59:03.552000942 -0500
@@ -503,6 +503,10 @@
         def format_ssh_command(self, cmd="ssh"):
             cmd = "/usr/bin/%s " % cmd

+       # add a controlling tty
+       if cmd.startswith("/usr/bin/ssh"):
+           cmd += "-t "
+
             if "ssh_port" in self.configuration:
                 port_flag = "-p" if cmd.startswith("/usr/bin/ssh") else "-P"
                 cmd += port_flag + " %(ssh_port)s " % self.configuration

2.  With that patch in place, run 'rhsc-log-collector collect' in an environment with more than one host

Actual results:

The command will succeed, but the TTY will become garbled during or just after the collection of data from the hosts

The only recovery is to run 'stty sane' or 'reset' on the TTY where the 'rhevm-log-collector' was invoked.

Expected results:

The command succeeds and the TTY is sane.

Additional info:

This appears to be something to be a combination of the "-t" flag and specifying multiple hosts.  If you remove the "-t" flag the behavior goes away, and if you only specify one host the behavior goes away.  It might have something to do with the logging module being used in multiple threads simultaneously.

I was able to completely alleviate the problem with this patch:

--- rhevm-log-collector.orig    2013-10-07 10:40:57.000000000 -0400
+++ rhevm-log-collector 2013-12-12 12:59:03.552000942 -0500
@@ -626,6 +630,7 @@
             )
             stdout = self.sosreport()
             self.parse_sosreport_stdout(stdout)
+            self.caller.call('stty sane')
             self.configuration["hypervisor_dir"] = os.path.join(
                 self.configuration.get("local_scratch_dir"),
                 self.configuration.get("hostname")

--- Additional comment from Sandro Bonazzola on 2013-12-18 03:07:34 EST ---

Moving to RHEVM since there are Red Hat Customer Portal references.
Comment 1 Shalaka 2014-01-13 03:57:55 EST
As this bug has been identified as known issue, please add the DocText.
Comment 2 Shalaka 2014-01-23 04:38:26 EST
Please review the edited Doc Text and signoff.
Comment 3 Aravinda VK 2014-01-24 06:16:33 EST
Minor change in doc text. (Red Hat Storage Console => Terminal)
Comment 4 Sahina Bose 2015-08-27 03:12:07 EDT
This issue has been fixed post rebase to upstream ovirt 3.5 in RHGS release 3.1.

Closing this bug. Please reopen a bug against version 3.1 if you encounter the issue again

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