1

Topic: OpenLDAP BDB startup issues/crashes after installing in fbsd 9.1 jail

==== Required information ====
- iRedMail version:  0.8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: FreeBSD 9.1 / i386 / ZFS / Jail
- Related log if you're reporting an issue:

bdb_db_open: database "dc=...,dc=.." cannot be opened, err 22. Restore from backup!
txn_checkpoint interface requires an environment configured for the transaction subsystem
bdb_db_close: database "dc=...,dc=..": txn_checkpoint failed: Invalid argument (22).
backend_startup_one (type=bdb, suffix="dc=...,dc=.."): bi_db_open failed! (22)
bdb_db_close: database "dc=...,dc=..": alock_close failed
slapd stopped.

sometimes thares another line:
bdb(dc=...,dc=..): unable to allocate memory for mutex; resize mutex region

====

Hello

I have a strange issue with OpenLDAP configured by iRedMail installation.
After the setup finishes, I am able to restart the jail and connect to every web interface, create users, connect to port 25 etc etc.
But after stopping and starting the jail again, I'm getting the slapd issue above.

I'm new to bdb, so if this is not the right place, please direct me to some different list, anyway it happened second time.
At first, I was thinking that I made some mistake during install, so I reinstalled iRedMail, but it happened again.
When I install OpenLdap separately in another jail, I have no issues.

Seems to me like BDB issue, but I don't know how to resize the mustex region (if needed) or restore the db from backup.

Thank you

P.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: OpenLDAP BDB startup issues/crashes after installing in fbsd 9.1 jail

Hello

The question is, why iRedMail instaler installs 4 different versions of BDB?

db41-4.1.25_4       The Berkeley DB package, revision 4.1
db46-4.6.21.4       The Berkeley DB package, revision 4.6
db47-4.7.25.4       The Berkeley DB package, revision 4.7

I was puzzled at first, because db_recover of 4.1 throws an error, but db_recover v4.7 finishes and leaves the data in even more messed up state. Finally I once again recovered the snapshot, ran db_recover v 4.6 and the slapd started.
Is there a reason to have all three of them?
The next step for me is why a correct shutdown of a jail left the database in corrupted state.

Hopefully this will help somebody. I'll keep this thread updated.

3

Re: OpenLDAP BDB startup issues/crashes after installing in fbsd 9.1 jail

I didn't notice this before, i will install iRedMail on FreeBSD Jail tonight to check this issue.
Thanks for your feedback, will come back to you soon.

4

Re: OpenLDAP BDB startup issues/crashes after installing in fbsd 9.1 jail

It's confirmed that this is a "bug" in iRedMail, it doesn't set "WANT_BDB_VER" in /etc/make.conf.
You can set "WANT_BDB_VER=48" in /etc/make.conf before installing iRedMail, then only BDB-4.8 (/usr/ports/databases/db48) will be installed.

Since this is an installation issue, i re-packed iRedMail-0.8.4 and it's now available here:
http://www.iredmail.org/download.html

5

Re: OpenLDAP BDB startup issues/crashes after installing in fbsd 9.1 jail

ZhangHuangbin wrote:

It's confirmed that this is a "bug" in iRedMail, it doesn't set "WANT_BDB_VER" in /etc/make.conf.
You can set "WANT_BDB_VER=48" in /etc/make.conf before installing iRedMail, then only BDB-4.8 (/usr/ports/databases/db48) will be installed.

Since this is an installation issue, i re-packed iRedMail-0.8.4 and it's now available here:
http://www.iredmail.org/download.html

Thanks! I will check if this resolves the strange crashes I have FreeBSD 9.1 jail zfs i386 wink