Details

    • Similar Issues:
      Show 4 results 

      Description

      07:18,291 ERROR [MainServlet:196] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.Upgrade
      eption: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '11034-11026-21604' for key 'PRIMARY'
      .liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.
      QLIntegrityConstraintViolationException: Duplicate entry '11034-11026-21604' for key 'PRIMARY'
      at com.liferay.portal.events.StartupAction.run(StartupAction.java:53)
      at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1160)
      at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:193)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      sed by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationExcept
      : Duplicate entry '11034-11026-21604' for key 'PRIMARY'
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
      at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:80)
      at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:37)
      at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
      at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
      at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:94)
      at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:117)
      at com.liferay.portal.events.StartupAction.run(StartupAction.java:47)
      ... 29 more
      sed by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '11034-11026-21604' for key 'PR
      RY'
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:130)
      at com.liferay.portal.upgrade.UpgradeProcess_6_0_3.doUpgrade(UpgradeProcess_6_0_3.java:43)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
      ... 36 more
      sed by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '11034-11026-21604' for key 'PRIMARY'
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
      at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
      at com.liferay.portal.upgrade.v6_0_3.UpgradePermission.addUserGroupRole(UpgradePermission.java:120)
      at com.liferay.portal.upgrade.v6_0_3.UpgradePermission.assignSingleApproverWorkflowRoles(UpgradePermission.java:204)
      at com.liferay.portal.upgrade.v6_0_3.UpgradePermission.updatePermissions_5(UpgradePermission.java:313)
      at com.liferay.portal.upgrade.v6_0_3.UpgradePermission.doUpgrade(UpgradePermission.java:247)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
      ... 39 more
      pping the server due to unexpected startup errors

        Activity

        Hide
        Arcko Duan added a comment -

        In updatePermissions_5() function, query
        select ResourceCode.companyId,
        Roles_Permissions.roleId, Resource_.primKey from
        Resource_, ResourceCode, Permission_,
        Roles_Permissions where Resource_.codeId =
        ResourceCode.codeId and ResourceCode.name =
        'com.liferay.portlet.journal' AND
        ResourceCode.scope = 4 AND Resource_.resourceId =
        Permission_.resourceId AND Permission_.actionId =
        'APPROVE_ARTICLE' AND Permission_.permissionId =
        Roles_Permissions.permissionId

        will be possible to return several line of records with same companyId and primKey, but with different roleIds.

        If a user with several of these roles,

        then assignSingleApproverWorkflowRoles(long companyId, long roleId, long groupId) will run several times with adding same record to 'UserGroupRole' table by calling
        addUserGroupRole(userId, groupId, communityContentReviewerRoleId);

        To avoid of this,

        Could add 'Group By primKey' to above query.

        Show
        Arcko Duan added a comment - In updatePermissions_5() function, query select ResourceCode.companyId, Roles_Permissions.roleId, Resource_.primKey from Resource_, ResourceCode, Permission_, Roles_Permissions where Resource_.codeId = ResourceCode.codeId and ResourceCode.name = 'com.liferay.portlet.journal' AND ResourceCode.scope = 4 AND Resource_.resourceId = Permission_.resourceId AND Permission_.actionId = 'APPROVE_ARTICLE' AND Permission_.permissionId = Roles_Permissions.permissionId will be possible to return several line of records with same companyId and primKey, but with different roleIds. If a user with several of these roles, then assignSingleApproverWorkflowRoles(long companyId, long roleId, long groupId) will run several times with adding same record to 'UserGroupRole' table by calling addUserGroupRole(userId, groupId, communityContentReviewerRoleId); To avoid of this, Could add 'Group By primKey' to above query.
        Hide
        Arcko Duan added a comment -

        This happens when using permissions.user.check.algorithm=5

        Show
        Arcko Duan added a comment - This happens when using permissions.user.check.algorithm=5
        Hide
        Nicolas Grué added a comment -

        I have this when upgrading to 6.0.5 too.
        Arcko, did you fix this by changing the query in class com.liferay.portal.upgrade.v6_0_3.UpgradePermission ?

        Show
        Nicolas Grué added a comment - I have this when upgrading to 6.0.5 too. Arcko, did you fix this by changing the query in class com.liferay.portal.upgrade.v6_0_3.UpgradePermission ?
        Hide
        Nicolas Grué added a comment -

        Workaround: delete "approve_article' permission for nay role that is not "Owner". Since approval has changed in liferay , you will have to configure workflow approval manually anyway.

        If you are forced to do this by SQL, follow these steps:

        • first, isolate the lines in this request, where roleId does not refer to "Owner".

        select ResourceCode.companyId,
        Roles_Permissions.roleId, Resource_.primKey from
        Resource_, ResourceCode, Permission_,
        Roles_Permissions where Resource_.codeId =
        ResourceCode.codeId and ResourceCode.name =
        'com.liferay.portlet.journal' AND
        ResourceCode.scope = 4 AND Resource_.resourceId =
        Permission_.resourceId AND Permission_.actionId =
        'APPROVE_ARTICLE' AND Permission_.permissionId =
        Roles_Permissions.permissionId

        for me, it was roleId=10182, primKey=12810

        • then, execute this request (changing with proper values):
          DELETE FROM `Roles_Permissions` WHERE `roleId` = 10182 AND `permissionId` IN (SELECT permissionId FROM `Permission_` WHERE resourceId IN ( SELECT resourceId FROM `Resource_` WHERE `primKey` = '12810' ) AND actionId = 'APPROVE_ARTICLE' );

        Of cours you have to do that, before starting your app server for the upgrade.

        Show
        Nicolas Grué added a comment - Workaround: delete "approve_article' permission for nay role that is not "Owner". Since approval has changed in liferay , you will have to configure workflow approval manually anyway. If you are forced to do this by SQL, follow these steps: first, isolate the lines in this request, where roleId does not refer to "Owner". select ResourceCode.companyId, Roles_Permissions.roleId, Resource_.primKey from Resource_, ResourceCode, Permission_, Roles_Permissions where Resource_.codeId = ResourceCode.codeId and ResourceCode.name = 'com.liferay.portlet.journal' AND ResourceCode.scope = 4 AND Resource_.resourceId = Permission_.resourceId AND Permission_.actionId = 'APPROVE_ARTICLE' AND Permission_.permissionId = Roles_Permissions.permissionId for me, it was roleId=10182, primKey=12810 then, execute this request (changing with proper values): DELETE FROM `Roles_Permissions` WHERE `roleId` = 10182 AND `permissionId` IN (SELECT permissionId FROM `Permission_` WHERE resourceId IN ( SELECT resourceId FROM `Resource_` WHERE `primKey` = '12810' ) AND actionId = 'APPROVE_ARTICLE' ); Of cours you have to do that, before starting your app server for the upgrade.
        Hide
        Trey Howard added a comment -

        I am getting this error on upgrade from 6.0.5 to 6.1.
        Environment: Win Server 2k3, MySQL 5.1.49-community
        I am unable to reproduce when upgrading from a clean 6.0.6 installation, but I am getting this for our real environment.
        See related discussion:
        http://www.liferay.com/community/forums/-/message_boards/message/12204339

        Show
        Trey Howard added a comment - I am getting this error on upgrade from 6.0.5 to 6.1. Environment: Win Server 2k3, MySQL 5.1.49-community I am unable to reproduce when upgrading from a clean 6.0.6 installation, but I am getting this for our real environment. See related discussion: http://www.liferay.com/community/forums/-/message_boards/message/12204339
        Hide
        Trey Howard added a comment -

        I am getting this on upgrade from 6.0.5 to 6.1 GA1.
        The stack trace is the same except that it cites a unique index rather than the primary key:
        MySQLIntegrityConstraintViolationException: Duplicate entry '10546-0-bengals' for key 'IX_ED5CA615'

        Show
        Trey Howard added a comment - I am getting this on upgrade from 6.0.5 to 6.1 GA1. The stack trace is the same except that it cites a unique index rather than the primary key: MySQLIntegrityConstraintViolationException: Duplicate entry '10546-0-bengals' for key 'IX_ED5CA615'

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 9 weeks, 6 days ago

              Development

                Structure Helper Panel