Bug 1186300

Summary: java.lang.IllegalArgumentException:Invalid column widths (more widths than columns) [58%, *] error thrown in JBoss ON UI
Product: [JBoss] JBoss Operations Network Reporter: bkramer <bkramer>
Component: Core ServerAssignee: Josejulio Martínez <jmartine>
Status: CLOSED ERRATA QA Contact: Hayk Hovsepyan <hhovsepy>
Severity: medium Docs Contact:
Priority: medium    
Version: JON 3.3.0CC: fbrychta, hhovsepy, jmartine, loleary, renaud.houssin.prestataire, spinder
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 15:29:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1186306    
Bug Blocks:    

Description bkramer 2015-01-27 11:33:59 UTC
Description of problem:
Dashboard is not displayed and Globally Uncaught Exception is thrown in JBoss ON UI:
***************************************
java.lang.IllegalArgumentException:Invalid column widths (more widths than columns) [58%, *]
--- STACK TRACE FOLLOWS ---
Invalid column widths (more widths than columns) [58%, *]
   at Unknown.Throwable_1(Unknown Source)
   at Unknown.Exception_1(Unknown Source)
   at Unknown.RuntimeException_1(Unknown Source)
   at Unknown.IllegalArgumentException_1(Unknown Source)
   at Unknown.PortalLayout_0(Unknown Source)
   at Unknown.$buildPortlets(Unknown Source)
   at Unknown.onInit_39(Unknown Source)
   at Unknown.doInit(Unknown Source)
   at Unknown.create_13(Unknown Source)
   at Unknown.$getOrCreateJsObj_0(Unknown Source)

***************************************

Version-Release number of selected component (if applicable):
3.3.0

How reproducible:
Sometimes 

Steps to Reproduce:
I didn't manage to reproduce the error. But, our user created a new dashboard and dragged the internal dashboard window (portlet) when this error happened.

Actual results:
Globally Uncaught Exception is thrown and Dashboard page is not displayed at all (not even Default Dashboard).


Expected results:

No error is thrown and dashboard is properly displayed.


Additional info:

This was reported for "rhqadmin" user (it's ID in rhq_principal is 2). So, the following SQL has been executed:

SELECT dash.id as DASH_ID, dash.name, prop.id as PROP_ID, prop.name, prop.string_value, port.id as PORT_ID, port.name, port.portlet_key, port.col, port.col_index FROM rhq_dashboard dash
LEFT JOIN rhq_config_property prop ON prop.configuration_id = dash.configuration_id
LEFT JOIN rhq_dashboard_portlet port ON port.dashboard_id = dash.id
WHERE dash.subject_id = 2 AND dash.resource_id IS NULL AND (prop.name = 'widths' OR prop.name = 'columns');

and this resulted in:

*********************
DASH_ID  NAME        PROP_ID  NAME    STRING_VALUE    PORT_ID  NAME    PORTLET_KEY COL COL_INDEX
10001       Default        24151   widths  31%,*   10001   Recent Operations   Operations  1   2
10001       Default       24144   widths  31%,*   10001   Recent Operations   Operations  1   2
10001       Default       13408   columns 2   10001   Recent Operations   Operations  1   2
10001       Default       24151   widths  31%,*   10002   Alerted or Unavailable Resources    ProblemResources    1   1
10001       Default       24144   widths  31%,*   10002   Alerted or Unavailable Resources    ProblemResources    1   1
10001       Default       13408   columns 2   10002   Alerted or Unavailable Resources    ProblemResources    1   1
10001       Default       24151   widths  31%,*   10003   Recent Alerts   RecentAlerts    1   0
10001       Default       24144   widths  31%,*   10003   Recent Alerts   RecentAlerts    1   0
10001       Default       13408   columns 2   10003   Recent Alerts   RecentAlerts    1   0
10001       Default       24151   widths  31%,*   10004   Mashup  Mashup  0   1
10001       Default       24144   widths  31%,*   10004   Mashup  Mashup  0   1
10001       Default       13408   columns 2   10004   Mashup  Mashup  0   1
10001       Default      24151   widths  31%,*   10005   Inventory Summary   InventorySummary    0   0
10001       Default      24144   widths  31%,*   10005   Inventory Summary   InventorySummary    0   0
10001       Default      13408   columns 2   10005   Inventory Summary   InventorySummary    0   0
10004      EAP-Web  3710054 widths  58%,*   10021   Alerted or Unavailable Resources    ProblemResources    0   0
10004      EAP-Web  3816432 widths  *   10021   Alerted or Unavailable Resources    ProblemResources    0   0
10004      EAP-Web  3816431 columns 1   10021   Alerted or Unavailable Resources    ProblemResources    0   0
10004      EAP-Web  3710054 widths  58%,*   10022   Recent Alerts   RecentAlerts    0   1
10004      EAP-Web  3816432 widths  *   10022   Recent Alerts   RecentAlerts    0   1
10004      EAP-Web  3816431 columns 1   10022   Recent Alerts   RecentAlerts    0   1
10004      EAP-Web  3710054 widths  58%,*   10023   Timeline    ResourceTimeline    0   2
10004      EAP-Web  3816432 widths  *   10023   Timeline    ResourceTimeline    0   2
10004      EAP-Web  3816431 columns 1   10023   Timeline    ResourceTimeline    0   2
*********************

So, from above result, you can see that somehow we added two "widths" rows for each portlet (both EAP-Web and Default) and the one added for EAP-Web has incorrect width string_value.

Comment 1 Renaud HOUSSIN 2015-04-16 13:16:25 UTC
We have got the same problem. After create a Dashboard then a Machine Group we loaded a portlet on the Dashboard then impossible to go back to the Dashboard...

Comment 2 Larry O'Leary 2015-04-16 15:55:36 UTC
@Renaud do you have more specifics on how you get into the situation? I am assuming you create a new blank dashboard and then create a resource group. What is in the resource group? Platform resources only? Are they recursive? Is this a compatible group?

Then, you go to your newly created and blank dashboard and add a portlet? What portlet? Are you setting any configuration on the portlet? Anything else? 

Can you reproduce this consistently?

Comment 3 Renaud HOUSSIN 2015-04-17 09:24:36 UTC
@Larry,

Hi,

thank's for you quickly answer.

first time, i want to prevent that we are newbie on JBoss ON and we are just testing the functionnalities of the application.

 - What is in the resource group? Platform resources only? Are they recursive? Is this a compatible group?

In our infrastructure we want to manage some JVM JBoss Servers. We've got One Domain Controller who manage 2 JBoss Hosts Controller that contain 2 JVM per Host.

The Group i created was a JVM Group and more specifically the memory ressources on the differents JVM. They not recursive and i guess this is a compatible group.

 - Then, you go to your newly created and blank dashboard and add a portlet? What portlet? Are you setting any configuration on the portlet? Anything
else? 

We created a Dashboard to manage everything on a JVM. after created the Memory group i went in the Inventory Tab > All Groups > The Memory group. 

In the memory group i went into the monitoring tab. Then, i used "Add to Dashboard" from the Metric tab to add the Heap Used Graph on the Dashboard

Since this action the Dashboard Tab isn't available and display the Exception.

Can you reproduce this consistently?

Actually, we don't know how to display back our Dashboards...

Thanks for your help

Comment 4 Larry O'Leary 2015-04-17 14:03:44 UTC
@Renaud, in that case see the knowledge solution which provides a workaround for the issue: https://access.redhat.com/solutions/708833

Comment 5 Renaud HOUSSIN 2015-04-17 14:09:52 UTC
Thanks a lot we solved the problem.

Comment 9 Josejulio Martínez 2016-06-06 22:05:03 UTC
commit 1d73d1e8a7bbc5ec3c99893f39bcb965e5371e17
Merge: 4d67d2e 517c86c
Author: Michael Burman <yak>
Date:   Mon Jun 6 23:27:54 2016 +0300

    Merge pull request #259 from josejulio/bugs/1186300
    
    Bug 1186300 - java.lang.IllegalArgumentException:Invalid column width…


commit 517c86ca9aa7217b2756d550e22823e90df7682d
Author: Josejulio Martínez <jmartine>
Date:   Thu May 26 11:44:07 2016 -0500

    Bug 1186300 - java.lang.IllegalArgumentException:Invalid column widths (more widths than columns) [58%, *] error thrown in JBoss ON UI
    
     Property 'width' was duplicated for configuration's dashboards. These duplicated values may
     yield the error when the incorrect 'width' is selected (I guess that the lower id is selected).
     I couldn't reproduce this bug on any way and couldn't find any way for it to happen on the code.
     I propose a "fix when it happens".
    
     When detecting more widths than columns, trim the additional widths and attach fresh Configuration
     with the same Properties as the current Property (this deletes duplicates in case they exist).
     On server-side, old configuration is deleted.

Comment 11 Simeon Pinder 2016-07-07 08:22:53 UTC
Moving to ON_QA as available to test with the following build:
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=502442

Note: 	jon-server-patch-3.3.0.GA.zip maps to JON 3.3.6(jon-server-3.3.0.GA-update-06.zip)

Comment 12 Hayk Hovsepyan 2016-07-13 14:28:21 UTC
Verified on revision jon-server-3.3.0.GA-update-06.

Was able to reproduce the error only by hacking the database (i.e. have the set ow rows described in bz), and saw the error in dashboard page.
On fixed version the dashboard is shown correctly and it is possible to add new graphs there.
Actually issue was not connected to "Compatible Groups", it was dashboard problem and was happening to all dashboards.

Comment 14 errata-xmlrpc 2016-07-27 15:29:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-1519.html