Description of problem: Group description which is longer then 100 characters results in a database exception: Message : Failed to create the resource group [All Platforms - Manual Group] : [1338334237397] 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.PersistenceException:org.hibernate.exception.DataException: Could not execute JDBC batch update -> org.hibernate.exception.DataException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_RESOURCE_GROUP (NAME, DESCRIPTION, CTIME, MTIME, MODIFIED_BY, GROUP_DEFINITION_ID, GROUP_BY, RECURSIVE, CATEGORY, RESOURCE_TYPE_ID, SUBJECT_ID, CLUSTER_KEY, CLUSTER_RESOURCE_GROUP_ID, AUTO_GROUP_PARENT_RESOURCE_ID, visible, ID) values ('All Platforms - Manual Group', 'A compatible group of platform resources which have been manually added to this group. In other words, this is not a DynaGroup.', '1338334237262', '1338334237262', 'rhqadmin', NULL, NULL, '0', 'MIXED', NULL, NULL, NULL, NULL, NULL, '1', '10051') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_RESOURCE_GROUP (NAME, DESCRIPTION, CTIME, MTIME, MODIFIED_BY, GROUP_DEFINITION_ID, GROUP_BY, RECURSIVE, CATEGORY, RESOURCE_TYPE_ID, SUBJECT_ID, CLUSTER_KEY, CLUSTER_RESOURCE_GROUP_ID, AUTO_GROUP_PARENT_RESOURCE_ID, visible, ID) values ('All Platforms - Manual Group', 'A compatible group of platform resources which have been manually added to this group. In other words, this is not a DynaGroup.', '1338334237262', '1338334237262', 'rhqadmin', NULL, NULL, '0', 'MIXED', NULL, NULL, NULL, NULL, NULL, '1', '10051') was aborted. Call getNextException to see the cause. -> ERROR: value too long for type character varying(100)(error-code=0,sql-state=22001)] Version-Release number of selected component (if applicable): JON 3.0.1 How reproducible: Always Steps to Reproduce: 1. Create a compatible group with a description that contains 101 characters or more: Desc: "A very long description with a total length of one-hundred one (101) chracters." Actual results: Group creation fails with the following stack trace: [1338334237397] 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.PersistenceException:org.hibernate.exception.DataException: Could not execute JDBC batch update -> org.hibernate.exception.DataException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 insert into RHQ_RESOURCE_GROUP (NAME, DESCRIPTION, CTIME, MTIME, MODIFIED_BY, GROUP_DEFINITION_ID, GROUP_BY, RECURSIVE, CATEGORY, RESOURCE_TYPE_ID, SUBJECT_ID, CLUSTER_KEY, CLUSTER_RESOURCE_GROUP_ID, AUTO_GROUP_PARENT_RESOURCE_ID, visible, ID) values ('All Platforms - Manual Group', 'A compatible group of platform resources which have been manually added to this group. In other words, this is not a DynaGroup.', '1338334237262', '1338334237262', 'rhqadmin', NULL, NULL, '0', 'MIXED', NULL, NULL, NULL, NULL, NULL, '1', '10051') was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 insert into RHQ_RESOURCE_GROUP (NAME, DESCRIPTION, CTIME, MTIME, MODIFIED_BY, GROUP_DEFINITION_ID, GROUP_BY, RECURSIVE, CATEGORY, RESOURCE_TYPE_ID, SUBJECT_ID, CLUSTER_KEY, CLUSTER_RESOURCE_GROUP_ID, AUTO_GROUP_PARENT_RESOURCE_ID, visible, ID) values ('All Platforms - Manual Group', 'A compatible group of platform resources which have been manually added to this group. In other words, this is not a DynaGroup.', '1338334237262', '1338334237262', 'rhqadmin', NULL, NULL, '0', 'MIXED', NULL, NULL, NULL, NULL, NULL, '1', '10051') was aborted. Call getNextException to see the cause. -> ERROR: value too long for type character varying(100)(error-code=0,sql-state=22001)] at Unknown.java_lang_RuntimeException_$RuntimeException__Ljava_lang_RuntimeException_2Ljava_lang_RuntimeException_2(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_core_java_lang_RuntimeException_1FieldSerializer_instantiate__Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_RuntimeException_2(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_$readObject__Lcom_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_2Ljava_lang_Object_2(Unknown source:0) at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0) at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0) at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown source:0) at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.anonymous(Unknown source:0) Expected results: Group creation should succeed Additional info: This issue appears to be the database schema limits the group name to 100 characters. For a description, this is VERY SHORT. One normally expects to a description to be 1024 bytes or larger. At bare minimum, if we are going to limit this to 100 characters then we should perform data validation on the input to ensure it meets the database requirement.
This issue occurs in JON 3.0, JON 3.0.1, and JON 3.1.0.Beta1. In JON 2.4.x the UI prevented the input of a group description that exceeded this limit.
As per 6/4/12 triage, target at jon311
Lets just add the limit back on this field This issues needs another BZ and fix for the master branch
This is checked into jon3.1.x as commit id: 8cae70b and in RHQ master as commit id: 0aeaf8e The UI now limits the group names to 100 chars just as the database constraints. The corresponding RHQ BZ is https://bugzilla.redhat.com/show_bug.cgi?id=845692
Correction to the above jon3.1.x commit id: 78e54b9
Moving to ON_QA since JON 3.1.1 ER2 build is availble - https://brewweb.devel.redhat.com/buildinfo?buildID=228250
Tested on JON 3.1.1 ER2, still the same behaviour.
Relevant commit is NOT in JON 3.1.1 ER2
Correct, relevant commit had not been pushed. I had committed this one to local jon3.1.x branch but didn't push it. Jon3.1.x Commit ID: ce91771
Moving to ON_QA. The JON 3.1.1 ER3 build is available at https://brewweb.devel.redhat.com/buildinfo?buildID=230321.
Tested on JON 3.1.1 ER3. Name field is OK, there is a 100 characters limit. But description field is still unlimited and group creation still throws the same exception
Please see https://bugzilla.redhat.com/show_bug.cgi?id=788997 as this fixed the description issue originally and then I fixed the name field so we are missing the previous commit: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=ead694e So we need to cherry-pick this over as well. This was also cherry-picked to release/jon3.1.x as commit id: 9fe84f4
The CR1 build is available at https://brewweb.devel.redhat.com/buildinfo?buildID=231258. Moving to ON_QA.
Verified on JON 3.1.1.CR1 build for name and description fields while creating groups. It limits to 100 characters.
*** Bug 788997 has been marked as a duplicate of this bug. ***