Articles in this section

Emails are not sent or received in Plesk while Amavis reports the error: Suicide in child_init_hook: BDB can't connect db env

kb: technical mail

Applicable to:

  • Plesk for Linux

Symptoms

  • Amavis reports the following error message in /var/log/maillog:

    CONFIG_TEXT: Message: (!)_DIE: Suicide in child_init_hook: BDB can't connect db env. at /var/spool/amavisd/db: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch, Operation not permitted. at (eval 79) line 338.

  • Amavis can also report the following error message in /var/log/maillog:

    CONFIG_TEXT: (!!)TROUBLE in child_init_hook: BDB can't connect db env. at /var/spool/amavisd/db: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch, No such file or directory. at /usr/share/perl5/vendor_perl/Amavis/DB.pm line 82.

  • Emails may not be sent and or received.
  • Incoming emails are deferred in the mail queue with the following message in /var/log/maillog:

    CONFIG_TEXT: status=deferred (delivery temporarily suspended: conversation with 127.0.0.1[127.0.0.1] timed out while receiving the initial server greeting)

  • The amavisd service is reported as active, but port 10024 does not return a greeting.

Cause

This is a bug in the libdb library of RHEL-based operating systems (libdb-5.3.28-56 and later), tracked in Plesk as EXTPLESK-14695. If glibc is updated while Amavis is running (for example, by Plesk automatic system updates), Amavis worker processes started afterwards cannot initialize the Berkeley DB environment in /var/spool/amavisd/db/ when its database files have an inode number above 2147483647, and email processing stops.

Root cause confirmed by the development team in EXTPLESK-14695 (related support cases: PPS-19502, PPS-19415, PPS-13059).

Plesk Email Security does not use the Amavis Berkeley DB data: its policies and storage are kept in SQL, and nothing reads snmp.db or nanny.db. The $enable_db = 1 value comes from the stock EPEL amavisd.conf, so $enable_db = 0 is a supported permanent fix (tested by the development team).

To confirm the cause on a server, compare the two timestamps below. They match while Amavis is healthy and differ after a glibc update. db_stat is provided by the libdb-utils package.

# db_stat -e -h /var/spool/amavisd/db | grep -i 'libpthread timestamp'

# date -d @$(stat -c %Y /usr/lib64/libc.so.6)

Resolution

  1. Connect to the server via SSH.
  2. Check that the inode number of the Amavis Berkeley DB file is above 2147483647:

    # ls -i /var/spool/amavisd/db/__db.001

  3. Create a backup copy of the Amavis configuration file:

    # cp -a /etc/amavisd/amavisd.conf /etc/amavisd/amavisd.conf.bak

  4. Edit the file /etc/amavisd/amavisd.conf and change $enable_db = 1; to $enable_db = 0;.
  5. Warning: The following steps will cause a brief service interruption.

    Restart the amavisd service:

    # systemctl restart amavisd

  6. Force deferred emails in the mail queue to be delivered:

    # postqueue -f

    # postsuper -r ALL

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.