package slapd 2.4.31-1+nmu2ubuntu8.3 failed to install/upgrade: subprocess new pre-installation script returned error exit status 1

Bug #1673727 reported by Rick Bosscha on 2017-03-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openldap (Ubuntu)
Undecided
Unassigned

Bug Description

Error message while upgrading.

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: slapd 2.4.31-1+nmu2ubuntu8.3
ProcVersionSignature: Ubuntu 3.13.0-112.159-generic 3.13.11-ckt39
Uname: Linux 3.13.0-112-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.23
Architecture: amd64
Date: Fri Mar 17 10:57:23 2017
ErrorMessage: subprocess new pre-installation script returned error exit status 1
InstallationDate: Installed on 2014-05-09 (1042 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.0.1ubuntu2.17
SourcePackage: openldap
Title: package slapd 2.4.31-1+nmu2ubuntu8.3 failed to install/upgrade: subprocess new pre-installation script returned error exit status 1
UpgradeStatus: Upgraded to trusty on 2017-03-17 (0 days ago)

Rick Bosscha (rbosscha) wrote :
Download full text (4.6 KiB)

Hi Rick,
thank you for taking the time to report this bug and helping to make Ubuntu better.

It seems you are upgrading "to" Trusty as version 2.4.31-1+nmu2ubuntu8.3 is trusty.
Is that a full precise to trusty Update with slapd formerly configured and working?

In the log I found a few issues, looking at them one by one:
#1
Preparing to unpack .../slapd_2.4.42+dfsg-2ubuntu3.1_amd64.deb ...
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^(.*?)(\\)?\${ <-- HERE ([^{}]+)}(.*)$/ at /usr/share/perl5/Debconf/Question.pm line 72.

This is "just" an annoying message and fixed later on, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786705. So not a problem.

#2
/tmp/ubuntu-release-upgrader-15bkpjew/imported/invoke-rc.d: 1: /tmp/ubuntu-release-upgrader-15bkpjew/imported/invoke-rc.d: /sbin/runlevel: not found
 * Stopping OpenLDAP slapd
   ...done.
  Dumping to /var/backups/slapd-2.4.31-1+nmu2ubuntu8.3:
  - directory dc=kavobv, dc=local... 58cbb2fc ldif_read_file: checksum error on "/etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif"
58cbb2fc olcRootPW: value #0: <olcRootPW> can only be set when rootdn is under suffix
58cbb2fc config error processing olcDatabase={1}hdb,cn=config: <olcRootPW> can only be set when rootdn is under suffix
slapcat: bad configuration directory!
failed

That seems to have run into issues while trying to dump the DB to use it on postinst.
To do so it uses slapcat and sets a few opts.

The default is "when needed" and that is then only true if coming from before 2.4.31-1+nmu2ubuntu5 which we do in your case.

So you can trigger/test that dump manually via:
/var/lib/dpkg/info/slapd.preinst upgrade 2.4.25-1

Also enabling a set -x in that file gave me a working dump like this:
+ echo /var/backups/slapd-VERSION
+ sed -e s/VERSION/2.4.25-1/
+ dir=/var/backups/slapd-2.4.25-1
+ mkdir -p -m 700 /var/backups/slapd-2.4.25-1
+ echo /var/backups/slapd-2.4.25-1
+ dir=/var/backups/slapd-2.4.25-1
+ echo Dumping to /var/backups/slapd-2.4.25-1:
  Dumping to /var/backups/slapd-2.4.25-1:
+ + read suffix
get_suffix
+ [ -f /etc/ldap/slapd.d ]
+ + cut -d: -fgrep 2
 -h olcSuffix /etc/ldap/slapd.d/cn=config/olcDatabase={-1}frontend.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif
+ get_directory dc=lxd
+ [ -d /etc/ldap/slapd.d ]
+ get_suffix
+ [ -f /etc/ldap/slapd.d ]
+ grep -q dc=lxd
+ cut -d: -f 2
+ grep -h olcSuffix /etc/ldap/slapd.d/cn=config/olcDatabase={-1}frontend.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif
+ cut -d: -f 2
+ grep -l olcSuffix: dc=lxd /etc/ldap/slapd.d/cn=config/olcDatabase={-1}frontend.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif
+ sed s/^ *//g
+ grep olcDbDirectory: /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif
+ dbdir=/var/lib/ldap
+ [ -n /var/lib/ldap ]
+ [ -d /var/lib/ldap ]
+ file=/var/backups/slapd-2.4.25-1/dc=lxd.ldif
+ echo -n - directory dc=lxd...
  - directory dc=lxd... + [ -f /etc/ldap/slapd.d ]
+ slapcat_opts=-g -F /etc/ldap/slapd.d
+ slapcat -g -F /etc...

Read more...

Changed in openldap (Ubuntu):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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