We're updating the issue view to help you get more done. 

Copying rules with if-else fails with an error

Description

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 com.querydsl.core.QueryException: Caught PSQLException for insert into rule_config_component (rule_id, component, id, schema_version, type, value, sequence, condition_parent_id) values (?, ?, ?, ?, ?, ?, ?, ?) at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50) at com.querydsl.sql.Configuration.translate(Configuration.java:459) at com.querydsl.sql.dml.SQLInsertClause.executeWithKeys(SQLInsertClause.java:408) at com.querydsl.sql.dml.SQLInsertClause.executeWithKey(SQLInsertClause.java:201) at com.querydsl.sql.dml.SQLInsertClause.executeWithKey(SQLInsertClause.java:182) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertComponents(RdsAutomationConfigStore.java:296) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertConditionComponents(RdsAutomationConfigStore.java:278) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertComponents(RdsAutomationConfigStore.java:299) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertChildrenComponents(RdsAutomationConfigStore.java:274) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertComponents(RdsAutomationConfigStore.java:302) at com.codebarrel.automation.store.RdsAutomationConfigStore.insertTopLevelComponents(RdsAutomationConfigStore.java:270) at com.codebarrel.automation.store.RdsAutomationConfigStore.lambda$createRule$6(RdsAutomationConfigStore.java:153) at com.codebarrel.lambda.rds.DbConnectionManagerImpl.execute(DbConnectionManagerImpl.java:48) at com.codebarrel.automation.store.RdsAutomationConfigStore.createRule(RdsAutomationConfigStore.java:146) at com.codebarrel.automation.store.ECAutomationConfigStore.createRule(ECAutomationConfigStore.java:91) at com.codebarrel.automation.api.service.AutomationConfigServiceImpl.validateAndStore(AutomationConfigServiceImpl.java:370) at com.codebarrel.automation.api.service.AutomationConfigServiceImpl.createRule(AutomationConfigServiceImpl.java:183) at com.codebarrel.aws.lambda.automation.config.AutomationConfig.createRule(AutomationConfig.java:425) at com.codebarrel.aws.lambda.automation.Router.lambda$normalRouter$10(Router.java:98) at com.codebarrel.lambda.handler.LambdaRouter.route(LambdaRouter.java:72) at com.codebarrel.automation.handler.AbstractAutomationHandler.handleRequest(AbstractAutomationHandler.java:55) at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888) at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283) at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94) Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "rule_config_component_pkey" Detail: Key (id)=(238743) already exists. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) at com.querydsl.sql.dml.SQLInsertClause.executeWithKeys(SQLInsertClause.java:368) ... 24 more

Environment

None

Status

Assignee

Mark Chaimungkalanont

Reporter

Mark Chaimungkalanont

Links

0

Fix versions

Priority