RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1480502 - ipa server uninstall with -v option displays "IOError: [Errno 9] Bad file descriptor Logged from file ipautil.py, line 442"
Summary: ipa server uninstall with -v option displays "IOError: [Errno 9] Bad file des...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-11 09:27 UTC by Sudhir Menon
Modified: 2018-10-30 10:56 UTC (History)
10 users (show)

Fixed In Version: ipa-4.6.4-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:56:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Uninstall Log (99.96 KB, text/plain)
2018-08-07 10:20 UTC, Sudhir Menon
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3187 0 None None None 2018-10-30 10:56:48 UTC

Description Sudhir Menon 2017-08-11 09:27:58 UTC
Description of problem: ipa server uninstall with -v option displays "IOError: [Errno 9] Bad file descriptor Logged from file ipautil.py, line 442"


Version-Release number of selected component (if applicable):
ipa-server-4.5.0-21.el7_4.1.x86_64

How reproducible:Always


Steps to Reproduce:
1. Install IPA server
2. Uninstall ipa-server using the verbose option

#ipa-server-install --uninstall -U -v

Actual results: The console log displays the below message.

1. Check the below section
ipa         : DEBUG    stderr=
ipa         : DEBUG    Removing service keytab: /etc/dirsrv/ds.keytab
ipa         : DEBUG    Removing service credentials cache
ipa         : DEBUG    Starting external process
ipa         : DEBUG    args=/usr/bin/kdestroy
ipa         : DEBUG    Process finished, return code=0
ipa         : DEBUG    stdout=
ipa         : DEBUG    stderr=Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 875, in emit
    self.flush()
  File "/usr/lib64/python2.7/logging/__init__.py", line 835, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file ipautil.py, line 442
ipa         : DEBUG    runas=dirsrv (UID 389, GID 389)

=========

2. Check the traceback seen at the end of the uninstall section.
ipa         : DEBUG    Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipapython/install/common.py", line 91, in _handle_execute_exception
    super(Continuous, self)._handle_execute_exception(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 463, in _handle_execute_exception
    self._handle_exception(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 453, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 424, in __runner
    step()
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 421, in <lambda>
    step = lambda: next(self.__gen)
  File "/usr/lib/python2.7/site-packages/ipapython/install/util.py", line 81, in run_generator_with_yield_from
    six.reraise(*exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/util.py", line 59, in run_generator_with_yield_from
    value = gen.send(prev_value)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 658, in _configure
    next(executor)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 434, in __runner
    exc_handler(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 463, in _handle_execute_exception
    self._handle_exception(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 521, in _handle_exception
    self.__parent._handle_exception(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 453, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 518, in _handle_exception
    super(ComponentBase, self)._handle_exception(exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 453, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 424, in __runner
    step()
  File "/usr/lib/python2.7/site-packages/ipapython/install/core.py", line 421, in <lambda>
    step = lambda: next(self.__gen)
  File "/usr/lib/python2.7/site-packages/ipapython/install/util.py", line 81, in run_generator_with_yield_from
    six.reraise(*exc_info)
  File "/usr/lib/python2.7/site-packages/ipapython/install/util.py", line 59, in run_generator_with_yield_from
    value = gen.send(prev_value)
  File "/usr/lib/python2.7/site-packages/ipapython/install/common.py", line 71, in _uninstall
    for _nothing in self._uninstaller(self.parent):
  File "/usr/lib/python2.7/site-packages/ipaserver/install/server/__init__.py", line 584, in main
    uninstall(self)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/server/install.py", line 248, in decorated
    func(installer)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/server/install.py", line 1160, in uninstall
    sys.exit(rv)
SystemExit: 0

Expected results: 

1. Although it doesn't seem to break anything, we should fix the above traceback seen.

2. Although the 'SystemExit: 0', if possible we should also fix the traceback to have a clean uninstall log file which doesn't confuse the end user.


Additional info:

Comment 2 Sudhir Menon 2017-08-16 06:42:56 UTC
ipa         : DEBUG    Removing service keytab: /etc/named.keytab
ipa         : DEBUG    Removing service credentials cache
ipa         : DEBUG    Starting external process
ipa         : DEBUG    args=/usr/bin/kdestroy
ipa         : DEBUG    Process finished, return code=0
ipa         : DEBUG    stdout=
ipa         : DEBUG    stderr=Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 875, in emit
    self.flush()
  File "/usr/lib64/python2.7/logging/__init__.py", line 835, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file ipautil.py, line 442
ipa         : DEBUG    runas=named (UID 25, GID 25)

ipa         : DEBUG    Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
ipa         : DEBUG    Unconfiguring ipa-dnskeysyncd

Comment 3 Petr Vobornik 2017-08-18 16:33:09 UTC
Was this already fixed upstream?

Comment 4 Standa Laznicka 2017-08-21 12:02:39 UTC
This is fixed in FreeIPA master branch. A fix should arrive in RHEL 7.6 since the fix was a part of a major refactoring.

Comment 11 Sudhir Menon 2018-08-07 10:19:08 UTC
Tested on Red Hat Enterprise Linux Server release 7.6 Beta (Maipo)  using
ipa-server-4.6.4-3.el7.x86_64
sssd-1.16.2-11.el7.x86_64
389-ds-base-1.3.8.4-9.el7.x86_64
krb5-server-1.15.1-34.el7.x86_64
pki-server-10.5.9-4.el7.noarch
selinux-policy-3.13.1-211.el7.noarch

Note:
1. There are certain traceback's which are yet to be addressed e.g as mentioned in comment#2 hence reopening the bug.

ipaserver.install.installutils: DEBUG    Removing service keytab: /etc/named.keytab
ipaserver.install.installutils: DEBUG    Removing service credentials cache
ipapython.ipautil: DEBUG    Starting external process
ipapython.ipautil: DEBUG    args=/usr/bin/kdestroy
ipapython.ipautil: DEBUG    Process finished, return code=0
ipapython.ipautil: DEBUG    stdout=
ipapython.ipautil: DEBUG    stderr=Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 875, in emit
    self.flush()
  File "/usr/lib64/python2.7/logging/__init__.py", line 835, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file ipautil.py, line 493
ipapython.ipautil: DEBUG    runas=named (UID 25, GID 25)
----------------------------------
ipapython.ipautil: DEBUG    stderr=Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 875, in emit
    self.flush()
  File "/usr/lib64/python2.7/logging/__init__.py", line 835, in flush
    self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file ipautil.py, line 493
ipapython.ipautil: DEBUG    runas=dirsrv (UID 994, GID 991)

Comment 12 Sudhir Menon 2018-08-07 10:20:45 UTC
Created attachment 1473945 [details]
Uninstall Log

Comment 13 Florence Blanc-Renaud 2018-08-23 08:57:13 UTC
Removing the NOUPSTREAM label as the issue needs a new fix.

Comment 14 Florence Blanc-Renaud 2018-08-23 09:03:56 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7681

Comment 21 Sudhir Menon 2018-09-03 13:39:19 UTC
Tested on Red Hat Enterprise Linux Server release 7.6 Beta (Maipo) using

ipa-server-4.6.4-7.el7.x86_64
sssd-1.16.2-12.el7.x86_64
samba-4.8.3-4.el7.x86_64
389-ds-base-1.3.8.4-12.el7.x86_64
pki-server-10.5.9-6.el7.noarch
ipa-client-4.6.4-7.el7.x86_64


Observations
1. IOError is no more seen.
2. traceback is also not seen at the end of uninstall log file.
3. For 'returned non-zero exit status 6!' bz1481949 has already been logged.

ipapython.ipautil: DEBUG    stderr=Removed symlink /etc/systemd/system/named.service.
ipaserver.install.installutils: DEBUG    Removing service keytab: /etc/named.keytab
ipaserver.install.installutils: DEBUG    Removing service credentials cache
ipapython.ipautil: DEBUG    Starting external process
ipapython.ipautil: DEBUG    args=/usr/bin/kdestroy
ipapython.ipautil: DEBUG    runas=named (UID 25, GID 25)
ipapython.ipautil: DEBUG    Process finished, return code=0
ipapython.ipautil: DEBUG    stdout=
ipapython.ipautil: DEBUG    stderr=
ipalib.install.sysrestore: DEBUG    Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
ipaserver.install.service: DEBUG    Unconfiguring ipa-dnskeysyncd
Unconfiguring ipa-dnskeysyncd

ipapython.ipautil: DEBUG    stderr=
ipaserver.install.installutils: DEBUG    Removing service keytab: /etc/dirsrv/ds.keytab
ipaserver.install.installutils: DEBUG    Removing service credentials cache
ipapython.ipautil: DEBUG    Starting external process
ipapython.ipautil: DEBUG    args=/usr/bin/kdestroy
ipapython.ipautil: DEBUG    runas=dirsrv (UID 994, GID 990)
ipapython.ipautil: DEBUG    Process finished, return code=0

Systemwide CA database updated.
Client uninstall complete.
The ipa-client-install command was successful
ipapython.ipautil: DEBUG    Process finished, return code=0
ipapython.admintool: INFO     The ipa-server-install command was successful

Comment 23 errata-xmlrpc 2018-10-30 10:56:00 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://access.redhat.com/errata/RHBA-2018:3187


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