Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-25968

v6_1_0.UpgradeAdminPortlets generates unique constraint violation

    Details

      Description

      Line 300 of com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets simply increments the main counter rather than the ResourcePermission counter. This results in a unique constraint error if the main counter value is smaller than the ResourcePermission count as the new value used may already exist in the ResourcePermissionId column.

      • Fix (works for me patch file will be attached):
      Index: portal-impl/src/com/liferay/portal/upgrade/v6_1_0/UpgradeAdminPortlets.java
      ===================================================================
      --- portal-impl/src/com/liferay/portal/upgrade/v6_1_0/UpgradeAdminPortlets.java	(revision 102319)
      +++ portal-impl/src/com/liferay/portal/upgrade/v6_1_0/UpgradeAdminPortlets.java	(working copy)
      @@ -297,7 +297,7 @@
       							actionIds + " where resourcePermissionId = " +
       								resourcePermissionId);
       
      -					resourcePermissionId = increment();
      +					resourcePermissionId = increment("com.liferay.portal.model.ResourcePermission");
       
       					long companyId = rs.getLong("companyId");
       					long scope = rs.getLong("scope");
      
      • Original Stack trace:
      2012-03-07 03:55:53,892 [INFO ] [pool-2-thread-1] com.liferay.portal.kernel.upgrade.UpgradeProcess:? - Upgrading com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets
      2012-03-07 03:58:16,435 [ERROR] [pool-2-thread-1] com.liferay.portal.servlet.MainServlet:? - com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALUAT.SYS_C00283755) violated
      
      com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALUAT.SYS_C00283755) violated
      
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:58)
      	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1284)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:198)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALUAT.SYS_C00283755) violated
      
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:213)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:103)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:56)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:36)
      	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:81)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:48)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:119)
      	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:144)
      	at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:52)
      	... 20 more
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALUAT.SYS_C00283755) violated
      
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:213)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:227)
      	at com.liferay.portal.upgrade.UpgradeProcess_6_0_12_to_6_1_0.doUpgrade(UpgradeProcess_6_0_12_to_6_1_0.java:51)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:210)
      	... 29 more
      Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALUAT.SYS_C00283755) violated
      
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3657)
      	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
      	at com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets.addResourcePermission(UpgradeAdminPortlets.java:128)
      	at com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets.updateAccessInControlPanelPermission_6(UpgradeAdminPortlets.java:311)
      	at com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets.doUpgrade(UpgradeAdminPortlets.java:145)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:210)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              g.steyn Graeme Steyn
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 18 weeks, 1 day ago

                  Packages

                  Version Package
                  6.1.10 EE GA1
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2