Bug 697589

Summary: editing a group config fails with "One or more null or empty member Resource configuration was returned by the Server." if one or more of the member configs have not first been viewed individually
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: Core UIAssignee: Ian Springer <ian.springer>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: high    
Version: 4.0.0CC: ccrouch, hrupp, sdharane
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
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:    
Bug Blocks: 585306, 703268, 705059, 715334    
Attachments:
Description Flags
server log showing error during verification process none

Description Ian Springer 2011-04-18 17:06:13 UTC
I'm guessing the SLSB method that loads a group config is not smart enough to fetch live configs for member Resources; it probably just tries to load persisted configs and if none are found, returns empty configs (when I attached to coregui w/ JPDA, I saw that the member configs were empty, not null).

Comment 3 Ian Springer 2011-05-18 14:15:55 UTC
To load group member configs, call configurationManager.getResourceConfigurationsForCompatibleGroup(), rather than configurationManager.getResourceConfigurationMapForCompatibleGroup(), to ensure we get the latest/live configs for each of the group members - [master ed17448].

Comment 4 Ian Springer 2011-05-18 15:12:08 UTC
[master eac0b5c] removes getResourceConfigurationMapForCompatibleGroup() from ConfigurationManagerLocal and ConfigurationManagerBean, since it is not a method anyone should ever call (getResourceConfigurationsForCompatibleGroup() should always be used instead).

Comment 5 Ian Springer 2011-05-18 16:46:56 UTC
To verify this fix:

1) create a compatible group of some type of Resource that support configuration (e.g. RHQ Agent, Datasource, Topic, Queue, etc.). make sure that you have not gone to the Configuration>Current subtab for any of the members of the group.
2) go the group's Configuration>Current subtab, and make sure the group's config is displayed. change the values of a couple properties, then save the group config. verify that succeeds.
3) make some changes to one of the group members configs *outside of the RHQ GUI or CLI*. for example, if it's a group of RHQ Agent Resources, change some Agent config props from the Agent command prompt.
4) go back to the group's Configuration>Current subtab, and make sure the group's config is displayed and the updates you made in step 3) are evident. this verifies that the group config always represents the "live" configs of each of the group's members, and not just the latest member configs from the DB.

Comment 6 Mike Foley 2011-05-19 15:19:06 UTC
Created attachment 499871 [details]
server log showing error during verification process

Comment 7 Sudhir D 2011-05-20 11:51:11 UTC
Verified on rhq-server-4.0.1-SNAPSHOT Build# a104cdf

My setup was on postgres. I do not see the error message that Michael saw in comment# 6. 

The UI change reflected correctly,
2011-05-20 17:13:58,450 INFO  [org.rhq.enterprise.server.configuration.ConfigurationManagerBean] Group Resource configuration update [10001] for ResourceGroup[id=10031, name=compact group, category=COMPATIBLE, type=RHQ Agent, isDynaGroup=false, isClusterGroup=false] has completed with status [Success].

The Agent command prompt change also reflected correctly on the UI,
> setconfig rhq.agent.wait-for-server-at-startup-msecs=50000
Set preference: rhq.agent.wait-for-server-at-startup-msecs=50000

I'm marking this bug as verified. Will double check with Michael separately.

Comment 8 Corey Welton 2011-05-24 01:15:39 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 9 Corey Welton 2011-05-24 01:15:39 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 10 Corey Welton 2011-05-24 01:15:39 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 11 Corey Welton 2011-05-24 01:15:44 UTC
Bookkeeping - closing bug - fixed in recent release.