Bug 826224 - Creation of Compatible Group fails with "value too long for type character" when a description is entered which is longer then 100 characters
Summary: Creation of Compatible Group fails with "value too long for type character" w...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: UI, Usability
Version: JON 3.1.0
Hardware: All
OS: All
unspecified
high
Target Milestone: CR01
: JON 3.1.1
Assignee: Mike Thompson
QA Contact: Mike Foley
URL:
Whiteboard:
: 788997 (view as bug list)
Depends On:
Blocks: 845692
TreeView+ depends on / blocked
 
Reported: 2012-05-29 19:51 UTC by Larry O'Leary
Modified: 2013-09-11 11:00 UTC (History)
4 users (show)

Fixed In Version: jon3.1.1
Clone Of:
: 845692 (view as bug list)
Environment:
Last Closed: 2013-09-11 11:00:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Larry O'Leary 2012-05-29 19:51:59 UTC
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.

Comment 1 Larry O'Leary 2012-05-29 20:01:18 UTC
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.

Comment 2 Charles Crouch 2012-06-11 14:51:55 UTC
As per 6/4/12 triage, target at jon311

Comment 3 Charles Crouch 2012-08-02 22:27:39 UTC
Lets just add the limit back on this field

This issues needs another BZ and fix for the master branch

Comment 4 Mike Thompson 2012-08-03 22:29:58 UTC
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

Comment 5 Mike Thompson 2012-08-06 15:13:24 UTC
Correction to the above jon3.1.x commit id: 78e54b9

Comment 6 John Sanda 2012-08-14 02:16:52 UTC
Moving to ON_QA since JON 3.1.1 ER2 build is availble - https://brewweb.devel.redhat.com/buildinfo?buildID=228250

Comment 7 Filip Brychta 2012-08-20 13:52:57 UTC
Tested on JON 3.1.1 ER2, still the same behaviour.

Comment 8 Filip Brychta 2012-08-20 16:18:02 UTC
Relevant commit is NOT in JON 3.1.1 ER2

Comment 9 Mike Thompson 2012-08-20 21:32:59 UTC
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

Comment 10 John Sanda 2012-08-22 05:43:31 UTC
Moving to ON_QA. The JON 3.1.1 ER3 build is available at https://brewweb.devel.redhat.com/buildinfo?buildID=230321.

Comment 11 Filip Brychta 2012-08-22 11:03:48 UTC
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

Comment 12 Mike Thompson 2012-08-22 17:20:26 UTC
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

Comment 13 John Sanda 2012-08-30 01:50:43 UTC
The CR1 build is available at
https://brewweb.devel.redhat.com/buildinfo?buildID=231258. Moving to ON_QA.

Comment 14 Sunil Kondkar 2012-08-30 08:51:08 UTC
Verified on JON 3.1.1.CR1 build for name and description fields while creating groups. It limits to 100 characters.

Comment 15 Jirka Kremser 2012-11-02 13:02:44 UTC
*** Bug 788997 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.