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
Creation of Compatible Group fails with "value too long for type character" w...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: UI, Usability (Show other bugs)
JON 3.1.0
All All
unspecified Severity high
: CR01
: JON 3.1.1
Assigned To: Mike Thompson
Mike Foley
:
: 788997 (view as bug list)
Depends On:
Blocks: 845692
  Show dependency treegraph
 
Reported: 2012-05-29 15:51 EDT by Larry O'Leary
Modified: 2013-09-11 07:00 EDT (History)
4 users (show)

See Also:
Fixed In Version: jon3.1.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 845692 (view as bug list)
Environment:
Last Closed: 2013-09-11 07:00:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Larry O'Leary 2012-05-29 15:51:59 EDT
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 16:01:18 EDT
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 10:51:55 EDT
As per 6/4/12 triage, target at jon311
Comment 3 Charles Crouch 2012-08-02 18:27:39 EDT
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 18:29:58 EDT
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 11:13:24 EDT
Correction to the above jon3.1.x commit id: 78e54b9
Comment 6 John Sanda 2012-08-13 22:16:52 EDT
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 09:52:57 EDT
Tested on JON 3.1.1 ER2, still the same behaviour.
Comment 8 Filip Brychta 2012-08-20 12:18:02 EDT
Relevant commit is NOT in JON 3.1.1 ER2
Comment 9 Mike Thompson 2012-08-20 17:32:59 EDT
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 01:43:31 EDT
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 07:03:48 EDT
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 13:20:26 EDT
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-29 21:50:43 EDT
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 04:51:08 EDT
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 09:02:44 EDT
*** 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.