Description of problem: When rhevm-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): rhevm-log-collector-3.2.2-4.el6ev.noarch rhevm-log-collector-3.2.2-6.el6ev.noarch rhevm-log-collector-3.1.0-10.el6ev.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 'rhevm-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")
Hi James, thanks for your analysis of the issue. (In reply to James W. Mills from comment #0) > 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. Well logging module is supposed to be thread safe: http://docs.python.org/2/library/logging.html#thread-safety I don't think it's due to logging module. > > 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") There are other ssh calls after that one so better move the call to stty sane after them.
merged on upstream master for 3.5.0, pushed to 3.4.0 branch.
merged on 3.4.0 branch
ok, beta3 with 2 hosts... # engine-log-collector INFO: Gathering oVirt Engine information... INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost... Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): About to collect information from 2 hypervisors. Continue? (Y/n): Y INFO: Gathering information from selected hypervisors... INFO: collecting information from 10.34.63.222 INFO: collecting information from 10.34.66.81 INFO: finished collecting information from 10.34.63.222 INFO: finished collecting information from 10.34.66.81 Creating compressed archive... INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20140225092540.tar.xz. The MD5 for this file is 24c9bcc187d96d7ef818005f4d1ed055 and its size is 36.2M
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-0668.html