Dist-Upgrade Karmic->Lucid: Upgrading slapd fails with "chown: invalid argument: `'"

Bug #574474 reported by Daniel Kamm
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openldap (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: slapd

Upgrading the system from Karmic Koala to Lucid Lynx. While upgrading, the installation of the new package for slapd fails. I couldn't fetch the original messages while upgrading, but afterwards by doing a 'aptitude -f install' the following appears:

root@srv-tresa:~# aptitude -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following partially installed packages will be configured:
  slapd
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Setting up slapd (2.4.21-0ubuntu5) ...
  Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.4.18-0ubuntu1... done.
chown: invalid argument: `'
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up slapd (2.4.21-0ubuntu5) ...
  Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.4.18-0ubuntu1... done.
chown: invalid argument: `'
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 slapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: slapd 2.4.21-0ubuntu5
ProcVersionSignature: Ubuntu 2.6.32-21.32-server 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-server x86_64
Architecture: amd64
Date: Mon May 3 15:21:42 2010
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: openldap

Revision history for this message
Daniel Kamm (ylz-ylz) wrote :
Revision history for this message
Nathan Stratton Treadway (nathanst) wrote :

The slapd.postinst script attempts to ensure that various files and directories have the proper ownerships (and permissions) set. It looks like it may be having trouble extracting the correct list of directories in your case.

Can you post the output of the following command (run as root)?

  grep -E "^(include|database|suffix|directory)" /etc/ldap/slapd.conf

Hopefully that will give some hint as to what is causing the confusion.

Revision history for this message
C de-Avillez (hggdh2) wrote :

setting status incomplete, waiting for user feedback

Changed in openldap (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel Kamm (ylz-ylz) wrote :

Here the requested output:

root@srv-tresa:/# grep -E "^(include|database|suffix|directory)" /etc/ldap/slapd.conf
include /etc/ldap/srv-nolla/common/schemas.include
include /etc/ldap/srv-tresa/overlays.d/consumer_chaining-writes.include
database hdb
include /etc/ldap/srv-nolla/common/suffix.include
include /etc/ldap/srv-tresa/passwd.d/rootpw.passwd
directory "/var/lib/ldap"
include /etc/ldap/srv-nolla/common/indexes.include
include /etc/ldap/srv-nolla/common/acl.include
include /etc/ldap/srv-tresa/overlays.d/consumer_replsync.include

slapd.conf depends heavily on chained include files, which are checked out from a subversion repository. All files are owned by openldap:openldap, as well as the /var/lib/ldap sleepycat DB.

Revision history for this message
Nathan Stratton Treadway (nathanst) wrote :

Yes, I think that explains why you are getting the "chown: invalid argument `'" error....

Specifically, when the slapd.postinst parses through the slapd.conf file, it attempts to process "include"d files... but it assumes that the "database", "suffix", and "directory" lines for a particular database are all found in the same file.

So in your case, it looks through all the files and find a "suffix" line (i.e. presumably one found in "suffix.include"), but then when it goes to look up what directory that suffix was tied to, it isn't able to associate that suffix with the "directory" line found there in your "slapd.conf" file. (This in turn means that it ends up calling chown with an empty FILE argument, e.g.
  chown openldap ""
, which then generates the error message you see).

In the short run, since your database files do already have the correct permissions, you can probably work around this dpkg error by commenting out the "update_databases_permissions" line in slapd.postinst (its line 670 in the script for slapd 2.4.21-0ubuntu5), and then running "dpkg --configure" again.

Obviously you will be likely to have the same problem again the next time slapd is upgraded... but I don't know if there will be any easy fix for that, given the general move away from slapd.conf-style configuration....

Revision history for this message
joschi (jochen+launchpad-schalanda) wrote :

I had the same problem upgrading slapd on Ubuntu 10.04 LTS.

Using a workaround (commenting out SLAPD_CONF in /etc/default/slapd and running `aptitude -f install`) I was able to make dpkg happy.

Generally it's IMHO a bad idea to do too much magic in the postinst script of the slapd package - at least if it breaks so easily.

> Obviously you will be likely to have the same problem again
> the next time slapd is upgraded... but I don't know if there
> will be any easy fix for that, given the general move away
> from slapd.conf-style configuration....

Unfortunately the new dynamic configuration (cn=config) is no viable alternative at the moment, as not all modules configuration is available through it (e. g. it's not possible to configure a meta backend using the new configuration style).

Changed in openldap (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Nathan Stratton Treadway (nathanst) wrote :

This bug is related to to LP: #632051. The two are triggered by a different specific issue within the slapd.conf file, and would need different changes to the postinst script in order to allow it to actually parse the config file correctly... but I think the patch I proposed in that bug would allow the package upgrade to complete, with a warning message, in both situations (rather than aborting and leaving the package in an unconfigured state, as currently happens in both situations).

Thierry Carrez (ttx)
Changed in openldap (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Mark J. Reed (markjreed) wrote :

> Unfortunately the new dynamic configuration (cn=config) is no viable alternative at the moment, as not all modules
> configuration is available through it (e. g. it's not possible to configure a meta backend using the new configuration
> style).

But AFAICT the slapd package on Ubuntu comes with no slapd.conf, just a cn=config. So why is the postinst script still looking for one?

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.