Bug 1561448
| Summary: | RHSM failing to register with proxy settings | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | luke couzens <lcouzens> | ||||
| Component: | Appliance | Assignee: | Brandon Dunne <bdunne> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | luke couzens <lcouzens> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 5.8.0 | CC: | abellott, cpelland, dmetzger, obarenbo, rmanes, simaishi, yrudman | ||||
| Target Milestone: | GA | Keywords: | Regression, TestOnly, ZStream | ||||
| Target Release: | 5.10.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | webui:upgrade:black | ||||||
| Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1566562 1572621 (view as bug list) | Environment: | |||||
| Last Closed: | 2019-02-11 14:02:38 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | CFME Core | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1566562, 1572621 | ||||||
| Attachments: |
|
||||||
|
Description
luke couzens
2018-03-28 11:09:13 UTC
Created attachment 1414192 [details]
Picture showing the "Incorrect" method to add the proxy credentials with "https://" that generates the issue.
The issue arises if, in the editing window where you type the URL of the proxy, you specify the proxy prefixed with "https://" or "http://". This will incorrectly assume everything after the colon is a port number.
This is likely a text parsing issue, reading the colon as the port indicator and subsequently breaking up the line like so:
proxy_hostname = https
proxy_port = //rmanes-server.usersys.redhat.com
Workaround is to either:
- Specify the proxy without prepending "https://" or "http://"
- Edit the /etc/rhsm/rhsm.conf and change the proxy_hostname and proxy_port fields to the correct proxy location.
Taking a look into how this is handled currently.
Something like this would probably do it:
--- /root/registration_system.rb 2018-03-28 09:52:33.383266635 -0400
+++ app/models/registration_system.rb 2018-03-28 09:51:14.266819032 -0400
@@ -1,4 +1,5 @@
require 'linux_admin'
+require 'addressable/uri'
module RegistrationSystem
RHSM_CONFIG_FILE = "/etc/rhsm/rhsm.conf".freeze
@@ -83,8 +84,10 @@
return unless option_values[:proxy_address]
- write_rhsm_config(:proxy_hostname => option_values[:proxy_address].split(':')[0],
- :proxy_port => option_values[:proxy_address].split(':')[1],
+ uri = Addressable::URI.parse(option_values[:proxy_address])
+
+ write_rhsm_config(:proxy_hostname => uri.host,
+ :proxy_port => uri.port,
:proxy_user => option_values[:proxy_username],
:proxy_password => option_values[:proxy_password])
end
PR submitted here: https://github.com/ManageIQ/manageiq/pull/17222 New commits detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/ab7f65233e51e43c983c88f726efcd3d7a39f40d commit ab7f65233e51e43c983c88f726efcd3d7a39f40d Author: Robb Manes <robb.manes> AuthorDate: Wed Mar 28 10:46:42 2018 -0400 Commit: Robb Manes <robb.manes> CommitDate: Wed Mar 28 10:46:42 2018 -0400 Resolve string handling for "https://" or "http://" in update_rhsm_conf Previously, if a proxy URI was entered into the registration page leading with "https://" or "http://", it would be incorrectly entered into the rhsm.conf. This patch prevents this by ensuring it is a valid URI, and correctly parsing the string regardless if it has only a host in the URI or if it leads with the protocol. https://bugzilla.redhat.com/show_bug.cgi?id=1561448 app/models/registration_system.rb | 5 +- 1 file changed, 3 insertions(+), 2 deletions(-) https://github.com/ManageIQ/manageiq/commit/58c65e44d21368ce9ddd49042a978c0d9603ab81 commit 58c65e44d21368ce9ddd49042a978c0d9603ab81 Author: Brandon Dunne <brandondunne> AuthorDate: Thu Mar 29 14:15:07 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Thu Mar 29 14:15:07 2018 -0400 Add tests for RegistrationSystem.update_rhsm_conf with http and https https://bugzilla.redhat.com/show_bug.cgi?id=1561448 spec/models/registration_system_spec.rb | 31 +- 1 file changed, 21 insertions(+), 10 deletions(-) https://github.com/ManageIQ/manageiq/commit/65bfb6a12816774fbc532ca2581533a1917d495b commit 65bfb6a12816774fbc532ca2581533a1917d495b Author: Brandon Dunne <brandondunne> AuthorDate: Thu Mar 29 14:21:50 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Thu Mar 29 14:21:50 2018 -0400 Reduce duplicate test logic https://bugzilla.redhat.com/show_bug.cgi?id=1561448 spec/models/registration_system_spec.rb | 30 +- 1 file changed, 12 insertions(+), 18 deletions(-) https://github.com/ManageIQ/manageiq/commit/47ddbb4a967fed9ae31028088efe97896960d72b commit 47ddbb4a967fed9ae31028088efe97896960d72b Author: Brandon Dunne <brandondunne> AuthorDate: Thu Mar 29 14:28:28 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Thu Mar 29 14:28:28 2018 -0400 Test against multiple addresses (hostname, IPv4, IPv6) https://bugzilla.redhat.com/show_bug.cgi?id=1561448 spec/models/registration_system_spec.rb | 24 +- 1 file changed, 13 insertions(+), 11 deletions(-) https://github.com/ManageIQ/manageiq/commit/dafb5f7a99bb0409191a58f03bd55b59729e9cbb commit dafb5f7a99bb0409191a58f03bd55b59729e9cbb Author: Brandon Dunne <brandondunne> AuthorDate: Thu Mar 29 15:16:39 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Thu Mar 29 15:16:39 2018 -0400 myport is not a valid port, 0 is reserved so use that instead https://bugzilla.redhat.com/show_bug.cgi?id=1561448 spec/models/registration_system_spec.rb | 8 +- 1 file changed, 4 insertions(+), 4 deletions(-) https://github.com/ManageIQ/manageiq/commit/963a3f3a6c2a5d2b5f1059b06c75756323f22a13 commit 963a3f3a6c2a5d2b5f1059b06c75756323f22a13 Author: Brandon Dunne <brandondunne> AuthorDate: Thu Mar 29 15:19:09 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Thu Mar 29 15:19:09 2018 -0400 Fix issues related to proxy_address - Allow for http(s) or other schemes - Allow for hostname, IPv4 or IPv6 addresses https://bugzilla.redhat.com/show_bug.cgi?id=1561448 app/models/registration_system.rb | 6 +- 1 file changed, 3 insertions(+), 3 deletions(-) Verified in 5.10 |