Bug 1549131

Summary: While creating a catalog service, checked provisioned method failed with Nil Exception.
Product: Red Hat CloudForms Management Engine Reporter: Neha Chugh <nchugh>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED DUPLICATE QA Contact: Dave Johnson <dajohnso>
Severity: high Docs Contact:
Priority: high    
Version: 5.8.0CC: cpelland, mkanoor, nchugh, obarenbo, pmukhedk, tfitzger
Target Milestone: GA   
Target Release: 5.8.4   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-28 17:16:13 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:

Description Neha Chugh 2018-02-26 13:25:28 UTC
Description of problem:
While creating a catalog service, checked provisioned method failed with Nil Exception.

Version-Release number of selected component (if applicable):
Cloudforms 4.5

Steps to Reproduce:
Provision instance openstack throws catalog service

128851:[----] I, [2016-09-11T22:10:00.133121 #5973:6b5990] INFO – : Q-task_id([service_template_provision_task_37]) In State=[checkprovisioned], invoking [on_error] method=[update_serviceprovision_status(status => '[NoMethodError]: undefined method []' for nil:NilClass')] 128853:[----] I, [2016-09-11T22:10:00.185796 #5973:6b5990] INFO -- : Q-task_id([service_template_provision_task_37]) Invoking [inline] method [/ManageIQ/Service/Provisioning/StateMachines/ServiceProvision_Template/update_serviceprovision_status] with inputs [{"status"=>"[NoMethodError]: undefined method[]"}]

Actual results:

Throws an exception during check provisioned method.


Expected results:
It should create a service successfully.

Additional info:
service_template_provision_request_1000000000370
miq_provision_1000000000746

Comment 3 Tina Fitzgerald 2018-02-26 17:46:14 UTC
Hi Neha,

Can you provide logs and access to your appliance?

Thanks,
Tina

Comment 5 Tina Fitzgerald 2018-02-28 17:16:13 UTC
Hi Neha,

The problem description log messages are dated 2016-09-11T22:10:00.133121 which is odd, and I would have expected this ticket to be linked to the customer case you referenced in comment 4: "cd /cases/02003227"

I believe this issue has already been reported and fixed. The root cause is that the Service dialog sets the cloud_tenant to a string and the code is expecting an array.
The evm.log from evm_current_workerzonemaster-cloudforms-prd01.privatecloud_20180223_122059 shows the following: 

Cloud tenant as a string
[----] I, [2018-02-23T09:44:45.813364 #9544:11db130]  INFO -- : Q-task_id([miq_provision_1000000000746]) MIQ(ManageIQ::Providers::Openstack::CloudManager::Provision#log_clone_options) Prov Options:  [:dialog_cloud_tenant](String) = "1000000000131"

....
error
[----] I, [2018-02-23T09:44:45.815313 #9544:11db130]  INFO -- : Q-task_id([miq_provision_1000000000746]) Starting Phase <provision_error>
[----] E, [2018-02-23T09:44:45.844982 #9544:11db130] ERROR -- : Q-task_id([miq_provision_1000000000746]) MIQ(ManageIQ::Providers::Openstack::CloudManager::Provision#provision_error) [[NoMethodError]: undefined method `[]' for nil:NilClass] encountered during phase [start_clone_task]
[----] E, [2018-02-23T09:44:45.845092 #9544:11db130] ERROR -- : Q-task_id([miq_provision_1000000000746]) /var/www/miq/vmdb/app/models/mixins/provider_object_mixin.rb:29:in `connection_source'
/var/www/miq/vmdb/app/models/mixins/provider_object_mixin.rb:5:in `with_provider_connection'
/var/www/miq/vmdb/app/models/manageiq/providers/openstack/cloud_manager/provision/cloning.rb:45:in `start_clone'
/var/www/miq/vmdb/app/models/manageiq/providers/cloud_manager/provision/state_machine.rb:37:in `start_clone_task'
....

error
[----] I, [2018-02-23T09:45:56.195454 #9544:1265524]  INFO -- : Q-task_id([miq_provision_1000000000746]) <AutomationEngine> Calling Create Notification type: automate_user_error subject type: MiqRequest id: 1000000000370 options: {:message=>"VM Provision Error: [workerzonemaster01] VM [test-neha01.tenant0012.guests.privatecloud.tenant0002.guests.privatecloud] Step [CheckProvisioned] Status [Error Creating VM] Message [[NoMethodError]: undefined method `[]' for nil:NilClass] "}
[----] E, [2018-02-23T09:45:56.218542 #9544:1265524] ERROR -- : Q-task_id([miq_provision_1000000000746]) <AutomationEngine> <AEMethod update_provision_status> VM Provision Error: [workerzonemaster01] VM [test-neha01.tenant0012.guests.privatecloud.tenant0002.guests.privatecloud] Step [CheckProvisioned] Status [Error Creating VM] Message [[NoMethodError]: undefined method `[]' for nil:NilClass]

Issue reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=1532244

Let me know if you have any questions.

Thanks,
Tina

*** This bug has been marked as a duplicate of bug 1532244 ***