Red Hat Bugzilla – 893089 – [engine-backend] nested exception when trying to add host with name that already exists: ERROR: duplicate key value violates unique constraint "vds_s tatic_vds_name_unique"
[engine-backend] nested exception when trying to add host with name that already exists: ERROR: duplicate key value violates unique constraint "vds_s tatic_vds_name_unique"
Thx! Ok, that will catch most of the exceptions, parallel transactions can still cause the old exception. I assume that is good enough, since catching the data integrity exception would make the check in canDoAction redundant.
A very similar issue happens for the unique constraint on host_name (vds_static_host_name_unique) as well. Refer RHS-C Bug 896475. Should that also be fixed as part of this bug?
(In reply to comment #10)
> A very similar issue happens for the unique constraint on host_name
> (vds_static_host_name_unique) as well. Refer RHS-C Bug 896475. Should that
> also be fixed as part of this bug?
Thanks for pointing that out, let's solve that problem as well. Haim, is this ok for you too?
Description of problem: 1) add new host with name X 2) wait for host to be installed 3) add additional host with name X Error: Internal Error Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "vds_static_vds_name_unique" Where: SQL statement "INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, vds_group_id, vds_name, server_SSL_enabled, vds_type,vds_strength,pm_type,pm_user,pm_password,pm_port,pm_options,pm_enabled, pm_proxy_preferences, pm_secondary_ip, pm_secondary_type, pm_secondary_user, pm_secondary_password, pm_secondary_port, pm_secondary_options, pm_secondary_concurrent, vds_spm_priority, sshKeyFingerprint) VALUES( $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 )" PL/pgSQL function "insertvdsstatic" line 4 at SQL statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:360) at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404) at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1066) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1014) [spring-jdbc-3.1.1.RELEASE.jar:3.1.1.RELEASE] ... 93 more