Bug 844673
Summary: | JON CP test connection not working with valid credentials | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Simeon Pinder <spinder> | ||||||
Component: | Content | Assignee: | Simeon Pinder <spinder> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | urgent | ||||||||
Version: | unspecified | CC: | hrupp, jsanda, myarboro, skondkar | ||||||
Target Milestone: | CR02 | ||||||||
Target Release: | JON 3.1.1 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | 840512 | Environment: | |||||||
Last Closed: | 2013-09-03 15:01:42 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: | 840512 | ||||||||
Bug Blocks: | 846021 | ||||||||
Attachments: |
|
Description
Simeon Pinder
2012-07-31 11:13:49 UTC
See original comment(https://bugzilla.redhat.com/show_bug.cgi?id=840512#c12) for original test description: QE We need to test the CSP content source we ship with works in all fresh installs and upgrades: e.g. -fresh install of jon311: setup works ok -content source not setup in jon310, upgraded to jon311: setup works ok -content source setup and working in jon310, upgraded to jon311: continues to work -content source setup and working in jon301, upgraded to jon311: continues to work This has been applied to 3.1.1 branch with commit: ebdb6f0e7f9d Moving this to MODIFIED for testing with next JON binary. Moving to ON_QA since JON 3.1.1 ER2 build is availble - https://brewweb.devel.redhat.com/buildinfo?buildID=228250 Tested on ON 3.1.1.ER3 build. I tried below steps on fresh install of JON 3.1.1.ER3 build and getting an error in server log. 1. Fresh Install jon311 ( JON 3.1.1.ER3 build ) 2. Navigate to Administration->Content-> Content Sources 3. Click on the link 'JBoss CP Patch Feed' 4. Click on button 'Edit'. 5. Lazy Load : True 6. Download Mode : database 7. Default Feed URL: https://access.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=2.0 8. Enter CSP username and password 9. Active : Yes 10. Click on button 'Save' 11. Observe the server log. - Attaching the error I got in server log. - Environment Details: OS: Fedora release 13 (Goddard) Build: Version: 3.1.1.ER3 Build Number: 37108ca:67c6de8 Database: PostgreSQL 8.4.2 Browser: Firefox 10.0.2 Java Version: jre1.7.0_05 - Clicking on 'Test Connection' button displays below in UI: Test failed - failed to connect to the remote repository for [JBoss CP Patch Feed] - check the configuration and make sure the remote repository is up and reachable. Details: java.lang.reflect.InvocationTargetException:null -> org.rhq.enterprise.server.plugin.pc.content.SyncException:Invalid login credentials specified for user [skondkar1]. Make sure this user has an active account at the CSP and that the password is correct. - Tried testing by changing the Feed URL as below and observed the same error in server log. https://access.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=3.1 - I tried to test whether my credentials are working. I entered below URL in browser and entered the credentials, observed that it works in browser. Also tested on Oracle 11g and observed the same behaviour. Created attachment 607896 [details]
Server_log
Worked with simeon on this. Below are some observations: The table 'rhq_config_property' has 'dtype' values - 'obfuscated' for names 'Password' and 'proxypassword'. The string_value is: 26e461e889bd1b1d207a6df87216de44 Deleted the content source 'JBoss CP Patch Feed' and then created a new one with the same name using 'JBoss Patch Content Source' type. After clicking 'Save', the server log displayed stack trace. Attaching the stack trace. After that I clicked 'TEST CONNECTION' button displayed 'Test passed - the remote repository for [JBoss CP Patch Feed] is available.' in UI. Created attachment 607917 [details]
Stack_trace
After quite a bit of investigation, this most recent failure to authenticate is caused by an odd path to the construction of the ObfuscatedPropertySimple happening at startup/installation. The initial property is instantiated by reflection which bypasses the constructors that correctly handle obfuscation+clear text creation. If you reboot the JON server before attempting to test the Content Sources then the Obfuscated property is correctly loaded and testing/authentication happens correctly. The fix is to add one extra check for clearText initialization. I'm still doing some more testing on this to see if I can see if there are any more edge cases to be aware of. Will probably ping Lukas as well to have an extra pair of eyes on this. With the earlier fix, incorrect usage of the pre/postUpdate and Load annotations were combined with odd behavior from Hibernate to cause unreliability within the obfuscation implementation. This time around, the same Hibernate unreliability, causes a slightly different issue that only shows up until a server reboot. The fix is to add a lazy check to initClearTextValue, when the obfuscated property is read. This costs nothing, defends against any situation where the @PostLoad annotation is not respected at initialization or any other time and is a very precise fix for this issue. To reiterate, the earlier changes fixed the obfuscation from being affected by inconsistent behavior and only uses the PostLoad to load clearText passwords in memory only. This fix ensures that clearTextPasswords are always loaded when they're needed. This has been fixed and pushed to master with commit: 1293a88ef64918b6401bd I've tested this fix on a patched JON 3.1.1.ER2 and it works well and reliably. This needs to be also checked into the release branch to complete the fix for this issue. Leaving this in the ON_DEV state to get signoff from charles and mfoley. I'm +1 on this for jon311 This is cherry-picked to release branch with commit: 0d0f22bd7f7e224945ac5da Moving this to MODIFIED for inclusion and retesting with next binary build. Likely 3.1.1.CR2 CR2 build is available at https://brewweb.devel.redhat.com/buildinfo?buildID=232185. Moving to ON_QA. Verified on JON 3.1.1.CR2 fresh install. Verified with 'Test Connection' and 'Synchronize'. Also verified below upgrade scenarios: -content source not setup in JON310, upgraded to JON311CR2: setup works ok. -content source setup which was not working in JON310, upgraded to JON311CR2: 'Test Connection' and 'Synchronize' works ok. -content source setup and working in JON301, upgraded to JON311CR2: continues to work. Bulk closing of old issues in VERIFIED state. |