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

Attila Magyar updated AMBARI-25084:
-----------------------------------
    Affects Version/s: 2.7.0

> Delete identities fails when removing service in reverse order
> --------------------------------------------------------------
>
>                 Key: AMBARI-25084
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25084
>             Project: Ambari
>          Issue Type: Task
>          Components: ambari-server
>    Affects Versions: 2.7.0
>            Reporter: Attila Magyar
>            Assignee: Attila Magyar
>            Priority: Major
>
> (reverse order = host components first, then components, then service)
> STR:
> Install ZooKeeper + Kafka + Kerberos
> Stop Kafka
> curl -X DELETE 
> http://c7401.ambari.apache.org:8080/api/v1/clusters/TEST/hosts/c7401.ambari.apache.org/host_components/KAFKA_BROKER
> curl -X DELETE 
> http://c7401.ambari.apache.org:8080/api/v1/clusters/TEST/services/KAFKA/components/KAFKA_BROKER
> => identities are removed
> curl -X DELETE 
> http://c7401.ambari.apache.org:8080/api/v1/clusters/TEST/services/KAFKA
> => identity removal fails with PersistenceException
> {code}
> Internal Exception: org.postgresql.util.PSQLException: ERROR: syntax error at 
> or near ")"
>   Position: 210
> Error Code: 0
> Call: SELECT t0.config_id, t0.cluster_id, t0.selected, t0.selected_timestamp, 
> t0.version_tag, t0.create_timestamp, t0.type_name, t0.unmapped, t0.version, 
> t0.stack_id FROM clusterconfig t0 WHERE ((((t0.type_name IN ()) AND 
> (t0.cluster_id = ?)) AND (t0.stack_id = ?)) AND (t0.selected_timestamp = 
> (SELECT MAX(t1.selected_timestamp) FROM clusterconfig t1 WHERE 
> (((t1.cluster_id = ?) AND (t1.stack_id = ?)) AND (t1.type_name = 
> t0.type_name)))))
>         bind => [4 parameters bound]
> Query: 
> ReadAllQuery(name="ClusterConfigEntity.findLatestConfigsByStackWithTypes" 
> referenceClass=ClusterConfigEntity sql="SELECT t0.config_id, t0.cluster_id, 
> t0.selected, t0.selected_timestamp, t0.version_tag, t0.create_timestamp, 
> t0.type_name, t0.unmapped, t0.version, t0.stack_id FROM clusterconfig t0 
> WHERE ((((t0.type_name IN ?) AND (t0.cluster_id = ?)) AND (t0.stack_id = ?)) 
> AND (t0.selected_timestamp = (SELECT MAX(t1.selected_timestamp) FROM 
> clusterconfig t1 WHERE (((t1.cluster_id = ?) AND (t1.stack_id = ?)) AND 
> (t1.type_name = t0.type_name)))))")
> FetchGroup(){serviceConfigEntities, stack, selectedTimestamp, clusterId, 
> type, version, unmapped, configId, configGroupConfigMappingEntities, tag, 
> selected, timestamp, clusterEntity}
> javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse 
> Persistence Services - 2.6.2.v20151217-774c696): 
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: syntax error at 
> or near ")"
>   Position: 210
> Error Code: 0
> Call: SELECT t0.config_id, t0.cluster_id, t0.selected, t0.selected_timestamp, 
> t0.version_tag, t0.create_timestamp, t0.type_name, t0.unmapped, t0.version, 
> t0.stack_id FROM clusterconfig t0 WHERE ((((t0.type_name IN ()) AND 
> (t0.cluster_id = ?)) AND (t0.stack_id = ?)) AND (t0.selected_timestamp = 
> (SELECT MAX(t1.selected_timestamp) FROM clusterconfig t1 WHERE 
> (((t1.cluster_id = ?) AND (t1.stack_id = ?)) AND (t1.type_name = 
> t0.type_name)))))
>         bind => [4 parameters bound]
> Query: 
> ReadAllQuery(name="ClusterConfigEntity.findLatestConfigsByStackWithTypes" 
> referenceClass=ClusterConfigEntity sql="SELECT t0.config_id, t0.cluster_id, 
> t0.selected, t0.selected_timestamp, t0.version_tag, t0.create_timestamp, 
> t0.type_name, t0.unmapped, t0.version, t0.stack_id FROM clusterconfig t0 
> WHERE ((((t0.type_name IN ?) AND (t0.cluster_id = ?)) AND (t0.stack_id = ?)) 
> AND (t0.selected_timestamp = (SELECT MAX(t1.selected_timestamp) FROM 
> clusterconfig t1 WHERE (((t1.cluster_id = ?) AND (t1.stack_id = ?)) AND 
> (t1.type_name = t0.type_name)))))")
> FetchGroup(){serviceConfigEntities, stack, selectedTimestamp, clusterId, 
> type, version, unmapped, configId, configGroupConfigMappingEntities, tag, 
> selected, timestamp, clusterEntity}
>         at 
> org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:382)
>         at 
> org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:260)
>         at 
> org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:473)
>         at 
> org.apache.ambari.server.orm.dao.DaoUtils.selectList(DaoUtils.java:53)
>         at 
> org.apache.ambari.server.orm.dao.ClusterDAO.getLatestConfigurationsWithTypes(ClusterDAO.java:226)
>         at 
> org.apache.ambari.server.orm.AmbariLocalSessionInterceptor.invoke(AmbariLocalSessionInterceptor.java:44)
>         at 
> org.apache.ambari.server.state.cluster.ClusterImpl.getLatestConfigsWithTypes(ClusterImpl.java:1185)
>         at 
> org.apache.ambari.server.controller.DeleteIdentityHandler$PrepareDeleteIdentityServerAction.extendWithDeletedConfigOfService(DeleteIdentityHandler.java:304)
>         at 
> org.apache.ambari.server.controller.DeleteIdentityHandler$PrepareDeleteIdentityServerAction.calculateConfig(DeleteIdentityHandler.java:296)
>         at 
> org.apache.ambari.server.controller.DeleteIdentityHandler$PrepareDeleteIdentityServerAction.execute(DeleteIdentityHandler.java:273)
>         at 
> org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.execute(ServerActionExecutor.java:550)
>         at 
> org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.run(ServerActionExecutor.java:466)
>         at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to