Bug 1231410

Summary: preupgrade fails if stdin fed from pipe (list index out of range)
Product: Red Hat Enterprise Linux 6 Reporter: Alois Mahdal <amahdal>
Component: preupgrade-assistantAssignee: Petr Hracek <phracek>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: medium Docs Contact:
Priority: low    
Version: 6.7CC: fkluknav, mflitter, mganisin, ovasik, phracek, pstodulk, tcerna, ttomecek
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Piped input no longer causes preupgrade-assistant to crash A bug caused the "preupg" command to crash if input was sent non-interactively from a UNIX pipe. With this release, "preupg" is now able to correctly accept input from a pipe.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 08:26:02 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:

Description Alois Mahdal 2015-06-13 01:32:07 UTC
Description of problem
======================

preupg fails if stdin is not terminal:

    # preupg <<<y
    The Preupgrade Assistant is a diagnostics tool 
    and does not perform the actual upgrade.
    Make sure you back up your system and all of your data now,
    before using the Upgrade Tool to avoid potential data loss.
    Do you want to continue? y/n
    Gathering logs used by preupgrade assistant:
    All installed packages                                 : 01/10 ...finished (time 00:00s)
    All changed files                                      : 02/10 ...finished (time 01:17s)
    Changed config files                                   : 03/10 ...finished (time 00:00s)
    All users                                              : 04/10 ...finished (time 00:00s)
    All groups                                             : 05/10 ...finished (time 00:00s)
    Service statuses                                       : 06/10 ...finished (time 00:00s)
    All installed files                                    : 07/10 ...finished (time 00:03s)
    All local files                                        : 08/10 ...finished (time 00:02s)
    All executable files                                   : 09/10 ...finished (time 00:01s)
    RedHat signed packages                                 : 10/10 ...finished (time 00:00s)
    Assessment of the system, running checks / SCE scripts:
    001/131 ...running (Configuration Files to Review)stty: standard input: Inappropriate ioctl for device
    Usage: preupg [options]

    preupg: error: list index out of range
    #


Version-Release number of selected component
============================================

preupgrade-assistant-2.0.3-8.el6


How reproducible
================

Always if stdin fed from pipe


Steps to Reproduce
==================

    preupg <<<y


Actual results
==============

Error from content and eventually preupg taken down.


Expected results
================

No failure.


Additional info
===============

Possibly there is also some problem with the content, but OTOH preupg
should be able to prevent this (by closing stdin for contents...if
it's doable...?)

Also note the Usage: message---this is probably also not intentional.

Comment 2 Petr Hracek 2015-09-10 07:14:47 UTC
*** Bug 1261763 has been marked as a duplicate of this bug. ***

Comment 4 Petr Hracek 2015-11-03 07:24:55 UTC
Great bug. I will look on it.

Comment 5 Petr Hracek 2015-11-03 11:42:38 UTC
For now I have fixed the issue by upstream commit https://github.com/phracek/preupgrade-assistant/commit/16be28741f77a45082d58fff9cd84fc3601afa7c

It doesn't finish with traceback and output looks like:

[root@rhel6 ~]# preupg --skip-common --debug  <<<y
The Preupgrade Assistant is a diagnostics tool 
and does not perform the actual upgrade.
Make sure you back up your system and all of your data now,
before using the Upgrade Tool to avoid potential data loss.
Do you want to continue? y/n
y
Assessment of the system, running checks / SCE scripts:
001/132 ...running (Configuration Files to Review)stty: standard input: Inappropriate ioctl for device
done    (Configuration Files to Review)
002/132 ...running (File Lists for Manual Migration)stty: standard input: Inappropriate ioctl for device
done    (File Lists for Manual Migration)
003/132 ...running (Bacula Backup Software)stty: standard input: Inappropriate ioctl for device
done    (Bacula Backup Software)
... snip ...
|Removed .so libs                                                                                            |needs_action      |
|Content for enabling and disabling services based on RHEL 6 system                                          |needs_action      |
|GNOME Desktop Environment underwent several design modifications in Red Hat Enterprise Linux 7 release      |fail              |
|Check the system version                                                                                    |fail              |
---------------------------------------------------------------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-151103123604.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some critical issues. In-place upgrade is not advised.
Read the file /root/preupgrade/result.html for more details.
Read the admin report file /root/preupgrade/result-admin.html for more details.
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .
[root@rhel6 ~]# y
-bash: y: command not found
[root@rhel6 ~]#

Comment 9 errata-xmlrpc 2016-05-11 08:26:02 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://rhn.redhat.com/errata/RHBA-2016-1022.html