I've got a working multi-server installation of ZCS 3.1.1 on four XServes, thanks to the Zimbra team and the following thread: mta not running in OSX multi-server installation

Now, after six months of this version working, I'm attempting to upgrade to 4.0.4. All of the servers have been zmcontrol stopped, OS is still 10.4.6, downloaded the zcs-4.0.4_GA_457.MACOSX.dmg, run the GUI installer, and then su root and /opt/zimbra/libexex/zmsetup.pl.

This is what I get:

ldap:/Users/tech root# /opt/zimbra/libexec/zmsetup.pl
Operations logged to /tmp/zmsetup.log.1323
Checking java version...1.5 found
Setting defaults...Setting defaults from existing config...Warning: null valued key 'mysql_logger_root_password'
Done
Checking for port conflicts
Starting ldap...Done
Setting defaults from ldap...Done
Checking ldap on ldap.rcps.info:389...Success
Checking ldap on ldap.rcps.info:389...Success
Saving config in /opt/zimbra/config.1323...Done
Operations logged to /tmp/zmsetup.log.1323
Setting local config values...Done
Creating SSL certificate...Done
Starting ldap...Done
Saving CA in ldap...Done
Creating server entry for ldap.rcps.info...Done
Configuring SNMP...Done
Setting services on ldap.rcps.info...Done
Setting up zimbra crontab...Done
Setting up syslog.conf...ERROR: service.FAILURE (system failure: getDirectContext) (cause: javax.naming.CommunicationException ldap.rcps.info:389)
Done

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Suite.
The only information that will be transmitted is:
The VERSION of zcs installed (3.1.1_GA_394_MACOSX)
The ADMIN EMAIL ADDRESS created (admin@ldap.rcps.info)

Notify Zimbra of your installation? [Yes]
Notifying Zimbra of installation via http://www.zimbra.com/cgi-bin/notify...ldap.rcps.info

Notification complete

Starting servers...Done.


Operations logged to /tmp/zmsetup.log.1323


Configuration complete - press return to exit


According to the log, it looks like after setting up the certificate it can't restart slapd. Everything looks fine until this point, then I start getting errors:

Creating SSL certificate...
*** Running as zimbra user: cd /opt/zimbra; zmcreatecert

expr: non-numeric argument
/opt/zimbra/bin/zmcreatecert: line 78: [: -lt: unary operator expected
** Importing CA

Certificate was added to keystore
** Creating keystore

** Creating server cert request

Generating a 1024 bit RSA private key
.......++++++
................................++++++
unable to write 'random state'
writing new private key to '/opt/zimbra/ssl/ssl/server/server.key'
-----
** Signing cert request

Using configuration from /opt/zimbra/ssl/ssl/zmssl.cnf
unable to load number from /opt/zimbra/ssl/ssl/ca/ca.srl
error while loading serial number
1927:error:0D066096:asn1 encoding routines:a2i_ASN1_INTEGER:short line:f_int.c:215:
unable to write 'random state'
Signature ok
subject=/C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=ldap.rcps.info
Getting CA Private Key
unable to load number from /opt/zimbra/ssl/ssl/ca/ca.srl
1928:error:0D066096:asn1 encoding routines:a2i_ASN1_INTEGER:short line:f_int.c:215:
unable to write 'random state'
Done

*** Running as zimbra user: /opt/zimbra/bin/ldap stop

Starting ldap...
*** Running as zimbra user: /opt/zimbra/openldap/sbin/slapindex -f /opt/zimbra/conf/slapd.conf

*** Running as zimbra user: /opt/zimbra/bin/ldap start

ERROR - failed to start slapd

*** Running as zimbra user: /opt/zimbra/libexec/zmldapapplyldif

ERROR - failed to start slapd

ldap_bind: Can't contact LDAP server (-1)
ldap_bind: Can't contact LDAP server (-1)
ldap_bind: Can't contact LDAP server (-1)
ldap_bind: Can't contact LDAP server (-1)
ldap_bind: Can't contact LDAP server (-1)
ls: /opt/zimbra/lib/conf/*ldif: No such file or directory
Done

Trying to manually start slapd after this doesn't work, and re-running /opt/zimbra/libexec/zmsetup.pl gives me the following errors:

ldap:/Users/tech root# /opt/zimbra/libexec/zmsetup.pl
Operations logged to /tmp/zmsetup.log.2545
Checking java version...1.5 found
Setting defaults...Setting defaults from existing config...Warning: null valued key 'mysql_logger_root_password'
Done
Checking for port conflicts
Starting ldap...Done
Setting defaults from ldap...ERROR: service.FAILURE (system failure: getDirectContext) (cause: javax.naming.CommunicationException ldap.rcps.info:389)

After about 15-20 of the ERROR: service.FAILURE messages it finally does dump me to the setup menu, but all of the settings look correct and it still fails to start slapd.

Address unconfigured (**) items or correct ldap configuration (? - help)
Checking ldap on ldap.rcps.info:389...FAILED ( /opt/zimbra/bin/ldapsearch -x -h ldap.rcps.info -p 389 -D uid=zimbra,cn=admins,cn=zimbra -w *****
ldap_bind: Can't contact LDAP server (-1) )
Checking ldap on ldap.rcps.info:389...FAILED ( /opt/zimbra/bin/ldapsearch -x -h ldap.rcps.info -p 389 -D uid=zimbra,cn=admins,cn=zimbra -w *****
ldap_bind: Can't contact LDAP server (-1) )

Thanks in advance.

Britt