I'm currently attempting to use berkeley utils on the database files created by openldap, such as db_stat -m . However, I get nothing but an error message. I found this post in the archives, which seems to be the exact same problem: http://www.openldap.org/lists/openldap-software/200401/msg00540.html . However, I don't see a solution, just that I might be inadvertently using the wrong type of backend.Here's what I'm doing:
tamarin# pwd /var/lib/ldap
tamarin# ls alock __db.001 __db.003 __db.005 DB_CONFIG id2entry.bdb member.bdb ou.bdb cn.bdb __db.002 __db.004 __db.006 dn2id.bdb log.0000000001 objectClass.bdb
tamarin# db_stat -m db_stat: Program version 4.3 doesn't match environment version db_stat: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch
tamarin# db_recover db_recover: Program version 4.3 doesn't match environment version db_recover: Unacceptable log file log.0000000001: unsupported log version 11 db_recover: Invalid log file: log.0000000001: Invalid argument db_recover: PANIC: Invalid argument db_recover: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
All the while openldap works perfectly and I can add entries to the directory using ldapadd etc. No complaints in /var/log/local4 either.
The database directive in slapd.conf is set to type "hdb", and the directory directive to /var/lib/ldap. When starting slapd with -d 4 the following line is printed to stdout: "bdb_db_open: dc=test,dc=com". I've tried to specify "bdb" as well, still same result when running db_stat. The way I understood the docs, hdb is merely bdb with a special structure. Anyway: What I haven't set in my slapd.conf is anything under the section "Load dynamic backend modules". In particular, I've left the following directives commented out: # modulepath /usr/lib64/openldap # moduleload back_bdb.la # moduleload back_ldap.la # moduleload back_ldbm.la # moduleload back_passwd.la # moduleload back_shell.la
I tried enabling the modulepath and moduleload directive for back_bdb.la but openldap fails to launch saying the module can't be found, which is not very strange as /usr/lib64/openldap does not exist. Are these modules needed to successfully specify hdb in slapd.conf's database-directive, and does it revert to back-ldbm if not found?
As far as program versions go, I'm not very proficient with *NIX, so I've used yum installs for everything rather than attempt to compile things myself. IHere are the versions: - db4-utils-4.3.29-9.fc6 (db_stat etc) - openldap-servers-2.3.27-8 - openldap-2.3.27-8
I'm obviously going wrong somewhere, but where?
"tamarin p" tamarinp@gmail.com writes:
I'm currently attempting to use berkeley utils on the database files created by openldap, such as db_stat -m . However, I get nothing but an error message. I found this post in the archives, which seems to be the exact same problem: http://www.openldap.org/lists/openldap-software/200401/msg00540.html . However, I don't see a solution, just that I might be inadvertently using the wrong type of backend.Here's what I'm doing:
[...]
tamarin# db_stat -m db_stat: Program version 4.3 doesn't match environment version db_stat: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch
tamarin# db_recover db_recover: Program version 4.3 doesn't match environment version
[...]
As far as program versions go, I'm not very proficient with *NIX, so I've used yum installs for everything rather than attempt to compile things myself. IHere are the versions:
- db4-utils-4.3.29-9.fc6 (db_stat etc)
- openldap-servers-2.3.27-8
- openldap-2.3.27-8
I'm obviously going wrong somewhere, but where?
You must have more than one BerkeleyDB version installed, as openldap-2.3.27 most likely has not been compiled with db-4.3, check the db version slapd has been compiled with and install the apropriate db tools.
-Dieter
On Thursday 10 January 2008 11:54:54 tamarin p wrote:
tamarin# db_stat -m db_stat: Program version 4.3 doesn't match environment version db_stat: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch
tamarin# db_recover db_recover: Program version 4.3 doesn't match environment version db_recover: Unacceptable log file log.0000000001: unsupported log version 11 db_recover: Invalid log file: log.0000000001: Invalid argument db_recover: PANIC: Invalid argument db_recover: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
[...]
As far as program versions go, I'm not very proficient with *NIX, so I've used yum installs for everything rather than attempt to compile things myself. IHere are the versions:
- db4-utils-4.3.29-9.fc6 (db_stat etc)
- openldap-servers-2.3.27-8
- openldap-2.3.27-8
I'm obviously going wrong somewhere, but where?
$ rpm -ql openldap-servers|grep db_
You should see a slapd_db_recover, slapd_db_stat etc., the utils for the internal copy of db-4.3 shipped in the RHEL5 packages of OpenLDAP.
However, running OpenLDAP on db4.3 is not recommended ...
There are some alternative packages available:
http://staff.telkomsa.net/packages/
Regards, Buchan
Buchan Milne wrote:
On Thursday 10 January 2008 11:54:54 tamarin p wrote:
As far as program versions go, I'm not very proficient with *NIX, so I've used yum installs for everything rather than attempt to compile things myself. IHere are the versions:
- db4-utils-4.3.29-9.fc6 (db_stat etc)
- openldap-servers-2.3.27-8
- openldap-2.3.27-8
I'm obviously going wrong somewhere, but where?
$ rpm -ql openldap-servers|grep db_
You should see a slapd_db_recover, slapd_db_stat etc., the utils for the internal copy of db-4.3 shipped in the RHEL5 packages of OpenLDAP.
However, running OpenLDAP on db4.3 is not recommended ...
It's quite obvious from the BerkeleyDB error messages:
tamarin# db_stat -m db_stat: Program version 4.3 doesn't match environment version db_stat: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch tamarin# db_recover db_recover: Program version 4.3 doesn't match environment version db_recover: Unacceptable log file log.0000000001: unsupported log version 11 db_recover: Invalid log file: log.0000000001: Invalid argument db_recover: PANIC: Invalid argument db_recover: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
that OpenLDAP wasn't using BDB 4.3 here. Naturally attempting to use the 4.3 db_stat and other utilities would also fail. Most likely it was using something older than 4.3, otherwise it wouldn't have complained about the unsupported log file version.
On Friday 11 January 2008 11:53:00 Buchan Milne wrote:
On Thursday 10 January 2008 11:54:54 tamarin p wrote:
tamarin# db_stat -m db_stat: Program version 4.3 doesn't match environment version db_stat: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch
tamarin# db_recover db_recover: Program version 4.3 doesn't match environment version db_recover: Unacceptable log file log.0000000001: unsupported log version 11 db_recover: Invalid log file: log.0000000001: Invalid argument db_recover: PANIC: Invalid argument db_recover: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
[...]
As far as program versions go, I'm not very proficient with *NIX, so I've used yum installs for everything rather than attempt to compile things myself. IHere are the versions:
- db4-utils-4.3.29-9.fc6 (db_stat etc)
- openldap-servers-2.3.27-8
- openldap-2.3.27-8
I'm obviously going wrong somewhere, but where?
$ rpm -ql openldap-servers|grep db_
You should see a slapd_db_recover, slapd_db_stat etc., the utils for the internal copy of db-4.3 shipped in the RHEL5 packages of OpenLDAP.
That should be db-4.4.
Regards, Buchan
openldap-software@openldap.org