Bug 1389536 - Check central admin configuration before connecting to remote region with API client
Summary: Check central admin configuration before connecting to remote region with API...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: 5.8.0
Assignee: Nick Carboni
QA Contact: Alex Newman
URL:
Whiteboard: central_admin
Depends On:
Blocks: 1390405
TreeView+ depends on / blocked
 
Reported: 2016-10-27 20:16 UTC by Nick Carboni
Modified: 2018-01-19 21:19 UTC (History)
4 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1390405 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:24:21 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nick Carboni 2016-10-27 20:16:33 UTC
If we try to relay a method call to a remote region and that region does not have central administration configured (no authentication record for the region) we fail like this (from production.log):

[----] I, [2016-10-27T16:11:07.637208 #25980:2abcf0c76d5c]  INFO -- : Started POST "/vm_infra/pre_prov_continue?button=submit" for 127.0.0.1 at 2016-10-27 16:11:07 -0400
[----] I, [2016-10-27T16:11:07.659415 #25980:2abcf0c76d5c]  INFO -- : Processing by VmInfraController#pre_prov_continue as JS
[----] I, [2016-10-27T16:11:07.659483 #25980:2abcf0c76d5c]  INFO -- :   Parameters: {"button"=>"submit"}
[----] F, [2016-10-27T16:11:07.719617 #25980:2abcf0c76d5c] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for false:FalseClass
/home/ncarboni/.gem/ruby/2.3.1/gems/ezcrypto-0.7/lib/ezcrypto.rb:293:in `block in load'
/home/ncarboni/.gem/ruby/2.3.1/gems/ezcrypto-0.7/lib/ezcrypto.rb:294:in `load'
/home/ncarboni/Source/manageiq/app/models/miq_region.rb:302:in `api_system_auth_token'
/home/ncarboni/Source/manageiq/app/models/miq_region.rb:314:in `api_system_auth_token_for_region'
/home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:67:in `api_client_connection_for_region'
/home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:74:in `exec_api_call'
/home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:52:in `block (2 levels) in api_relay_class_method'
/home/ncarboni/Source/manageiq/app/models/miq_request_workflow.rb:96:in `make_request'
/home/ncarboni/Source/manageiq/app/models/miq_provision_virt_workflow.rb:64:in `make_request'



We should raise a good error and handle it properly if this happens.

To reproduce this:
- Configure replication
- Attempt to provision a VM from a template and to a provider belonging to a remote region.

This should raise a good error to the screen that says that "this action is not supported without central administration authentication configured", but right now there is no feedback on the screen and you stay on the last screen of the provision workflow.

Comment 3 CFME Bot 2016-10-28 14:06:16 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/505dcd2995d5a73cba7b409b04f87936ec9835c6

commit 505dcd2995d5a73cba7b409b04f87936ec9835c6
Author:     Nick Carboni <ncarboni>
AuthorDate: Thu Oct 27 17:59:42 2016 -0400
Commit:     Nick Carboni <ncarboni>
CommitDate: Thu Oct 27 17:59:42 2016 -0400

    Raise an error if a region is not configured for central admin
    
    Now when someone tries to do something with an object that belongs
    to a remote region and hasn't configured the authentication key yet
    for that region they will get a clear error message.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1389536

 app/models/mixins/inter_region_api_method_relay.rb | 17 +++++---
 .../mixins/inter_region_api_method_relay_spec.rb   | 50 ++++++++++++++--------
 2 files changed, 44 insertions(+), 23 deletions(-)

Comment 4 CFME Bot 2016-10-28 14:06:20 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d08652db76d7d634b79e96d92a8b2e40eba2f91e

commit d08652db76d7d634b79e96d92a8b2e40eba2f91e
Author:     Nick Carboni <ncarboni>
AuthorDate: Thu Oct 27 18:01:55 2016 -0400
Commit:     Nick Carboni <ncarboni>
CommitDate: Thu Oct 27 18:01:55 2016 -0400

    Show the new error message when provisioning a VM from a remote template
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1389536

 app/controllers/application_controller/miq_request_methods.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


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