Dmytro Grinenko created AMBARI-22690:
----------------------------------------

             Summary: Registering existing hdp version failed with sql exception
                 Key: AMBARI-22690
                 URL: https://issues.apache.org/jira/browse/AMBARI-22690
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.6.2
            Reporter: Dmytro Grinenko
            Assignee: Dmytro Grinenko
             Fix For: 2.6.2


While trying to register existing HDP version below sql exception were noticed. 
Attached is the complete ambari logs.

Register HDP version 2.6.4 via manage versions screen of Ambari.
Try re-registering the same version again. Below exception is thrown.
Looks like the issue is not reproducible everytime and intermittent.
{code}
ERROR [ambari-client-thread-3696] AmbariJpaLocalTxnInterceptor:180 - [DETAILED 
ERROR] Rollback reason:
Local Exception Stack:
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 "uq_repo_version_stack_id"
Error Code: 0
Call: INSERT INTO repo_version (repo_version_id, display_name, hidden, legacy, 
repositories, resolved, repo_type, version, version_url, version_xml, 
version_xsd, parent_id, stack_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [13 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)
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to