Combination View Flat View Tree View
Threads [ Previous | Next ]
Willem Vermeer
Migration to 6.1 fails while migrating resourcepermissions
April 13, 2012 1:54 AM
Answer

Willem Vermeer

Rank: Junior Member

Posts: 32

Join Date: March 30, 2012

Recent Posts

Hi,

We've been trying for a while now to upgrade a 6.0.5 CE liferay portal to 6.1. We used the official 6.1 CE GA release as well as the latest master from github, but keep running into data integrity problems.
Environment: ubuntu linux with MySQL 5.1.61-0ubuntu0.11.10.1-log (Ubuntu)

See below the stacktrace. When debugging I found that after invoking increment(ReourcePermission.class.getName()) on line 161 in UpgradeAdminPortlets the resourcePermissionId is incremented from 408 to 985801 and of course a record with primary key 985801 aready exists :-(

Record 408:
resourcePermissionId=408
companyId=10131
name=33
scope=4
primKey=10431_LAYOUT_33
roleid=10139
actionIds=13
ownerId=null

Record 985801:
companyId=10131
name=com.liferay.portlet.journal.model.JournalArticle
scope=4
primKey=2756163
roleId=10137
actionIds=3
ownerId=null

select max(resourcePermissoinId) from resourcepermission = 986354

We're using permissions.user.check.algorithm=6 and image.hook.impl=com.liferay.portal.image.FileSystemHook and the following database definitoin:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://192.168.1.9:3306/obscured?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

Any hints or suggestions are gladly appreciated.

upgrade stacktrace:

08:20:31,443 INFO [DialectDetector:80] Determine dialect for MySQL 5
08:20:31,491 INFO [DialectDetector:145] Found dialect org.hibernate.dialect.MySQLDialect
08:21:28,353 INFO [BaseDB:450] Database does not support case sensitive queries
08:21:28,605 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.UpgradeProcess_6_0_6
08:21:28,606 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.v6_0_6.UpgradeSchema
08:21:28,984 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.v6_0_6.UpgradeRSS
08:21:29,547 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.UpgradeProcess_6_1_0
08:21:29,549 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.v6_1_0.UpgradeSchema
08:23:31,977 WARN [BaseDB:423] Data truncation: Data too long for column 'description' at row 1: update BookmarksEntry set description = comments;

08:27:02,207 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.v6_1_0.UpgradeUserName
08:27:03,023 INFO [UpgradeProcess:207] Upgrading com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets
08:51:18,856 ERROR [MainServlet:198] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '985801' for key 'PRIMARY'
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '985801' for key 'PRIMARY'
at com.liferay.portal.events.StartupAction.run(StartupAction.java:58)
at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1219)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:195)
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: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '985801' for key 'PRIMARY'
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:131)
at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:48)
at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:128)
at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:144)
at com.liferay.portal.events.StartupAction.run(StartupAction.java:52)
... 20 more
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '985801' for key 'PRIMARY'
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_1_0.doUpgrade(UpgradeProcess_6_1_0.java:60)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:210)
... 28 more
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '985801' 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_1_0.UpgradeAdminPortlets.addResourcePermission(UpgradeAdminPortlets.java:57)
at com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets.updateAccessInControlPanelPermission(UpgradeAdminPortlets.java:173)
at com.liferay.portal.upgrade.v6_1_0.UpgradeAdminPortlets.doUpgrade(UpgradeAdminPortlets.java:66)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:210)
Willem Vermeer
RE: Migration to 6.1 fails while migrating resourcepermissions
April 13, 2012 5:28 AM
Answer

Willem Vermeer

Rank: Junior Member

Posts: 32

Join Date: March 30, 2012

Recent Posts

Never mind; it looks like a problem due to restarting an upgrade on a partially upgraded schema after a failed migration.