Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1361479

Summary: preupg crashes if next program in pipe closes stdin
Product: Red Hat Enterprise Linux 6 Reporter: Alois Mahdal <amahdal>
Component: preupgrade-assistantAssignee: Michal Bocek <mbocek>
Status: NEW --- QA Contact: Alois Mahdal <amahdal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.8CC: amahdal, fkluknav, phracek, pstodulk
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alois Mahdal 2016-07-29 07:02:30 UTC
Description of problem
======================

preupg crashes if next program in pipe closes stdin.

For example:

    [0 root@qeos-61 ~]# preupg --list-rules | head
    List of all available rules:
    RHEL6_7: xccdf_preupg_rule_backup_NoverifyConfigs_noverifycfg
    RHEL6_7: xccdf_preupg_rule_backup_UntrackedFiles_untracked
    RHEL6_7: xccdf_preupg_rule_backup_bacula_check
    RHEL6_7: xccdf_preupg_rule_databases_mysql_configuration_changes_configuration
    RHEL6_7: xccdf_preupg_rule_databases_mysql_data_migration_migration
    RHEL6_7: xccdf_preupg_rule_databases_mysql_general_changes_general
    RHEL6_7: xccdf_preupg_rule_databases_postgresql_pre
    RHEL6_7: xccdf_preupg_rule_desktop_GNOME_gnome
    RHEL6_7: xccdf_preupg_rule_desktop_KDE_kde
    Usage: preupg [options]

    preupg: error: [Errno 32] Broken pipe
    [0 root@qeos-61 ~]# 


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

preupgrade-assistant-2.1.8-1.el6


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

Always


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

 1. call `preupg | head`
 2. observe output tail


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

error is printed


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

no error

Comment 2 Petr Hracek 2016-07-29 08:43:58 UTC
Can you please attach also `preupg --list-rules --debug?

Comment 3 Alois Mahdal 2016-07-29 16:46:49 UTC
(In reply to Petr Hracek from comment #2)
> Can you please attach also `preupg --list-rules --debug?

'ere you go:

    [0 root@qeos-251 ~]# preupg --debug --list-rules | head
    List of all available rules:
    RHEL6_7: xccdf_preupg_rule_others_configchanges_check
    RHEL6_7: xccdf_preupg_rule_others_rsyslog_check
    RHEL6_7: xccdf_preupg_rule_others_vcsrepos_check_script
    RHEL6_7: xccdf_preupg_rule_others_NoVersionChangeEtc_nochange
    RHEL6_7: xccdf_preupg_rule_selinux_RestoreConfig_restoreConfig
    RHEL6_7: xccdf_preupg_rule_selinux_general_check
    RHEL6_7: xccdf_preupg_rule_selinux_CustomPolicy_check
    RHEL6_7: xccdf_preupg_rule_selinux_samba_check_script
    RHEL6_7: xccdf_preupg_rule_storage_warnquota_configuration_checkscript
    Traceback (most recent call last):
      File "/usr/bin/preupg", line 35, in <module>
        sys.exit(main())
      File "/usr/bin/preupg", line 21, in main
        ret = app.run()
      File "/usr/lib/python2.6/site-packages/preup/application.py", line 613, in run
        log_message(settings.list_rules % '\n'.join(rules))
      File "/usr/lib/python2.6/site-packages/preup/logger.py", line 65, in log_message
        sys.stdout.flush()
    IOError: [Errno 32] Broken pipe