Mysql error - New Zimbra installation

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
delerium34
Posts: 4
Joined: Sat Sep 13, 2014 1:45 am

Mysql error - New Zimbra installation

Postby delerium34 » Mon May 23, 2011 6:09 pm

Hi,
I just install Zimbra on a new server and everything went well. But I can't acces the website (both http/https). I check in the mailbox.log and I have the following errors:
Caused by: java.sql.SQLException: Access denied for user 'zimbra'@'localhost' (using password: YES)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)

at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)

at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2172)

... 56 more


My guess is that the zimbra user is not authorized to log into the database, but I don't why, and how to fix this.
Anyone have an idea?
Thanks, appreciated.


mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 4:39 am

delerium34,
Did you ever solve this? And if so, how? I'm having the same problem. :(
Any assistance greatly appreciated.
phoenix
Ambassador
Ambassador
Posts: 26330
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Mysql error - New Zimbra installation

Postby phoenix » Sat Dec 10, 2011 5:05 am

[quote user="mlanner"]Did you ever solve this? And if so, how? I'm having the same problem. :([/QUOTE]How about some further information about the problem? Log file entries? New install or an upgrade or your current installation? ZCS version and release? Has it just happened? Which operating system? What have you tried to resolve the problem? What's the status of the services?
Did you look at some of the forums threads on this topic: http://search.yahoo.com/search?p=site%3Azimbra.com+%2B%22Access+denied+for+user+%27zimbra%27%40%27localhost%27%22&ei=UTF-8&fr=moz35[/url]
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 6:04 am

Bill,
This is a migration from a 32-bit machine to a 64-bit Ubuntu 10.04 machine. I've followed the Network Edition: Moving from 32-bit to 64-bit Server - Zimbra :: Wiki and Platform and OS Independent ZCS to ZCS Migration Using Rsync - Zimbra :: Wiki instructions. The 64-bit installation is fine, until I restore LDAP, after that it craps out.
And when checking Zimbra status, I get:



zimbra@mail:~$ zmcontrol status

Host mail.domain.com

antispam Running

antivirus Running

convertd Running

ldap Running

logger Running

mailbox Stopped

zmmailboxdctl is not running.

mta Running

snmp Running

spell Running

stats Running


My mailbox.log provides the following:



2011-12-10 01:11:03,432 WARN [main] [] misc - Could not establish a connection to the database. Retrying in 5 seconds.

com.zimbra.common.service.ServiceException: system failure: getting database connection

ExceptionId:main:1323508263432:54e1ffc754a39254

Code:service.FAILURE

at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:248)

at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:313)

at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:277)

at com.zimbra.cs.db.DbPool.waitForDatabase(DbPool.java:199)

at com.zimbra.cs.db.DbPool.startup(DbPool.java:190)

at com.zimbra.cs.util.Zimbra.startup(Zimbra.java:156)

at com.zimbra.cs.util.Zimbra.startup(Zimbra.java:123)

at com.zimbra.soap.SoapServlet.init(SoapServlet.java:125)

at javax.servlet.GenericServlet.init(GenericServlet.java:241)

at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)

at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1254)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:471)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.jetty.handler.DebugHandler.doStart(DebugHandler.java:127)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.jetty.Server.doStart(Server.java:224)

at org.mortbay.setuid.SetUIDServer.doStart(SetUIDServer.java:158)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.mortbay.start.Main.invokeMain(Main.java:194)

at org.mortbay.start.Main.start(Main.java:534)

at org.mortbay.start.Main.start(Main.java:441)

at org.mortbay.start.Main.main(Main.java:119)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user 'zimbra'@'localhost' (using password: YES)'.
** BEGIN NESTED EXCEPTION **
java.sql.SQLException

MESSAGE: Access denied for user 'zimbra'@'localhost' (using password: YES)
STACKTRACE:
java.sql.SQLException: Access denied for user 'zimbra'@'localhost' (using password: YES)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885)

at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2924)

at com.mysql.jdbc.Connection.(Connection.java:1555)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)

at java.sql.DriverManager.getConnection(DriverManager.java:582)

at java.sql.DriverManager.getConnection(DriverManager.java:154)

at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:68)

at com.zimbra.cs.db.ZimbraConnectionFactory.createConnection(ZimbraConnectionFactory.java:66)

at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)

at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)

at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)

at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:294)

at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:277)

at com.zimbra.cs.db.DbPool.waitForDatabase(DbPool.java:199)

at com.zimbra.cs.db.DbPool.startup(DbPool.java:190)

at com.zimbra.cs.util.Zimbra.startup(Zimbra.java:156)

at com.zimbra.cs.util.Zimbra.startup(Zimbra.java:123)

at com.zimbra.soap.SoapServlet.init(SoapServlet.java:125)

at javax.servlet.GenericServlet.init(GenericServlet.java:241)

at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)

at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1254)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:471)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.jetty.handler.DebugHandler.doStart(DebugHandler.java:127)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

at org.mortbay.jetty.Server.doStart(Server.java:224)

at org.mortbay.setuid.SetUIDServer.doStart(SetUIDServer.java:158)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.mortbay.start.Main.invokeMain(Main.java:194)

at org.mortbay.start.Main.start(Main.java:534)

at org.mortbay.start.Main.start(Main.java:441)

at org.mortbay.start.Main.main(Main.java:119)


** END NESTED EXCEPTION **


Attempted reconnect 3 times. Giving up.

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2997)

at com.mysql.jdbc.Connection.(Connection.java:1555)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)

at java.sql.DriverManager.getConnection(DriverManager.java:582)

at java.sql.DriverManager.getConnection(DriverManager.java:154)

at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:68)

at com.zimbra.cs.db.ZimbraConnectionFactory.createConnection(ZimbraConnectionFactory.java:66)

at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)

at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)

at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)

at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:294)

... 39 more


However, when trying to log in to MySQL using:



[zimbra@myhost ~]$ mysql mysql



OR

[zimbra@myhost ~]$ mysql zimbra 


... it works just fine logging in.
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 7:28 am

I started from scratch ... again. Clean install of 6.0.14 on Ubuntu 10.04. After installation, Zimbra runs fine. I then shut down Zimbra. When I restore the LDAP-config by running:

root@mail:/# /opt/zimbra/openldap/sbin/slapadd -q -n 0 -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap-config.bak


I get the following:



slapadd: could not add entry dn="cn=config" (line=1):

slapadd: could not add entry dn="cn=module{0},cn=config" (line=41):

slapadd: could not add entry dn="cn=schema,cn=config" (line=57):

slapadd: could not add entry dn="cn={0}core,cn=schema,cn=config" (line=912):

slapadd: could not add entry dn="cn={1}cosine,cn=schema,cn=config" (line=1143):

slapadd: could not add entry dn="cn={2}inetorgperson,cn=schema,cn=config" (line=1308):

slapadd: could not add entry dn="cn={3}zimbra,cn=schema,cn=config" (line=1348):

slapadd: could not add entry dn="cn={4}amavisd,cn=schema,cn=config" (line=6580):

slapadd: could not add entry dn="olcDatabase={-1}frontend,cn=config" (line=6712): Already exists

slapadd: could not add entry dn="olcDatabase={0}config,cn=config" (line=6732): Already exists

database init failed (monitor)

olcDatabase: value #0: only one monitor database allowed (monitor)

slapadd: could not add entry dn="olcDatabase={1}monitor,cn=config" (line=6750):

slapadd: could not add entry dn="olcDatabase={2}hdb,cn=config" (line=6768): Already exists

_#################### 100.00% eta none elapsed none fast!

Closing DB...



That doesn't look right to me.
phoenix
Ambassador
Ambassador
Posts: 26330
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Mysql error - New Zimbra installation

Postby phoenix » Sat Dec 10, 2011 7:33 am

As you've mentioned two wiki articles in your earlier post I have to ask, the only instructions you should be following are these: Network Edition: Moving from 32-bit to 64-bit Server - Zimbra :: Wiki - is that what you're doing?
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 7:52 am

Yes, that's what I did the first time. Did not work. I used those same directions previously, on another host that I migrated. It worked fine. This time around, not so much, although I'm doing it the exact same way. :S
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 8:07 am

Here are my exact steps:
On OLD host:



mkdir /backup

chown zimbra:zimbra /backup

As zimbra:

/opt/zimbra/libexec/zmslapcat /backup

/opt/zimbra/libexec/zmslapcat -c /backup


On NEW host:



mkdir /backup

chown zimbra:zimbra /backup

rm -rf /opt/zimbra/data/ldap/config/*

rm -rf /opt/zimbra/data/ldap/hdb/*

mkdir -p /opt/zimbra/data/ldap/hdb/db /opt/zimbra/data/ldap/hdb/logs


On OLD host:



rsync -avz -e ssh --progress /opt/zimbra/data/ldap/hdb/db/DB_CONFIG root@[ip-address]:/opt/zimbra/data/ldap/hdb/db


On NEW host:

chown -R zimbra:zimbra /opt/zimbra/data/ldap

On OLD host:



rsync -avz -e ssh --progress /backup/ root@[ip-address]:/backup


On NEW host:



/opt/zimbra/openldap/sbin/slapadd -q -n 0 -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap-config.bak

/opt/zimbra/openldap/sbin/slapadd -q -b "" -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap.bak

phoenix
Ambassador
Ambassador
Posts: 26330
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Mysql error - New Zimbra installation

Postby phoenix » Sat Dec 10, 2011 8:35 am

This is a test server you're using, isn't it? On the new server, shutdown ZCS and try the following command and see what you get with that:
/opt/zimbra/libexec/zmmyinit
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Mysql error - New Zimbra installation

Postby mlanner » Sat Dec 10, 2011 11:33 am

Well, test server or not ... I guess you can call it that ... but if everything went well during migration, the "NEW" host wouldn't be a test server. If the "NEW" server came up properly, it would become the new production server and the "OLD" server would be turned off, retired and eventually erased.
Basically, to turn the scenario and thinking around a bit, I guess it might be useful to look at the situation as a case with a completely dead production server, one that has a perfectly good Zimbra NE generated backup on remote storage. Now, how would I go about restoring to a new server, assuming that I have a good backup?

Return to “Administrators”

Who is online

Users browsing this forum: MSN [Bot] and 3 guests