Dapper to Hardy upgrade fails with slapd

Bug #213482 reported by Adam Sommer
6
Affects Status Importance Assigned to Milestone
cyrus-sasl2 (Ubuntu)
Fix Released
High
Michael Vogt

Bug Description

Binary package hint: update-manager

I setup an LDAP server, and configured the system to authenticate using libnss-ldap. I then installed update-manager-core and did do-release-upgrade -d. The process asked to migrate the old libnss-ldap and libpam-ldap configs, I said yes and it got to the upgrading of slapd and died.

This seems to be the relative output:

Setting up python (2.5.2-0ubuntu1) ...

Setting up auth-client-config (0.6) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Selecting previously deselected package ldap-auth-config.
(Reading database ... 19340 files and directories currently installed.)
Unpacking ldap-auth-config (from .../ldap-auth-config_0.5_all.deb) ...
Selecting previously deselected package libcurl3-gnutls.
Unpacking libcurl3-gnutls (from .../libcurl3-gnutls_7.18.0-1ubuntu2_i386.deb) ...
Preparing to replace gnupg 1.4.2.2-1ubuntu2.5 (using .../gnupg_1.4.6-2ubuntu5_i386.deb) ...
Unpacking replacement gnupg ...
(Reading database ... 19368 files and directories currently installed.)
Removing libldap2 ...
dpkg: libsasl2: dependency problems, but removing anyway as you request:
 slapd depends on libsasl2 (>= 2.1.19.dfsg1); however:
  Package libsasl2 is to be removed.
Removing libsasl2 ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
(Reading database ... 19317 files and directories currently installed.)
Preparing to replace libsasl2-modules 2.1.19.dfsg1-0.1ubuntu2 (using .../libsasl2-modules_2.1.22.dfsg1-18ubuntu1_i386.deb) ...
Unpacking replacement libsasl2-modules ...
Selecting previously deselected package libsasl2-2.
Unpacking libsasl2-2 (from .../libsasl2-2_2.1.22.dfsg1-18ubuntu1_i386.deb) ...
Selecting previously deselected package libldap-2.4-2.
Unpacking libldap-2.4-2 (from .../libldap-2.4-2_2.4.7-6ubuntu2_i386.deb) ...
Preparing to replace slapd 2.2.26-5ubuntu2.6 (using .../slapd_2.4.7-6ubuntu2_i386.deb) ...
Stopping OpenLDAP: slapd.
locale: Cannot set LC_ALL to default locale: No such file or directory
  Dumping to /var/backups/slapd-2.2.26-5ubuntu2.6:
  - directory dc=salem,dc=edu... slapcat: error while loading shared libraries: libldap_r-2.2.so.7: cannot open shared object file: No such file or directory
Starting OpenLDAP: (db4.2_recover not found), slapd - failed:
/usr/sbin/slapd: error while loading shared libraries: libldap_r-2.2.so.7: cannot open shared object file: No such file or directory
invoke-rc.d: initscript slapd, action "start" failed.
invoke-rc.d: release upgrade in progress, error is not fatal
Preparing to replace coreutils 5.93-5ubuntu4 (using .../coreutils_6.10-3ubuntu2_i386.deb) ...

Please let me know if you need more information, and I can attach the other logs from /var/log/dist-upgrade.

Thanks

Revision history for this message
Adam Sommer (asommer) wrote :
Revision history for this message
Richard Birnie (rbirnie-deactivatedaccount) wrote :

The other logs from /var/log/dist-upgrade would indeed be useful.

As you noted the relevant point seems to be:

 dpkg: libsasl2: dependency problems, but removing anyway as you request:
 slapd depends on libsasl2 (>= 2.1.19.dfsg1); however:
  Package libsasl2 is to be removed.

I tried to investigate the dependencies of libsasl2:
sudo apt-cache showpkg libsasl2
Package: libsasl2
Versions:

Reverse Depends:
  libsasl2-2,libsasl2
Dependencies:
Provides:
Reverse Provides:

$ sudo apt-cache depends libsasl2-2
libsasl2-2
  Depends: libc6
  Depends: libdb4.2
 |Depends: libsasl2-modules
 |Depends: libsasl2-modules-sql
 |Depends: libsasl2-modules-gssapi-heimdal
  Depends: <libsasl2-modules-kerberos-heimdal>
  Conflicts: postfix
  Conflicts: <libsasl2-gssapi-mit>
  Conflicts: <libsasl2-krb4-mit>
  Replaces: <libsasl2>

Changed in update-manager:
status: New → Incomplete
Revision history for this message
Adam Sommer (asommer) wrote :
Revision history for this message
Adam Sommer (asommer) wrote :
Revision history for this message
Adam Sommer (asommer) wrote :

That should be all of them, again let me know if you need anything else.

Changed in update-manager:
status: Incomplete → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport. It looks like the culprit are these lines:

Preparing to replace slapd 2.2.26-5ubuntu2.6 (using .../slapd_2.4.7-6ubuntu2_i386.deb) ...^M
Stopping OpenLDAP: slapd.^M
  Dumping to /var/backups/slapd-2.2.26-5ubuntu2.6: ^M
  - directory dc=salem,dc=edu... slapcat: error while loading shared libraries: libldap_r-2.2.so.7: cannot open shared object file: No such file or directory^M
failed.^M
dpkg: error processing /var/cache/apt/archives/slapd_2.4.7-6ubuntu2_i386.deb (--unpack):^M
 subprocess pre-installation script returned error exit status 1^M

Changed in update-manager:
importance: Undecided → High
milestone: none → ubuntu-8.04
Revision history for this message
Michael Vogt (mvo) wrote :

I can reproduce this in a clean dapper chroot with slapd installed. The upgrade fails with the same error.

Revision history for this message
Michael Vogt (mvo) wrote :

The problem is that slapcat is used in the slapd preinst but parts of the dependencies for it are no longer available:

# ldd /usr/sbin/slapcat
        linux-vdso.so.1 => (0x00007fff019ff000)
        libldap_r-2.2.so.7 => not found
        liblber-2.2.so.7 => not found
        libiodbc.so.2 => /usr/lib/libiodbc.so.2 (0x00007f19f981d000)
        libslp.so.1 => /usr/lib/libslp.so.1 (0x00007f19f9641000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00007f19f9428000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00007f19f91de000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00007f19f8e5e000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f19f8c26000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00007f19f8a10000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f19f87f4000)
        libltdl.so.3 => /usr/lib/libltdl.so.3 (0x00007f19f86ed000)
        libwrap.so.0 => /lib/libwrap.so.0 (0x00007f19f85e4000)
        libc.so.6 => /lib/libc.so.6 (0x00007f19f8282000)
        libiodbcinst.so.2 => /usr/lib/libiodbcinst.so.2 (0x00007f19f8171000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f19f7f6d000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00007f19f7d54000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f19f7b3d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f19f9752000)

Revision history for this message
Michael Vogt (mvo) wrote :

The database gets dumped/reloaded because the format changes.

The libldap-2.2-7 that is needed to make slapcat work is removed because it depends on libsasl2 that is no longer available (replaced with libsasl2-2) and it has a exact version dependency on the libsasl2-modules packages (libsasl2 has the same for its version). This force libsasl to be removed and that in turn force libldap to get removed.

Revision history for this message
Michael Vogt (mvo) wrote :

It should be sufficient to rename the libsasl2-modules-$foo packages for libsasl2-2 to libsasl2-2-modules-$foo to avoid the removal of libsasl2 (and thus libldap-2.2-7. Not sure if that has any unwanted side effects but I guess not (the reverse depends are tiny).

Revision history for this message
Michael Vogt (mvo) wrote :

This patch fixes the problem for me. But it requires a transition from libsasl2-modules to libsasl2-2-modules for all packages that use the former in their depends or suggests.

I ran a upgrade test with the fix (in the kvm auto-tester and it looks good). It does not break on the upgrade any longer. I will attach the upgrade log too (for verification).

Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :

Looks like my initial fix was overly complicated, a simple transitional package is enough and there is no need for any libsasl2-modules transition :)

Changed in openldap2.3:
assignee: nobody → mvo
status: Triaged → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

Waiting for binary NEW and needs to be added to main.

Changed in cyrus-sasl2:
status: In Progress → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

this package is through binary NEW, and I've just promoted it to main; marking as fix released.

Changed in cyrus-sasl2:
status: Fix Committed → Fix Released
Revision history for this message
Adam Sommer (asommer) wrote : Re: [Bug 213482] Re: Dapper to Hardy upgrade fails with slapd
  • unnamed Edit (192 bytes, text/html; charset=ISO-8859-1)

Hello,

I just did another test upgrade and wanted to report that everything worked
fine. Thank you Michael and Steve, I appreciate it.

--
Party On,
Adam

Revision history for this message
Phil (philippe-briere) wrote :

Hi there,

Please, how do I aplly the fix, precisely and in simple words :} ?

Yours

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.