slapd 2.4.21-0ubuntu5.3 install fails on Ubuntu 10.04.2 LTS

Asked by Mark Jones

Installing slapd on Ubuntu 10.04.2 LTS seems to fail consistently...

# apt-get install slapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  slapd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1,554kB of archives.
After this operation, 4,166kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package slapd.
(Reading database ... 74834 files and directories currently installed.)
Unpacking slapd (from .../slapd_2.4.21-0ubuntu5.3_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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 look at the file referred to in the error:
---- begin /usr/share/slapd/slapd.init.ldif ----
# Global config:
dn: cn=config
objectClass: olcGlobal
cn: config
# Where the pid file is put. The init.d script
# will not stop the server if you change this.
olcPidFile: /var/run/slapd/slapd.pid
# List of arguments that were passed to the server
olcArgsFile: /var/run/slapd/slapd.args
# Read slapd.conf(5) for possible values
olcLogLevel: none
# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
olcToolThreads: 1

# Frontend settings
dn: olcDatabase={-1}frontend,cn=config
objectClass: olcDatabaseConfig
objectClass: olcFrontendConfig
olcDatabase: {-1}frontend
# The maximum number of entries that is returned for a search operation
olcSizeLimit: 500
# Allow unlimited access to local connection from the local root user
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to dn.base="cn=subschema" by * read

# Config db settings
dn: olcDatabase=config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: config
# Allow unlimited access to local connection from the local root user
olcAccess: to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break

# Load schemas
dn: cn=schema,cn=config
objectClass: olcSchemaConfig
cn: schema

include: file:///etc/ldap/schema/core.ldif
---- end /usr/share/slapd/slapd.init.ldif ----

Doing 'dpkg -P slapd', 'apt-get update', 'apt-get dist-upgrade' then trying the slapd install again generated the same results.

I haven't found any bug reports about this specifically. Could this be a local problem that I can resolve?

If this is a bug, would it be reported to the Ubuntu's bug reporting system, or to Debian's?

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openldap Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#1
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#2

(That probably won't solve your problem, but in my opinion it's useful to be sure this isn't secondary to a package manager issue.)

Revision history for this message
Mark Jones (ozmiroid) said :
#3

OK, results from PackageManagerTroubleshootingProcedure ...

Step 1 - This is a headless server, no GUI, so I guessed that this step wanted me to edit sources.list and change occurrences of "us.archive.ubuntu.com" to "archive.ubuntu.com" ... hope that was a correct guess. (Seems to be the same set of IP addresses either way.)

Step 4 -
markjo@insrambackend:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.2 LTS"

markjo@insrambackend:~$ uname -a
Linux insrambackend 2.6.32-28-generic-pae #55-Ubuntu SMP Mon Jan 10 22:34:08 UTC 2011 i686 GNU/Linux

markjo@insrambackend:~$ sudo rm /var/lib/apt/lists/lock
[sudo] password for markjo:

markjo@insrambackend:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup

markjo@insrambackend:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status

markjo@insrambackend:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available

markjo@insrambackend:~$ sudo rm -rf /var/lib/dpkg/updates/*

markjo@insrambackend:~$ sudo rm -rf /var/lib/apt/lists

markjo@insrambackend:~$ sudo rm /var/cache/apt/*.bin

markjo@insrambackend:~$ sudo mkdir /var/lib/apt/lists

markjo@insrambackend:~$ sudo mkdir /var/lib/apt/lists/partial

markjo@insrambackend:~$ LANG=C;sudo apt-get clean

markjo@insrambackend:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done

markjo@insrambackend:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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)

markjo@insrambackend:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
Get:1 http://security.ubuntu.com lucid-security Release.gpg [198B]
Get:2 http://archive.ubuntu.com lucid Release.gpg [189B]
Get:3 http://archive.ubuntu.com lucid-updates Release.gpg [198B]
Get:4 http://security.ubuntu.com lucid-security Release [44.7kB]
Get:5 http://archive.ubuntu.com lucid Release [57.2kB]
Get:6 http://archive.ubuntu.com lucid-updates Release [44.7kB]
Get:7 http://security.ubuntu.com lucid-security/main Packages [134kB]
Get:8 http://archive.ubuntu.com lucid/main Packages [1386kB]
Get:9 http://security.ubuntu.com lucid-security/restricted Packages [14B]
Get:10 http://security.ubuntu.com lucid-security/main Sources [43.7kB]
Get:11 http://security.ubuntu.com lucid-security/restricted Sources [14B]
Get:12 http://security.ubuntu.com lucid-security/universe Packages [61.4kB]
Get:13 http://security.ubuntu.com lucid-security/universe Sources [17.9kB]
Get:14 http://security.ubuntu.com lucid-security/multiverse Packages [1995B]
Get:15 http://security.ubuntu.com lucid-security/multiverse Sources [651B]
Get:16 http://archive.ubuntu.com lucid/restricted Packages [6208B]
Get:17 http://archive.ubuntu.com lucid/main Sources [659kB]
Get:18 http://archive.ubuntu.com lucid/restricted Sources [3775B]
Get:19 http://archive.ubuntu.com lucid/universe Packages [5448kB]
Get:20 http://archive.ubuntu.com lucid/universe Sources [3165kB]
Get:21 http://archive.ubuntu.com lucid/multiverse Packages [180kB]
Get:22 http://archive.ubuntu.com lucid/multiverse Sources [119kB]
Get:23 http://archive.ubuntu.com lucid-updates/main Packages [443kB]
Get:24 http://archive.ubuntu.com lucid-updates/restricted Packages [3240B]
Get:25 http://archive.ubuntu.com lucid-updates/main Sources [178kB]
Get:26 http://archive.ubuntu.com lucid-updates/restricted Sources [1443B]
Get:27 http://archive.ubuntu.com lucid-updates/universe Packages [183kB]
Get:28 http://archive.ubuntu.com lucid-updates/universe Sources [65.2kB]
Get:29 http://archive.ubuntu.com lucid-updates/multiverse Packages [8427B]
Get:30 http://archive.ubuntu.com lucid-updates/multiverse Sources [4369B]
Fetched 12.3MB in 9s (1352kB/s)
Reading package lists... Done

markjo@insrambackend:~$ sudo dpkg --clear-avail

markjo@insrambackend:~$ sudo dpkg --configure -a
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 slapd

markjo@insrambackend:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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)

markjo@insrambackend:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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)

markjo@insrambackend:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get dist-upgrade
Hit http://security.ubuntu.com lucid-security Release.gpg
Hit http://archive.ubuntu.com lucid Release.gpg
Hit http://archive.ubuntu.com lucid-updates Release.gpg
Hit http://archive.ubuntu.com lucid Release
Hit http://archive.ubuntu.com lucid-updates Release
Hit http://archive.ubuntu.com lucid/main Packages
Hit http://archive.ubuntu.com lucid/restricted Packages
Hit http://archive.ubuntu.com lucid/main Sources
Hit http://archive.ubuntu.com lucid/restricted Sources
Hit http://archive.ubuntu.com lucid/universe Packages
Hit http://archive.ubuntu.com lucid/universe Sources
Hit http://archive.ubuntu.com lucid/multiverse Packages
Hit http://archive.ubuntu.com lucid/multiverse Sources
Hit http://archive.ubuntu.com lucid-updates/main Packages
Hit http://archive.ubuntu.com lucid-updates/restricted Packages
Hit http://archive.ubuntu.com lucid-updates/main Sources
Hit http://archive.ubuntu.com lucid-updates/restricted Sources
Hit http://archive.ubuntu.com lucid-updates/universe Packages
Hit http://archive.ubuntu.com lucid-updates/universe Sources
Hit http://archive.ubuntu.com lucid-updates/multiverse Packages
Hit http://security.ubuntu.com lucid-security Release
Hit http://archive.ubuntu.com lucid-updates/multiverse Sources
Hit http://security.ubuntu.com lucid-security/main Packages
Hit http://security.ubuntu.com lucid-security/restricted Packages
Hit http://security.ubuntu.com lucid-security/main Sources
Hit http://security.ubuntu.com lucid-security/restricted Sources
Hit http://security.ubuntu.com lucid-security/universe Packages
Hit http://security.ubuntu.com lucid-security/universe Sources
Hit http://security.ubuntu.com lucid-security/multiverse Packages
Hit http://security.ubuntu.com lucid-security/multiverse Sources
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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)

Step 6 - does not apply, as this is an install, not an upgrade/remove.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#4

What happens if you run

sudo apt-get purge slapd; sudo apt-get install slapd

?

Revision history for this message
Mark Jones (ozmiroid) said :
#5

$ sudo apt-get purge slapd; sudo apt-get install slapd
[sudo] password for markjo:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  slapd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 4,166kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 75074 files and directories currently installed.)
Removing slapd ...
Stopping OpenLDAP: slapd.
Purging configuration files for slapd ...
Removing slapd configuration... done
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  slapd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,554kB of archives.
After this operation, 4,166kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ lucid-updates/main slapd 2.4.21-0ubuntu5.3 [1,554kB]
Fetched 1,554kB in 1s (872kB/s)
Preconfiguring packages ...
Selecting previously deselected package slapd.
(Reading database ... 74834 files and directories currently installed.)
Unpacking slapd (from .../slapd_2.4.21-0ubuntu5.3_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up slapd (2.4.21-0ubuntu5.3) ...
  Creating initial slapd configuration... Loading the initial configuration from the ldif file (/usr/share/slapd/slapd.init.ldif) failed with the following
error while running slapadd:
    slapadd: could not parse entry (line=15)
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)

Revision history for this message
Mark Jones (ozmiroid) said :
#6

Looks to me like /var/lib/dpkg/info/slapd.postinst create_new_configuration() is running
        capture_diagnostics slapadd -F "${SLAPD_CONF}" \
                -b "cn=config" -l ${init_ldif} || failed=1
when it encounters the error.

Where the error message says (line=15) I assume it's referring to /usr/share/slapd/slapd.init.ldif. When i looked at that file, I wasn't sure if slapdadd was counting comment lines or not, so I edited the file and removed all comment lines, so I had the following:

---- begin modified slapd.init.ldif ----
dn: cn=config
objectClass: olcGlobal
cn: config
olcPidFile: /var/run/slapd/slapd.pid
olcArgsFile: /var/run/slapd/slapd.args
olcLogLevel: none
olcToolThreads: 1

dn: olcDatabase={-1}frontend,cn=config
objectClass: olcDatabaseConfig
objectClass: olcFrontendConfig
olcDatabase: {-1}frontend
olcSizeLimit: 500
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to dn.base="cn=subschema" by * read

dn: olcDatabase=config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: config
olcAccess: to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break

dn: cn=schema,cn=config
objectClass: olcSchemaConfig
cn: schema

include: file:///etc/ldap/schema/core.ldif
--- end modified slapd.init.ldif ----

Then I tried "apt-get install slapd" again and got the exact same output as before except:
slapadd: could not parse entry (line=8)

I'm not sure if this refers to the blank line between the first two LDAP entries, or to the first line of the second entry (dn: olcDatabase={-1}frontend,cn=config). Both of those seem to be perfectly valid (looking at examples around the net and the slapd-config man page).

In short, I don't see anything in /usr/share/slapd/slapd.init.ldif that would cause slapadd to stumble.

Revision history for this message
Mark Jones (ozmiroid) said :
#7

Even after "dpkg -P slapd", this remains:

root@insrambackend:~# ls -l /usr/local/sbin/slapadd
lrwxrwxrwx 1 root root 16 2009-12-02 13:05 /usr/local/sbin/slapadd -> ../libexec/slapd

root@insrambackend:~# ls -l /usr/local/libexec/slapd
-rwxr-xr-x 1 root root 1307724 2009-12-02 13:05 /usr/local/libexec/slapd

I did
# find / -xdev -name "*slap*" -ls
and found other symlinks to /usr/local/libexec/slapd, many slapd man pages, lots of files in /usr/local/src/openldap2.3.9, /usr/local/etc/openldap/slapd.conf, and files in /home/maskren/.cpan/build/perl-ldap-0.39 ... all dated 2009 or older.

So it looks like the problem may be an older install of slapd that did not get removed. I will attempt to clean that out before installing slapd again.

Also, I found I could install slapd successfully on another Ubuntu 10.04.2 LTS server... something I should have tried sooner :(

Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#8

The above information indicates that you do not have a package management problem. I recommend running "sudo apt-get purge slapd" to remove everything from the new installation. Then attempt to remove your old installation by running these commands:

cd /usr/local/src/openldap2.3.9
sudo make uninstall

That is by far the best way to uninstall software that you compiled from source in the usual way. So it would be a bad thing to delete that folder, before successfully completing uninstallation using that method. Please post again if you have any trouble removing the old installation, or if removing the old installation does not fix the problem.

Revision history for this message
Mark Jones (ozmiroid) said :
#9

The source of the old program is confirmed:
$ strings /usr/local/libexec/slapd | grep 2.3.9
@(#) $OpenLDAP: slapd 2.3.9 (Dec 2 2009 12:39:11) $
        root@ractest:/usr/local/src/openldap2.3.9/openldap-2.3.9/servers/slapd

However "sudo make uninstall" in /usr/local/src/openldap2.3.9/openldap-2.3.9 results in
make: *** No rule to make target `uninstall'. Stop.

I also find /usr/local/src/sun_one/java_es_05Q4_directory on this server (Sun ONE Directory Server 5.x).

This server is looking messier every time I dig deeper, I'll just rebuild it from scratch.

Thanks for your help!

Revision history for this message
Mark Jones (ozmiroid) said :
#10

Thanks Eliah Kagan, that solved my question.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#11

"sudo make install" should be run in the top-level build directory, which in this case appears to be /usr/local/src/openldap2.3.9 (not /usr/local/src/openldap2.3.9/openldap-2.3.9) ...though I cannot be sure exactly where you extracted the source archive. If you want more help with this, feel free to reopen the question.

That said, considering that you have a system whose history you don't know, you might well experience additional problems down the line (perhaps when it's in production use) due to other past configurations you're unaware of. Therefore, I think flattening and rebuilding is probably a good choice in this case.