Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-87

Setup wizard fails on MySQL 5 - Could not execute JDBC batch update

    • Icon: Bug Bug
    • Resolution: Answered
    • Icon: Medium Medium
    • None
    • None
    • Installation/Setup
    • None

      Exception is attached.

      12:52:41,593 DEBUG crowd.console.action.setup.DefaultAdministrator: Could not execute JDBC batch update; nested exception is:
      com.atlassian.crowd.util.persistence.PersistenceException: Could not execute JDBC batch update
      java.rmi.RemoteException: Could not execute JDBC batch update; nested exception is:
      com.atlassian.crowd.util.persistence.PersistenceException: Could not execute JDBC batch update
      at com.atlassian.crowd.integration.directory.internal.InternalDirectory.addGroup(InternalDirectory.java:110)
      at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.addGroup(DirectoryManagerGeneric.java:140)
      at com.atlassian.crowd.console.action.setup.DefaultAdministrator.doUpdate(DefaultAdministrator.java:64)
      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:585)
      at webwork.action.ActionSupport.invokeCommand(ActionSupport.java:415)
      at webwork.action.ActionSupport.execute(ActionSupport.java:144)
      at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131)
      at webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:174)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
      at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at com.atlassian.crowd.console.filter.SetupFilter.doFilter(SetupFilter.java:57)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at com.atlassian.crowd.util.persistence.hibernate.SessionManagerFilter.doFilter(SessionManagerFilter.java:62)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: com.atlassian.crowd.util.persistence.PersistenceException: Could not execute JDBC batch update
      at com.atlassian.crowd.util.persistence.hibernate.HibernateDAO.save(HibernateDAO.java:30)
      at com.atlassian.crowd.model.group.GroupDAOHibernate.add(GroupDAOHibernate.java:25)
      at com.atlassian.crowd.integration.directory.internal.InternalDirectory.addGroup(InternalDirectory.java:107)
      ... 35 more
      Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
      at com.atlassian.crowd.util.persistence.hibernate.HibernateDAO.save(HibernateDAO.java:26)
      ... 37 more
      Caused by: java.sql.BatchUpdateException: Table 'crowddb.remotegroupmembers' doesn't exist
      at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:896)
      at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
      at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
      ... 43 more

            [CWD-87] Setup wizard fails on MySQL 5 - Could not execute JDBC batch update

            Damon Rand added a comment -

            Hi Igor and Mickael,

            We have Crowd 1.0.7 working on utf8 with MySQL 5.0.27.. Sorry we don't remember doing anything special to make it work though..

            Take a look at CWD-147 and see if that helps you out.

            Damon.

            Damon Rand added a comment - Hi Igor and Mickael, We have Crowd 1.0.7 working on utf8 with MySQL 5.0.27.. Sorry we don't remember doing anything special to make it work though.. Take a look at CWD-147 and see if that helps you out. Damon.

            The bug is still there in crowd 1.1.

            I was able to work around this bug by running the "create table" manually and reducing length of varchar fields to varchar(160).

            I also checked catalina.out and found a few other failed DDL requests, which I also tweaked until they worked.

            Igor Sereda [ALM Works] added a comment - The bug is still there in crowd 1.1. I was able to work around this bug by running the "create table" manually and reducing length of varchar fields to varchar(160). I also checked catalina.out and found a few other failed DDL requests, which I also tweaked until they worked.

            Hello, I do not know why this ticket is closed as the problem is still there.
            I am googling like crazy to find a solution to this but for know, except switching db to latin1 (which is not what the Crowd documentation recommand), I do not see any answer.
            To me it seems that the configuration as stated in the documentation cannot work.

            Mickaël Rémond added a comment - Hello, I do not know why this ticket is closed as the problem is still there. I am googling like crazy to find a solution to this but for know, except switching db to latin1 (which is not what the Crowd documentation recommand), I do not see any answer. To me it seems that the configuration as stated in the documentation cannot work.

            MySQL related issue.

            Justen Stepka [Atlassian] added a comment - MySQL related issue.

            I Justen, yes the dialect is set properly.. I was able to work around the problem by manually running the failing sql commands adjusting back to latin1 as follows.. I now have crowd up and running on MySQL!

            create table `REMOTEGROUPMEMBERS` (`REMOTEGROUPDIRECTORYID` bigint not null, `REMOTEGROUPNAME` varchar(255) not null, `REMOTEPRINCIPALDIRECTORYID` bigint not null, `REMOTEPRINCIPALNAME` varchar(255) not null, primary key (`REMOTEGROUPDIRECTORYID`, `REMOTEGROUPNAME`, `REMOTEPRINCIPALDIRECTORYID`, `REMOTEPRINCIPALNAME`))
            DEFAULT CHARACTER SET latin1;

            Damon Rand added a comment - I Justen, yes the dialect is set properly.. I was able to work around the problem by manually running the failing sql commands adjusting back to latin1 as follows.. I now have crowd up and running on MySQL! create table `REMOTEGROUPMEMBERS` (`REMOTEGROUPDIRECTORYID` bigint not null, `REMOTEGROUPNAME` varchar(255) not null, `REMOTEPRINCIPALDIRECTORYID` bigint not null, `REMOTEPRINCIPALNAME` varchar(255) not null, primary key (`REMOTEGROUPDIRECTORYID`, `REMOTEGROUPNAME`, `REMOTEPRINCIPALDIRECTORYID`, `REMOTEPRINCIPALNAME`)) DEFAULT CHARACTER SET latin1;

            Is the hibernate.properties set to the MySQL dialect?

            This can be done manually by editing the WEB-INF/classes/hibernate.properties file or you can edit the build.properties file and run build.sh.

            Justen Stepka [Atlassian] added a comment - Is the hibernate.properties set to the MySQL dialect? This can be done manually by editing the WEB-INF/classes/hibernate.properties file or you can edit the build.properties file and run build.sh.

            Damon Rand added a comment -

            Tracked this down to this MySQL issue. http://bugs.mysql.com/bug.php?id=4541

            Seems that Crowd sql generation fails witht UTF-8 mysql on this command..

            create table `REMOTEGROUPMEMBERS` (`REMOTEGROUPDIRECTORYID` bigint not null, `REMOTEGROUPNAME` varchar(255) not null, `REMOTEPRINCIPALDIRECTORYID` bigint not null, `REMOTEPRINCIPALNAME` varchar(255) not null, primary key (`REMOTEGROUPDIRECTORYID`, `REMOTEGROUPNAME`, `REMOTEPRINCIPALDIRECTORYID`, `REMOTEPRINCIPALNAME`))

            Apparently the compound primary key is more than 1000 characters.. I am going to switch of UTF-8 for now.

            Damon Rand added a comment - Tracked this down to this MySQL issue. http://bugs.mysql.com/bug.php?id=4541 Seems that Crowd sql generation fails witht UTF-8 mysql on this command.. create table `REMOTEGROUPMEMBERS` (`REMOTEGROUPDIRECTORYID` bigint not null, `REMOTEGROUPNAME` varchar(255) not null, `REMOTEPRINCIPALDIRECTORYID` bigint not null, `REMOTEPRINCIPALNAME` varchar(255) not null, primary key (`REMOTEGROUPDIRECTORYID`, `REMOTEGROUPNAME`, `REMOTEPRINCIPALDIRECTORYID`, `REMOTEPRINCIPALNAME`)) Apparently the compound primary key is more than 1000 characters.. I am going to switch of UTF-8 for now.

              Unassigned Unassigned
              65037adbeda8 Damon Rand
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: