package sssd-common 1.11.8-0ubuntu0.6 failed to install/upgrade: subprocess new pre-removal script returned error exit status 5

Bug #1699065 reported by Felix Ruess
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sssd (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

If you have the `systemd` package installed, the upgrade of sssd-common fails because it thinks systemd is used and the sssd.service exists (which it tries to stop in the pre removal script).

In my case the systemd package was installed because at some point I installed ubuntu-core-launcher (which pulled in systemd via snapd)... All the package are from the official Ubuntu repo.

To resolve the problem I had to remove the part that tried to stop the sssd.service from the prerm script in /var/lib/dpkg/info/sssd-common.prerm

After that I also uninstalled ubuntu-core-launcher, snapd and systemd for the time being...

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: sssd-common 1.11.8-0ubuntu0.6
ProcVersionSignature: Ubuntu 4.4.0-79.100~14.04.1-generic 4.4.67
Uname: Linux 4.4.0-79-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.24
Architecture: amd64
Date: Tue Jun 20 10:40:21 2017
DuplicateSignature: package:sssd-common:1.11.8-0ubuntu0.6:subprocess new pre-removal script returned error exit status 5
ErrorMessage: subprocess new pre-removal script returned error exit status 5
InstallationDate: Installed on 2015-12-08 (559 days ago)
InstallationMedia: Ubuntu 14.04.3 LTS "Trusty Tahr" - Beta amd64 (20150805)
RelatedPackageVersions:
 dpkg 1.17.5ubuntu5.7
 apt 1.0.1ubuntu2.17
SourcePackage: sssd
Title: package sssd-common 1.11.8-0ubuntu0.6 failed to install/upgrade: subprocess new pre-removal script returned error exit status 5
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Felix Ruess (flixr) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Joshua Powers (powersj) wrote :

From terminal log:

Preparing to unpack .../sssd-common_1.11.8-0ubuntu0.7_amd64.deb ...
Failed to issue method call: Unit sssd.service not loaded.
dpkg: warning: subprocess old pre-removal script returned error exit status 5
dpkg: trying script from the new package instead ...
Failed to issue method call: Unit sssd.service not loaded.

Revision history for this message
Joshua Powers (powersj) wrote :

Thank you for taking the time to file a bug report.

It looks like when installing the deb it sees if the service is loaded
and fails since it is not loaded. I'm not sure what else to look into
without more information. A fresh Trusty system can install just fine.

You did mention snapd, but looks like this is all from apt.

Since there is not enough information in your report to begin triage or to
differentiate between a local configuration problem and a bug in Ubuntu, I
am marking this bug as "Incomplete". We would be grateful if you would:
provide a complete description of the problem, explain why you
believe this is a bug in Ubuntu rather than a problem specific to your
system, and then change the bug status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in sssd (Ubuntu):
status: New → Incomplete
Revision history for this message
Felix Ruess (flixr) wrote :

updated the description with more details

description: updated
Changed in sssd (Ubuntu):
status: Incomplete → New
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

# trusty container - systemd and ssd not installed
# install works
$ apt install sssd
# Fake "upgrade" works as well
$ apt install sssd --reinstall

# clean again
$ apt remove --purge sssd && apt-get autoremove

# no pulling in snap + deps
# ubuntu-core-launcher -> snap-confine -> snapd (former transitionals)
$apt install snapd
[...]
The following NEW packages will be installed:
  crda grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common iw
  libfreetype6 liblzo2-2 libnl-genl-3-200 libsystemd-journal0 linux-firmware
  linux-generic-lts-xenial linux-headers-4.4.0-81
  linux-headers-4.4.0-81-generic linux-headers-generic-lts-xenial
  linux-image-4.4.0-81-generic linux-image-extra-4.4.0-81-generic
  linux-image-generic-lts-xenial os-prober snapd squashfs-tools systemd
  thermald wireless-regdb

Hrm, checking deeper where your issue might come from ...

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

# systemd installed at 204-5ubuntu20.24 now
# working still
$ apt install sssd

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

In general the package has both upstart and systemd
$ dpkg -L sssd-common | grep init
/etc/init
/etc/init/sssd.conf
/etc/init/sssd-autofs.conf
$ dpkg -L sssd-common | grep service
/lib/systemd/system/sssd.service

#Checking the prerm
It calls service tasks via
1. if systemd installed /usr/bin/deb-systemd-invoke stop sssd.service
   That is a no-op on 14.404
2. if sysV or upstart script for sssd-autofs then
   invoke-rc.d sssd-autofs stop || invoke_failure
   This seems off by default (maybe no config), but the stop works
   $ service sssd-autofs status
   sssd-autofs stop/waiting
   $ invoke-rc.d sssd-autofs stop
   $ echo $?
   0
   So "ok" I think
2. if sysV or upstart script for sssd then
   invoke-rc.d sssd-autofs || invoke_failure
   The same as for sssd-auitofs
   $ service sssd status
   sssd stop/waiting
   $ invoke-rc.d sssd stop
   $ echo $?
   0

So all stops "work"
Maybe sssd needs to be up and running correctly before that to trigger the issue preferring the systemd service, checking that next.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I tried to following [1] to configure a minimal sssd, but as always when I (unexperienced in AD things) touch ssd it appears notoriously complex to me.

I subscribed Andreas to hopefully help me out here.
@Andreas I subscribed you as IIRC you had a working setup to test - could you try the commands 1-3 in comment #7 on a 14.04 with sssd running before you do so - and check if one of them fails?
If it does please subscribe out Team so we can take a deeper look later on.

https://help.ubuntu.com/14.04/serverguide/sssd-ad.html#sssd-ad-sssdconfig

Revision history for this message
Felix Ruess (flixr) wrote :

Well, I was upgrading from an older sssd-common package...
Maybe the problem was with on of the previous sssd-common versions.
IIRC it first occurred when I tried to upgrade from 1.11.8-0ubuntu0.5 to 1.11.8-0ubuntu0.6

In any case it was definitely trying to stop the service via systemd which failed

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'll take a look, I do have a working sssd setup with ldap.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Checking this out now.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I also can't see the error after installing systemd (ubuntu-core-launcher and all its deps, actually).

Original version shipped with trusty: http://pastebin.ubuntu.com/24965690/

Now with upgrades enabled, trying an upgrade: http://pastebin.ubuntu.com/24965703/

I note, however, that systemd never recognized the sssd.service job:
root@15-89:~# dpkg -l|grep ubuntu-core
ii ubuntu-core-launcher 2.25~14.04 amd64 Transitional package for snap-confine
root@15-89:~#
root@15-89:~# systemctl status sssd
sssd.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)

root@15-89:~# systemctl status sssd.service
sssd.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)

root@15-89:~# service sssd status
sssd start/running, process 3286
root@15-89:~# dpkg -L sssd-common|grep systemd
/lib/systemd
/lib/systemd/system
/lib/systemd/system/sssd.service

I can't even enable it for systemd via the usual systemctl enable call:
root@15-89:~# systemctl enable sssd.service
Failed to issue method call: No such file or directory

Was there anything else related to systemd done to this system?

Changed in sssd (Ubuntu):
status: New → Incomplete
Revision history for this message
Felix Ruess (flixr) wrote :

> Was there anything else related to systemd done to this system?

No, I didn't even properly realize systemd was pulled in as a dependency...

In any case I fixed the problem here and you can probably close this if it's not reproducible....

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Let's leave it as "incomplete". The error definitely happened, as we can see it in your logs, we just can't figure out how was triggered.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for sssd (Ubuntu) because there has been no activity for 60 days.]

Changed in sssd (Ubuntu):
status: Incomplete → Expired
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.