#6861 uninstall ipa client automount failed with RuntimeWarning
Closed: fixed Opened by gkaihoro.

When trying to uninstall automount client setting on the ipa-client its failing with RuntimeWarning.

:: [ BEGIN ] :: uninstall ipa client automount :: actually running 'ipa-client-automount --uninstall -U'
/usr/lib/python2.7/site-packages/ipaplatform/base/services.py:195: RuntimeWarning: RedHatService('sssd', api=None) is deprecated.
super(SystemdService, self).init(service_name, api=api)
Restoring configuration
Unable to restore SSSD configuration: 'Env' object has no attribute 'realm'
:: [ PASS ] :: uninstall ipa client automount (Expected 0, got 0)
:: [ BEGIN ] :: Restarting automount to fetch updated configuration :: actually running 'service autofs restart'
Redirecting to /bin/systemctl restart autofs.service
:: [ PASS ] :: Restarting automount to fetch updated configuration (Expected 0, got 0)
:: [ BEGIN ] :: Removed automount key :: actually running 'ipa automountkey-del direct_map_21468 auto.direct --key=/direct_map_21468/'
ipa: ERROR: Major (851968): Unspecified GSS failure. Minor code may provide more information, Minor (39756044): Credential cache is empty
:: [ FAIL ] :: Removed automount key (Expected 0, got 1)
:: [ BEGIN ] :: Removed automount location :: actually running 'ipa automountlocation-del direct_map_21468'
ipa: ERROR: Major (851968): Unspecified GSS failure. Minor code may provide more information, Minor (39756044): Credential cache is empty
:: [ FAIL ] :: Removed automount location (Expected 0, got 1)
'c91287af-23c1-43d2-bcf3-efc151d69096'
autofs-functional-test-offline-direct-map result: FAIL


There are three problems

  • root_logger.debug() in except clause is not called with exc_info=True. As a consequence the traceback of any failure is not logged. It makes it really hard understand the root cause of failures.
  • services.service('sssd') must be services.service('sssd', api=api) where api is an initialized ipalib.api object.
  • wait_for_sssd() requires an initialized ipalib.api but uninstall does not initialize the API (error: AttributeError: 'Env' object has no attribute 'realm')

Thanks Christian for the analysis. It is not very clear from the bug report what is happening and what is expected. So far the biggest issue seems to be the issue in wait_for_sssd() which causes failure of the script.

Petr,

the runtime warning is a red herring and not related to the bug at all. wait_for_sssd() is the root cause of the problem. Missing api argument to services.service('sssd') emits the runtime warning. Missing exc_info=True makes it harder to debug and understand the root cause.

Seems to be caused by https://pagure.io/freeipa/c/2d4d1a9dc0ef2bbe86751768d6e6b009a52c0dc9

IMO we should remove the wait_for_sssd() call. I don't see a reason why uninstaller should wait for restart of SSSD. Maybe, just in automation something subsequent might depend on it. But that is a problem of the other script.

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1445432

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1445432

Issue linked to bug 1445432

Metadata Update from @pvoborni:
- Issue assigned to pvoborni

Metadata Update from @pvoborni:
- Custom field on_review adjusted to https://pagure.io/freeipa/issue/6861
- Issue priority set to: critical
- Issue set to the milestone: FreeIPA 4.5.1
- Issue tagged with: regression

Metadata Update from @pvoborni:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/735 (was: https://pagure.io/freeipa/issue/6861)

master:

  • b4e447fa6fc7d659ae6a3b6285d4ddda0baa0be4 automount install: fix checking of SSSD functionality on uninstall

ipa-4-5:

  • ff513d6b20ee0a2ca90b06b8c114386f1e5751d9 automount install: fix checking of SSSD functionality on uninstall

Metadata Update from @mbasti:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata