Bug 1593663

Summary: cannot add rhos provider with amqp settings. credential validation fails with error "undefined method `strip' for nil:NilClass"
Product: Red Hat CloudForms Management Engine Reporter: Ievgen Zapolskyi <izapolsk>
Component: ProvidersAssignee: Gilles Dubreuil <gdubreui>
Status: CLOSED ERRATA QA Contact: Danylo Kholodov <dkholodo>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, dajohnso, gblomqui, gdubreui, jfrey, jhardy, jprause, obarenbo, pvala, simaishi, slucidi
Target Milestone: GAFlags: izapolsk: automate_bug+
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:03:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Embargoed:
Attachments:
Description Flags
appliance logs
none
screenshot none

Description Ievgen Zapolskyi 2018-06-21 10:41:59 UTC
Created attachment 1453411 [details]
appliance logs

Description of problem:
When I try to add RHOS11 provider with amqp, I always get above error. There is no such error with Ceilometer or when I add provider with Ceilometer and then make it use AMQP in edit provider form. Backtrace is below.

Version-Release number of selected component (if applicable):
5.10.0.1 (pod appliance)

How reproducible:
100%

Steps to Reproduce:
1. Try to add RHOS Cloud Provider with AMQP


Actual results:
Credential validation was not successful: undefined method `strip' for nil:NilClass

Expected results:
No such issue

Additional info:
----] I, [2018-06-21T10:20:36.800225 #270:42ebf18]  INFO -- : MIQ(MiqQueue.put) Message id: [4081],  id: [], Zone: [default], Role: [ems_operations], Server: [], MiqTask id: [7], Ident: [generic], Target id: [], Instanceid: [], Task id: [], Command: [ManageIQ::Providers::Openstack::CloudManager.raw_connect?], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: ["********", {:name=>"rho11", :provider_region=>"", :api_version=>"v3", :amqp_security_protocol=>"non-ssl", :keystone_v3_domain_id=>"default", :amqp_hostname=>"env-rhos11-1.cfme2.lab.eng.rdu2.redhat.com", :amqp_api_port=>"5672", :amqp_userid=>"guest", :event_stream_selection=>"amqp"}]
[----] I, [2018-06-21T10:20:36.800463 #270:42ebf18]  INFO -- : MIQ(MiqTask.generic_action_with_callback) Task: [7] Queued the action: [Validate EMS Provider Credentials] being run for user: [admin]
[----] I, [2018-06-21T10:20:37.321659 #7:7d2f80]  INFO -- : MIQ(MiqServer#populate_queue_messages) Fetched 1 miq_queue rows for queue_name=generic, wcount=4, priority=200
[----] I, [2018-06-21T10:20:38.155850 #7:653144c]  INFO -- : MIQ(ContainerEmbeddedAnsible#start) Waiting for Ansible container to respond
[----] I, [2018-06-21T10:20:39.370027 #214:7d2f80]  INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [4081], MiqWorker id: [2], Zone: [default], Role: [ems_operations], Server: [], MiqTask id: [7], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [ManageIQ::Providers::Openstack::CloudManager.raw_connect?], Timeout: [600], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: ["********", {:name=>"rho11", :provider_region=>"", :api_version=>"v3", :amqp_security_protocol=>"non-ssl", :keystone_v3_domain_id=>"default", :amqp_hostname=>"env-rhos11-1.cfme2.lab.eng.rdu2.redhat.com", :amqp_api_port=>"5672",:amqp_userid=>"guest", :event_stream_selection=>"amqp"}], Dequeued in: [2.573796062] seconds
[----] I, [2018-06-21T10:20:39.370405 #214:7d2f80]  INFO -- : MIQ(MiqQueue#deliver) Message id: [4081], Delivering...
[----] I, [2018-06-21T10:20:39.371821 #214:7d2f80]  INFO -- : MIQ(MiqTask#update_status) Task: [7] [Active] [Ok] [Task starting]
[----] E, [2018-06-21T10:20:39.376847 #214:7d2f80] ERROR -- : MIQ(MiqQueue#deliver) Message id: [4081], Error: [undefined method `strip' for nil:NilClass]
[----] E, [2018-06-21T10:20:39.377228 #214:7d2f80] ERROR -- : [NoMethodError]: undefined method `strip' for nil:NilClass  Method:[block in method_missing]
[----] E, [2018-06-21T10:20:39.377385 #214:7d2f80] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/manageiq-providers-openstack-904df727ba22/app/models/manageiq/providers/openstack/manager_mixin.rb:20:in `raw_connect'
/var/www/miq/vmdb/app/models/ext_management_system.rb:225:in `raw_connect?'
/var/www/miq/vmdb/app/models/miq_queue.rb:451:in `block in dispatch_method'
/usr/share/ruby/timeout.rb:93:in `block in timeout'
/usr/share/ruby/timeout.rb:33:in `block in catch'
/usr/share/ruby/timeout.rb:33:in `catch'
/usr/share/ruby/timeout.rb:33:in `catch'
/usr/share/ruby/timeout.rb:108:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:449:in `dispatch_method'
/var/www/miq/vmdb/app/models/miq_queue.rb:426:in `block in deliver'
/var/www/miq/vmdb/app/models/user.rb:266:in `with_user_group'
/var/www/miq/vmdb/app/models/miq_queue.rb:426:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:104:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:329:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:326:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:326:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:127:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:22:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:402:in `block in start_runner_via_fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:400:in `start_runner_via_fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:390:in `start_runner'
/var/www/miq/vmdb/app/models/miq_worker.rb:441:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:271:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `times'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:53:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server.rb:147:in `start'
/var/www/miq/vmdb/app/models/miq_server.rb:239:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:27:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:48:in `start'
/var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'
[----] I, [2018-06-21T10:20:39.378068 #214:7d2f80]  INFO -- : MIQ(MiqQueue#delivered) Message id: [4081], State: [error], Delivered in [0.007672567] seconds
[----] I, [2018-06-21T10:20:39.379297 #214:7d2f80]  INFO -- : MIQ(MiqQueue#m_callback) Message id: [4081], Invoking Callback with args: ["Finished", "error", "undefined method `strip' for nil:NilClass", "nil"]
[----] I, [2018-06-21T10:20:39.379609 #214:7d2f80]  INFO -- : MIQ(MiqTask#update_status) Task: [7] [Finished] [Error] [undefined method `strip' for nil:NilClass]

Comment 2 Ievgen Zapolskyi 2018-06-21 10:43:43 UTC
Created attachment 1453412 [details]
screenshot

Comment 3 Gilles Dubreuil 2018-06-28 12:36:07 UTC
Reproduced exactly as described.

Comment 4 Gilles Dubreuil 2018-06-29 12:23:59 UTC
This is not a blocking issue. The work around is effectively to create the OpenStack provider using the default event which is Ceilometer and then edit the provider and change the event to AMQP.

Somehow the validation path is completely different during creation of the provider compared to updating process.

Comment 6 Gilles Dubreuil 2018-07-25 04:12:29 UTC
Also requires

https://github.com/ManageIQ/manageiq-providers-openstack/pull/324

Comment 7 Gilles Dubreuil 2018-07-25 04:56:32 UTC
https://github.com/ManageIQ/manageiq-ui-classic/pull/4239 has been removed

Comment 8 Gilles Dubreuil 2018-08-07 03:31:08 UTC
https://github.com/ManageIQ/manageiq-ui-classic/pull/4239 has been re-added

Comment 9 Gilles Dubreuil 2018-08-08 20:25:32 UTC
The common needed PR is https://github.com/ManageIQ/manageiq/pull/17797

Comment 10 Scott Seago 2018-08-23 17:33:24 UTC
*** Bug 1618700 has been marked as a duplicate of this bug. ***

Comment 12 Gilles Dubreuil 2018-10-26 05:48:52 UTC
Pull request https://github.com/ManageIQ/manageiq-providers-openstack/pull/324
is ready for final review.

Comment 13 CFME Bot 2018-10-26 22:09:26 UTC
New commit detected on ManageIQ/manageiq-providers-openstack/hammer:

https://github.com/ManageIQ/manageiq-providers-openstack/commit/2624415bbe72c8227ee8515b34e0aa77841e8273
commit 2624415bbe72c8227ee8515b34e0aa77841e8273
Author:     Samuel Lucidi <mansam.edu>
AuthorDate: Fri Oct 26 10:37:24 2018 -0400
Commit:     Samuel Lucidi <mansam.edu>
CommitDate: Fri Oct 26 10:37:24 2018 -0400

    Merge pull request #324 from gildub/fix-cloud-provider-event-amqp

    New Cloud provider: Fix event creds validation for AMQP

    (cherry picked from commit fb91f0eefea53973d4c3e6eba997a44610071c6c)

    https://bugzilla.redhat.com/show_bug.cgi?id=1593663

 app/models/manageiq/providers/openstack/manager_mixin.rb | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

Comment 14 Parthvi Vala 2018-11-08 08:19:07 UTC
NOT FIXED. Tested on 5.10.0.23.20181106165157_92dd189.

As described in the original comment(https://bugzilla.redhat.com/show_bug.cgi?id=1593663#c0), if AMQP is validated while first adding the provider, it fails. But, if it is validated while editing the provider, it works fine.

Comment 20 CFME Bot 2018-11-15 18:32:14 UTC
New commit detected on ManageIQ/manageiq-providers-openstack/hammer:

https://github.com/ManageIQ/manageiq-providers-openstack/commit/4cf56bc26ef6b6396eb5921fc0c5b2bbcdafb6a7
commit 4cf56bc26ef6b6396eb5921fc0c5b2bbcdafb6a7
Author:     Samuel Lucidi <mansam.edu>
AuthorDate: Wed Nov 14 23:50:46 2018 -0500
Commit:     Samuel Lucidi <mansam.edu>
CommitDate: Wed Nov 14 23:50:46 2018 -0500

    Merge pull request #399 from gildub/fix-cloud-provider-event-amqp

    New Cloud provider: Fix event creds validation for AMQP

    (cherry picked from commit 184663452d0384a5132fc8878e131f84710eae96)

    https://bugzilla.redhat.com/show_bug.cgi?id=1593663

 app/models/manageiq/providers/openstack/manager_mixin.rb | 8 +-
 1 file changed, 4 insertions(+), 4 deletions(-)

Comment 21 Danylo Kholodov 2018-11-28 10:39:29 UTC
Verified at CFME 5.10.0.26

Comment 22 errata-xmlrpc 2019-02-07 23:03:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:0212