Bug 607799 - The "JBoss CSP Patch Feed" is not authenticating to the default Feed URL
Summary: The "JBoss CSP Patch Feed" is not authenticating to the default Feed URL
Alias: None
Product: RHQ Project
Classification: Other
Component: Content
Version: 3.0.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Simeon Pinder
QA Contact: Corey Welton
Depends On:
Blocks: rhq_auto_blocker jon-sprint11-bugs 603787
TreeView+ depends on / blocked
Reported: 2010-06-24 21:12 UTC by John Sefler
Modified: 2010-08-12 16:49 UTC (History)
1 user (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-08-12 16:49:55 UTC

Attachments (Terms of Use)
HTTP client log. (6.20 KB, text/plain)
2010-07-02 23:19 UTC, Ondřej Žižka
no flags Details

Description John Sefler 2010-06-24 21:12:45 UTC
Description of problem:
The "JBoss CSP Patch Feed" is not authenticating to the default Feed URL

Version-Release number of selected component (if applicable):
 JBoss Operations Network
version: 2.4.0.GA_QA
build number: 10745:647a602 

How reproducible:

Steps to Reproduce:
1. Administration > Content > Content Sources > JBoss CSP Patch Feed
2. edit the Username and Password to a valid account
3. edit Active to Yes
Actual results:
Test failed - failed to connect to the remote repository for [JBoss CSP 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 [jonqa]. Make sure this user has an active account at the CSP and that the password is correct.

Expected results:

Additional info:
Looks like the there is an issue with the default Feed URL...

If if do a wget on this URL, there is a 301 error redirecting the request to a new URL:

[jsefler@jsefler tmp]$ wget "https://support.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=2.0"
--2010-06-24 17:05:49--  https://support.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=2.0
Resolving support.redhat.com...
Connecting to support.redhat.com||:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://access.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=2.0 [following]
--2010-06-24 17:05:49--  https://access.redhat.com/jbossnetwork/restricted/feed/software.html?product=all&downloadType=all&flavor=rss&version=&jonVersion=2.0
Resolving access.redhat.com...
Connecting to access.redhat.com||:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

If I explicitly change the Feed URL to the redirected location (on access.redhat.com), then TEST CONNECTION is successful.

So there are two issues:
1. The current default Feed URL should be updated to the new url.
2. All the JONs out in the field are broken.  New releases of JON should be able to handle the "301 Moved Permanently" when this happens again.

Comment 1 Charles Crouch 2010-06-29 17:06:17 UTC
Can you confirm this problem and investigate what it would take to support the 301 redirect request we get back from the CSP


Comment 2 Simeon Pinder 2010-06-29 19:56:26 UTC
Yes. This is a problem and I've confirmed the described behavior. I'm looking into what the fix should be. Browsers handle the redirect seamlessly, we need to do the same in the code.

Comment 3 Simeon Pinder 2010-06-30 22:38:06 UTC
This is some odd behavior with the HttpClient. The HttpClient knows how to redirect properly and loads the redirect url as one would expect but does not update the Method instance properly and throws Http 401 unauthorized responses(even with correct credentials applied) if we proceed with the redirected instance. The fix is to store the original and actually loaded urls and reinitialize the instance when they differ. I log a warning to server for the admin to update the original url if the redirection is permanent.  I looked into sending a message to the UI, but this would require additional changes that might introduce unnecessary instability. 

Available in successful builds of release branch release-3.0.0 >= 108. 

commit hash:

## It's likely that this needs to be made available for patches to 2.3 and 2.3.1(not sure if further back, this class starts after 2.3) or at least a notification should be made that customers need to change the content source url, should be made. ##

Comment 4 Rajan Timaniya 2010-07-02 07:44:26 UTC
Verified on JON 2.4 GA_QA (tag-jon-release build# 49)
Revision: 10771

1) Administration > Content > Content Sources > JBoss CSP Patch Feed
2) edit the Username and Password to a valid account
3) edit Active to Yes

'TEST CONNECTION' successful with the message: 'Test passed - the remote repository for [JBoss CSP Patch Feed] is available. '

'SYNCHRONIZE' gives message: 'Synchronizing content source [JBoss CSP Patch Feed] now. ' and list of available packages.

Comment 5 Ondřej Žižka 2010-07-02 23:19:58 UTC
Created attachment 429190 [details]
HTTP client log.

Comment 6 Corey Welton 2010-08-12 16:49:55 UTC
Mass-closure of verified bugs against JON.

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