Description of problem: $Summary Version-Release number of selected component (if applicable): Version: 4.5.0-SNAPSHOT Build Number: 6c45114 How reproducible: Always Steps to Reproduce: 1. create some new role (Administration->Roles->new) 2. create the same role again Actual results: Globally uncaught exception: ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)] Detail : java.lang.RuntimeException:java.lang.RuntimeException: [1347978546494] java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)] java.lang.RuntimeException:[1347978546494] java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)] --- STACK TRACE FOLLOWS --- java.lang.RuntimeException: [1347978546494] java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)] at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) Caused by: java.lang.RuntimeException: [1347978546494] java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_ROLE (NAME, DESCRIPTION, FSYSTEM, ID) values ('newRole', NULL, '0', '10052') was aborted. Call getNextException to see the cause. -> ERROR: duplicate key value violates unique constraint "rhq_role_name_key" Detail: Key (name)=(newRole) already exists.(error-code=0,sql-state=23505)] at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) Expected results: Some more user friendly notification
The same applies to the creating duplicate user.
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=dad120d fixed in master time: Thu Sep 27 14:06:14 2012 +0200 commit: dad120db6d26c739b47b841cc0b43028a255073c author: Jirka Kremser - jkremser message: [BZ 858282 - Globally uncaught exception when creating duplicate role] If rhq_role_name_key db constraint is violated, more informative message is returned to the client. Instead of "Globally uncaught exception..." with db implementation details. The same thing for user creation.
verified in rhq master (4.6) Globally uncaught exception is removed and replaced with correct exception text, and the exception is shown in server log.
Still not working on Version: 4.6.0-SNAPSHOT Build Number: a74896a Globally uncaught exception is still there. Adding CLI script which does the repro steps. Please check the exception thrown by CLI client as well. There is no explaining message at all.
Created attachment 691573 [details] CLI script with reproduction steps
fixed in master http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=af0936f97 time: Fri Feb 1 14:02:40 2013 +0100 commit: af0936f97b11698157731942134e181db6e11af6 author: Jirka Kremser - jkremser message: [BZ 858282 - Globally uncaught exception when creating duplicate role] RoleManager now explicitly checks whether the role with the same name already exists (without trying to create the role first and then catching the exception like it was done before). As a consequence of this commit, the CLI now prints nicely the real cause of the problem as well.
Verified on Version: 4.6.0-SNAPSHOT Build Number: 73a33d5 Verified for both GUI and CLI
Bulk close of old bugs in VERIFIED state.