Bug 1389491

Summary: [beta1] Region field links to https://localhost.localdomain when during global/remote replication
Product: Red Hat CloudForms Management Engine Reporter: cwyatt
Component: ApplianceAssignee: Nick Carboni <ncarboni>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: abellott, cpelland, hkataria, jhardy, mpovolny, ncarboni, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: replication
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1396523 (view as bug list) Environment:
Last Closed: 2017-06-12 16:46:57 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: 1396523    
Attachments:
Description Flags
Region field
none
redirect link none

Description cwyatt 2016-10-27 17:51:48 UTC
Created attachment 1214696 [details]
Region field

Description of problem:
On the global region if you go to the VM details page and click the Region field, it defaults to using the hostname of the remote region. However, the UI will allow you to enter an IP (not a hostname) of a remote appliance. So then when you click the Region field it redirects you to something like https://localhost.localdomain/vm_infra/show/3000000000040

Version-Release number of selected component (if applicable):
5.7.0.7-beta1.20161025153249_9376fbd

How reproducible:
100%

Steps to Reproduce:
1. Set up global/remote regions using IP for remote database
2. Navigate to a VM 
3. Click the link in the Region field

Actual results:


Expected results:


Additional info:

Comment 2 cwyatt 2016-10-27 17:52:24 UTC
Created attachment 1214697 [details]
redirect link

Comment 4 Harpreet Kataria 2016-10-27 19:57:59 UTC
Gregg,

UI calls model method https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_region.rb#L223 to determine the Remote region link from VM summary screen.
Can you please look into this BZ, doesnt look like a UI issue.

Please send it back to me if it turns out to be UI issue.

Thanks,
~Harpreet

Comment 5 Nick Carboni 2016-11-17 23:02:24 UTC
It is possible that this was only meant to work when a routable hostname was set for the remote UI server (which was not the case here), but I made a fix to unset the hostname when it looks like "localhost" so that we can fall back to using the IP. This was this has at least a chance of working out of the box.

https://github.com/ManageIQ/manageiq/pull/12732

Comment 6 CFME Bot 2016-11-18 13:56:27 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d53a031dd1aa9578f8f8b6bb023ba4ad702eee13

commit d53a031dd1aa9578f8f8b6bb023ba4ad702eee13
Author:     Nick Carboni <ncarboni>
AuthorDate: Thu Nov 17 17:53:01 2016 -0500
Commit:     Nick Carboni <ncarboni>
CommitDate: Thu Nov 17 17:59:42 2016 -0500

    Unset the server hostname when it matches /.*localhost.*/
    
    This hostname is not routable so it makes no sense to expose it
    as the access point for the server.
    
    Calls to methods like MiqRegion#remote_ui_hostname will now properly
    fallback to using the IP address rather than returning something like
    "localhost.localdomain" and nearly ensuring the caller's failure.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1389491

 app/models/miq_server.rb | 1 +
 1 file changed, 1 insertion(+)