stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Isuru Perera <isu...@wso2.com>
Subject Re: Unique index or primary key violation When unsubscribing
Date Thu, 20 Feb 2014 09:32:38 GMT
I doubt whether this is due to H2 database.


On Thu, Feb 20, 2014 at 2:50 PM, Udara Liyanage <udara@wso2.com> wrote:

> Hi,
>
> I got the following error from DB when I unsubscribe. I encountered this
> very rarely.
>
> P1 [member] lb1658126935.lb.domain8f725476-8e9c-4d33-b92c-ce6d2e301db0
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher}
> TID: [0] [CC] [2014-02-20 09:15:41,713]  INFO
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} -
>  Publishing member terminated event: [service] fresh [cluster]
> fresh.fresh.domain [network-partition] ec2 [partition] P1 [member]
> fresh.fresh.domainaeb569fa-d70f-4966-a0e5-2c29ffc47382
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher}
> TID: [0] [CC] [2014-02-20 09:15:41,729]  INFO
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl} -
>  Unregistration of service cluster: fresh.fresh.domain
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl}
> TID: [0] [CC] [2014-02-20 09:15:41,750]  INFO
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} -
>  Publishing cluster removed event: [service] fresh [cluster]
> fresh.fresh.domain
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher}
> TID: [0] [CC] [2014-02-20 09:15:41,750]  INFO
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl} -
>  Unregistration of service cluster: lb1658126935.lb.domain
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl}
> TID: [0] [CC] [2014-02-20 09:15:41,820]  INFO
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} -
>  Publishing cluster removed event: [service] lb [cluster]
> lb1658126935.lb.domain
> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher}
> TID: [0] [CC] [2014-02-20 09:15:41,837] ERROR
> {org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO} -
>  Concurrent Modification: Failed to put the content into history with the
> content id 242. Unique index or primary key violation: "PRIMARY_KEY_7 ON
> PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID, REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
> {org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO}
> org.h2.jdbc.JdbcSQLException: Unique index or primary key violation:
> "PRIMARY_KEY_7 ON PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID,
> REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>  at org.h2.message.DbException.get(DbException.java:167)
> at org.h2.message.DbException.get(DbException.java:144)
>  at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157)
> at org.h2.index.PageBtree.find(PageBtree.java:121)
>  at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:138)
> at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:93)
>  at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:90)
> at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:81)
>  at org.h2.table.RegularTable.addRow(RegularTable.java:116)
> at org.h2.command.dml.Insert.insertRows(Insert.java:120)
>  at org.h2.command.dml.Insert.update(Insert.java:82)
> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>  at org.h2.command.Command.executeUpdate(Command.java:199)
> at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>  at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
> at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionContent(JDBCResourceVersionDAO.java:1235)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionResource(JDBCResourceVersionDAO.java:1134)
> at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createVersionForResource(VersionRepository.java:210)
>  at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createSnapshot(VersionRepository.java:87)
> at
> org.wso2.carbon.registry.core.jdbc.Repository.prepareUpdate(Repository.java:352)
>  at org.wso2.carbon.registry.core.jdbc.Repository.put(Repository.java:287)
> at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:709)
>  at
> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:465)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:657)
>  at
> org.apache.stratos.cloud.controller.registry.RegistryManager.persist(RegistryManager.java:94)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.persist(CloudControllerServiceImpl.java:424)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.logTermination(CloudControllerServiceImpl.java:893)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.access$300(CloudControllerServiceImpl.java:56)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl$InstanceTerminator.run(CloudControllerServiceImpl.java:512)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> at java.lang.Thread.run(Thread.java:662)
> TID: [0] [CC] [2014-02-20 09:15:41,840] ERROR
> {org.apache.stratos.cloud.controller.registry.RegistryManager} -  Failed to
> persist the cloud controller data in registry.
> {org.apache.stratos.cloud.controller.registry.RegistryManager}
> org.wso2.carbon.registry.core.exceptions.ConcurrentModificationException:
> Failed to put the content into history with the content id 242. Unique
> index or primary key violation: "PRIMARY_KEY_7 ON
> PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID, REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
> at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionContent(JDBCResourceVersionDAO.java:1242)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionResource(JDBCResourceVersionDAO.java:1134)
> at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createVersionForResource(VersionRepository.java:210)
>  at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createSnapshot(VersionRepository.java:87)
> at
> org.wso2.carbon.registry.core.jdbc.Repository.prepareUpdate(Repository.java:352)
>  at org.wso2.carbon.registry.core.jdbc.Repository.put(Repository.java:287)
> at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:709)
>  at
> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:465)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:657)
>  at
> org.apache.stratos.cloud.controller.registry.RegistryManager.persist(RegistryManager.java:94)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.persist(CloudControllerServiceImpl.java:424)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.logTermination(CloudControllerServiceImpl.java:893)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.access$300(CloudControllerServiceImpl.java:56)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl$InstanceTerminator.run(CloudControllerServiceImpl.java:512)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key
> violation: "PRIMARY_KEY_7 ON PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID,
> REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157)
>  at org.h2.index.PageBtree.find(PageBtree.java:121)
> at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:138)
>  at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:93)
> at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:90)
>  at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:81)
> at org.h2.table.RegularTable.addRow(RegularTable.java:116)
>  at org.h2.command.dml.Insert.insertRows(Insert.java:120)
> at org.h2.command.dml.Insert.update(Insert.java:82)
>  at org.h2.command.CommandContainer.update(CommandContainer.java:70)
> at org.h2.command.Command.executeUpdate(Command.java:199)
>  at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
> at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionContent(JDBCResourceVersionDAO.java:1235)
> ... 16 more
> TID: [0] [CC] [2014-02-20 09:15:41,860] ERROR
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl} -
>  Instance termination failed. MemberContext
> [memberId=fresh.fresh.domainaeb569fa-d70f-4966-a0e5-2c29ffc47382,
> nodeId=ap-southeast-1/i-b75e239f, clusterId=fresh.fresh.domain,
> cartridgeType=fresh, privateIpAddress=10.142.161.150,
> publicIpAddress=54.255.27.242, allocatedIpAddress=null,
> initTime=1392887630666, lbClusterId=lb1658126935.lb.domain,
> networkPartitionId=ec2]
> {org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl}
> org.apache.stratos.cloud.controller.exception.CloudControllerException:
> Failed to persist the cloud controller data in registry.
> at
> org.apache.stratos.cloud.controller.registry.RegistryManager.persist(RegistryManager.java:102)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.persist(CloudControllerServiceImpl.java:424)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.logTermination(CloudControllerServiceImpl.java:893)
>  at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.access$300(CloudControllerServiceImpl.java:56)
> at
> org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl$InstanceTerminator.run(CloudControllerServiceImpl.java:512)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>  at java.lang.Thread.run(Thread.java:662)
> Caused by:
> org.wso2.carbon.registry.core.exceptions.ConcurrentModificationException:
> Failed to put the content into history with the content id 242. Unique
> index or primary key violation: "PRIMARY_KEY_7 ON
> PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID, REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
> at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionContent(JDBCResourceVersionDAO.java:1242)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionResource(JDBCResourceVersionDAO.java:1134)
> at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createVersionForResource(VersionRepository.java:210)
>  at
> org.wso2.carbon.registry.core.jdbc.VersionRepository.createSnapshot(VersionRepository.java:87)
> at
> org.wso2.carbon.registry.core.jdbc.Repository.prepareUpdate(Repository.java:352)
>  at org.wso2.carbon.registry.core.jdbc.Repository.put(Repository.java:287)
> at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:709)
>  at
> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:465)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:657)
>  at
> org.apache.stratos.cloud.controller.registry.RegistryManager.persist(RegistryManager.java:94)
> ... 7 more
> Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key
> violation: "PRIMARY_KEY_7 ON PUBLIC.REG_CONTENT_HISTORY(REG_CONTENT_ID,
> REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_CONTENT_DATA,
> REG_TENANT_ID) VALUES (?, ?, ?) [23001-140]
>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157)
>  at org.h2.index.PageBtree.find(PageBtree.java:121)
> at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:138)
>  at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:93)
> at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:90)
>  at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:81)
> at org.h2.table.RegularTable.addRow(RegularTable.java:116)
>  at org.h2.command.dml.Insert.insertRows(Insert.java:120)
> at org.h2.command.dml.Insert.update(Insert.java:82)
>  at org.h2.command.CommandContainer.update(CommandContainer.java:70)
> at org.h2.command.Command.executeUpdate(Command.java:199)
>  at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
> at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceVersionDAO.versionContent(JDBCResourceVersionDAO.java:1235)
> ... 16 more
>
>
>
> --
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Mime
View raw message