ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attila Magyar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-19984) ambari-server upgrade is not idempotent
Date Thu, 16 Feb 2017 10:31:41 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-19984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Attila Magyar updated AMBARI-19984:
-----------------------------------
    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

> ambari-server upgrade is not idempotent
> ---------------------------------------
>
>                 Key: AMBARI-19984
>                 URL: https://issues.apache.org/jira/browse/AMBARI-19984
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>            Reporter: Attila Magyar
>            Assignee: Attila Magyar
>         Attachments: AMBARI-19984_branch-2.5.patch, AMBARI-19984_trunk.patch
>
>
> # Upgraded Ambari from 2.4.0 to 2.5.0
> # Set the version in metainfo back to 2.4.0
> # update metainfo set metainfo_value = '2.4.0' where metainfo_key = 'version';
> # Executed ambari-server upgrade again.
> Result:
> {code}
> ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: Exception
[EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates
unique constraint "pk_permsn_roleauthorization"
> Error Code: 0
> Call: INSERT INTO permission_roleauthorization (authorization_id, permission_id) VALUES
(?, ?)
> 	bind => [2 parameters bound]
> 	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:240)
> 	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:430)
> Caused by: javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse
Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates
unique constraint "pk_permsn_roleauthorization"
> Error Code: 0
> Call: INSERT INTO permission_roleauthorization (authorization_id, permission_id) VALUES
(?, ?)
> 	bind => [2 parameters bound]
> 	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:159)
> 	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:153)
> 	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.addAuthorizationToRole(AbstractUpgradeCatalog.java:887)
> 	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.addRoleAuthorization(AbstractUpgradeCatalog.java:847)
> 	at org.apache.ambari.server.upgrade.UpgradeCatalog250.addManageServiceAutoStartPermissions(UpgradeCatalog250.java:907)
> 	at org.apache.ambari.server.upgrade.UpgradeCatalog250.executeDMLUpdates(UpgradeCatalog250.java:172)
> 	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:952)
> 	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:237)
> 	... 1 more
> Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696):
org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates
unique constraint "pk_permsn_roleauthorization"
> Error Code: 0
> Call: INSERT INTO permission_roleauthorization (authorization_id, permission_id) VALUES
(?, ?)
> 	bind => [2 parameters bound]
> 	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1620)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:964)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:633)
> 	at org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism.executeBatch(ParameterizedSQLBatchWritingMechanism.java:149)
> 	at org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism.executeBatchedStatements(ParameterizedSQLBatchWritingMechanism.java:134)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.writesCompleted(DatabaseAccessor.java:1845)
> 	at org.eclipse.persistence.internal.sessions.AbstractSession.writesCompleted(AbstractSession.java:4300)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.writesCompleted(UnitOfWorkImpl.java:5592)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1646)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1614)
> 	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:285)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169)
> 	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:134)
> 	... 8 more
> Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique
constraint "pk_permsn_roleauthorization"
> 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
> 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
> 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)
> 	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:892)
> 	... 20 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message