When installing/uninstalling with realmd, uninstalling crashes with ScriptError

Bug #1946244 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
freeipa (Debian)
New
Unknown
freeipa (Ubuntu)
New
Undecided
Unassigned
Bionic
Won't Fix
Undecided
Unassigned
Hirsute
Won't Fix
Undecided
Unassigned

Bug Description

ProblemType: Crash
DistroRelease: Ubuntu 21.04
PackageVersion: python3-ipaclient 4.8.6-1ubuntu5
SourcePackage: freeipa
Architecture: amd64

Joining a FreeIPA domain with plain ipa-client-install works well:

# ipa-client-install -p admin --password=SECRET --no-ntp
[...]
The ipa-client-install command was successful

And leaving it again with "ipa-client-install --uninstall" also works.

However, when doing this through realmd (which configures some additional useful stuff), it causes a crash:

# realm join
Password for admin:

This works fine:

# realm list
cockpit.lan
  type: kerberos
  realm-name: COCKPIT.LAN
  domain-name: cockpit.lan
  configured: kerberos-member
  server-software: ipa
  client-software: sssd
  required-package: freeipa-client
  required-package: sssd-tools
  required-package: sssd
  required-package: libnss-sss
  required-package: libpam-sss
  login-formats: %<email address hidden>
  login-policy: allow-realm-logins

But leaving fails:

# realm leave
See: journalctl REALMD_OPERATION=r152.3671
realm: Couldn't leave realm: Running ipa-client-install failed
root@x0:~# echo $?
1

The crash from /var/log/ipaclient-uninstall.log:

2021-10-06T15:48:22Z INFO Client uninstall complete.
2021-10-06T15:48:22Z DEBUG File "/usr/lib/python3/dist-packages/ipapython/admintool.py", line 179, in execute
    return_value = self.run()
  File "/usr/lib/python3/dist-packages/ipapython/install/cli.py", line 340, in run
    return cfgr.run()
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 360, in run
    return self.execute()
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 386, in execute
    for rval in self._executor():
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 431, in __runner
    exc_handler(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 460, in _handle_execute_exception
    self._handle_exception(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 450, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 421, in __runner
    step()
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 418, in <lambda>
    step = lambda: next(self.__gen)
  File "/usr/lib/python3/dist-packages/ipapython/install/util.py", line 81, in run_generator_with_yield_from
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/ipapython/install/util.py", line 59, in run_generator_with_yield_from
    value = gen.send(prev_value)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 655, in _configure
    next(executor)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 431, in __runner
    exc_handler(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 460, in _handle_execute_exception
    self._handle_exception(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 518, in _handle_exception
    self.__parent._handle_exception(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 450, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 515, in _handle_exception
    super(ComponentBase, self)._handle_exception(exc_info)
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 450, in _handle_exception
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 421, in __runner
    step()
  File "/usr/lib/python3/dist-packages/ipapython/install/core.py", line 418, in <lambda>
    step = lambda: next(self.__gen)
  File "/usr/lib/python3/dist-packages/ipapython/install/util.py", line 81, in run_generator_with_yield_from
    six.reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/ipapython/install/util.py", line 59, in run_generator_with_yield_from
    value = gen.send(prev_value)
  File "/usr/lib/python3/dist-packages/ipapython/install/common.py", line 73, in _uninstall
    for unused in self._uninstaller(self.parent):
  File "/usr/lib/python3/dist-packages/ipaclient/install/client.py", line 3825, in main
    uninstall(self)
  File "/usr/lib/python3/dist-packages/ipaclient/install/client.py", line 3528, in uninstall
    raise ScriptError(rval=rv)

2021-10-06T15:48:22Z DEBUG The ipa-client-install command failed, exception: ScriptError:

Ubuntu 20.04 LTS is affected the same way. Note that this crash does *not* happen on Debian 10 or testing (nor in Fedora, RHEL, or CentOS). We found this through Cockpit's tests, and it only happens on Ubuntu.

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

For completeness, this is /var/log/ipaclient-install from the successful "realm join".

summary: When installing/uninstalling with realmd, uninstalling crashes with
+ ScriptError
Revision history for this message
Brian Murray (brian-murray) wrote :

The Hirsute Hippo has reached End of Life, so this bug will not be fixed for that release.

Changed in freeipa (Ubuntu Hirsute):
status: New → Won't Fix
Revision history for this message
Martin Pitt (pitti) wrote :

Still confirmed on 21.10, and also Debian testing; I filed a Debian bug and linked it.

Changed in freeipa (Debian):
status: Unknown → New
Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Marius Vollmer (marius-vollmer-gmail) wrote :

I think this happens because realmd passes "--force-ntpd" to ipa-client-install, but ntpd is not installed.

Revision history for this message
Martin Pitt (pitti) wrote :

Confirmed in current noble.

Timo Aaltonen (tjaalton)
Changed in freeipa (Ubuntu Bionic):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.