{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1339","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1339/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1339/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1339/events","html_url":"https://github.com/ManageIQ/manageiq/issues/1339","id":53917479,"number":1339,"title":"Openstack Juno Provisioning error using ManageIQ Anand Release","user":{"login":"mandeep170","id":3278289,"avatar_url":"https://avatars.githubusercontent.com/u/3278289?v=3","gravatar_id":"","url":"https://api.github.com/users/mandeep170","html_url":"https://github.com/mandeep170","followers_url":"https://api.github.com/users/mandeep170/followers","following_url":"https://api.github.com/users/mandeep170/following{/other_user}","gists_url":"https://api.github.com/users/mandeep170/gists{/gist_id}","starred_url":"https://api.github.com/users/mandeep170/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandeep170/subscriptions","organizations_url":"https://api.github.com/users/mandeep170/orgs","repos_url":"https://api.github.com/users/mandeep170/repos","events_url":"https://api.github.com/users/mandeep170/events{/privacy}","received_events_url":"https://api.github.com/users/mandeep170/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-09T21:33:19Z","updated_at":"2015-01-14T21:59:43Z","closed_at":null,"body":"When I tried to provision an Openstack VM against a devstack Openstack Juno distro using ManageIQ Anand Release. The request failed with the last message of '[NoMethodError]: undefined method `state' for nil:NilClass'.\r\n###EVM Log excerpt \r\n```\r\n[----] E, [2015-01-09T18:45:26.875155 #7407:10c9814] ERROR -- : Q-task_id([miq_provision_1]) MIQ(MiqProvisionOpenstack#provision_error) [[NoMethodError]: undefined method `state' for nil:NilClass] encountered during phase [poll_clone_complete]\r\n[----] E, [2015-01-09T18:45:26.875242 #7407:10c9814] ERROR -- : Q-task_id([miq_provision_1]) /opt/manageiq/vmdb/app/models/miq_provision_openstack/cloning.rb:5:in `block in do_clone_task_check'\r\n/opt/manageiq/vmdb/app/models/mixins/provider_object_mixin.rb:6:in `block in with_provider_connection'\r\n/opt/manageiq/vmdb/app/models/ext_management_system.rb:184:in `with_provider_connection'\r\n/opt/manageiq/vmdb/app/models/mixins/provider_object_mixin.rb:5:in `with_provider_connection'\r\n/opt/manageiq/vmdb/app/models/miq_provision_openstack/cloning.rb:3:in `do_clone_task_check'\r\n/opt/manageiq/vmdb/app/models/miq_provision_cloud/state_machine.rb:21:in `poll_clone_complete'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision_cloud/state_machine.rb:17:in `start_clone_task'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision/state_machine.rb:15:in `prepare_provision'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision_cloud/state_machine.rb:9:in `determine_placement'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision_cloud/state_machine.rb:3:in `create_destination'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision/state_machine.rb:4:in `run_provision'\r\n/opt/manageiq/vmdb/app/models/miq_request_task/state_machine.rb:26:in `signal'\r\n/opt/manageiq/vmdb/app/models/miq_provision.rb:75:in `do_request'\r\n/opt/manageiq/vmdb/app/models/miq_request_task.rb:190:in `execute'\r\n/opt/manageiq/vmdb/app/models/miq_queue.rb:361:in `block in deliver'\r\n/home/miqbuilder/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:69:in `timeout'\r\n/opt/manageiq/vmdb/app/models/miq_queue.rb:357:in `deliver'\r\n/opt/manageiq/vmdb/lib/workers/queue_worker_base.rb:107:in `deliver_queue_message'\r\n/opt/manageiq/vmdb/lib/workers/queue_worker_base.rb:135:in `deliver_message'\r\n/opt/manageiq/vmdb/lib/workers/queue_worker_base.rb:152:in `block in do_work'\r\n/opt/manageiq/vmdb/lib/workers/queue_worker_base.rb:146:in `loop'\r\n/opt/manageiq/vmdb/lib/workers/queue_worker_base.rb:146:in `do_work'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:317:in `block in do_work_loop'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:314:in `loop'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:314:in `do_work_loop'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:135:in `run'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:123:in `start'\r\n/opt/manageiq/vmdb/lib/workers/worker_base.rb:23:in `start_worker'\r\n/opt/manageiq/vmdb/lib/workers/bin/worker.rb:5:in `<top (required)>'\r\n/home/miqbuilder/.rvm/gems/ruby-1.9.3-p551/bundler/gems/rails-f9749c2ef83b/railties/lib/rails/commands/runner.rb:52:in `eval'\r\n/home/miqbuilder/.rvm/gems/ruby-1.9.3-p551/bundler/gems/rails-f9749c2ef83b/railties/lib/rails/commands/runner.rb:52:in `<top (required)>'\r\n/home/miqbuilder/.rvm/gems/ruby-1.9.3-p551/bundler/gems/rails-f9749c2ef83b/railties/lib/rails/commands.rb:64:in `require'\r\n/home/miqbuilder/.rvm/gems/ruby-1.9.3-p551/bundler/gems/rails-f9749c2ef83b/railties/lib/rails/commands.rb:64:in `<top (required)>'\r\nscript/rails:6:in `require'\r\nscript/rails:6:in `<main>'\r\n```"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/70000682","html_url":"https://github.com/ManageIQ/manageiq/issues/1339#issuecomment-70000682","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1339","id":70000682,"user":{"login":"gmcculloug","id":2591569,"avatar_url":"https://avatars.githubusercontent.com/u/2591569?v=3","gravatar_id":"","url":"https://api.github.com/users/gmcculloug","html_url":"https://github.com/gmcculloug","followers_url":"https://api.github.com/users/gmcculloug/followers","following_url":"https://api.github.com/users/gmcculloug/following{/other_user}","gists_url":"https://api.github.com/users/gmcculloug/gists{/gist_id}","starred_url":"https://api.github.com/users/gmcculloug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmcculloug/subscriptions","organizations_url":"https://api.github.com/users/gmcculloug/orgs","repos_url":"https://api.github.com/users/gmcculloug/repos","events_url":"https://api.github.com/users/gmcculloug/events{/privacy}","received_events_url":"https://api.github.com/users/gmcculloug/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T21:59:43Z","updated_at":"2015-01-14T21:59:43Z","body":"@mandeep170 Can you apply the following diff to your environment, restart the server and re-run the failed provisioning request?  The logging will help us determine why we are not finding the instance when looping through ```openstack.servers.detect```.\r\n\r\n```diff\r\ndiff --git a/vmdb/app/models/miq_provision_openstack/cloning.rb b/vmdb/app/models/miq_provision_openstack/cloning.rb\r\nindex 6346ef1..3ae879f 100644\r\n--- a/vmdb/app/models/miq_provision_openstack/cloning.rb\r\n+++ b/vmdb/app/models/miq_provision_openstack/cloning.rb\r\n@@ -1,7 +1,11 @@\r\n module MiqProvisionOpenstack::Cloning\r\n   def do_clone_task_check(clone_task_ref)\r\n     self.source.with_provider_connection do |openstack|\r\n-      instance = openstack.servers.detect { |s| s.id == clone_task_ref}\r\n+      $log.warn(\"do_clone_task_check clone_task_ref: #{clone_task_ref.inspect}\")\r\n+      instance = openstack.servers.detect do |s|\r\n+        $log.warn(\"do_clone_task_check service class: #{s.class.name} id: #{s.id.inspect}\")\r\n+        s.id == clone_task_ref\r\n+      end\r\n       status   = instance.state.downcase.to_sym\r\n \r\n       return true if status == :active\r\n@@ -41,6 +45,8 @@ module MiqProvisionOpenstack::Cloning\r\n     connection_options = {:tenant_name => options[:cloud_tenant][1]} if options[:cloud_tenant].is_a? Array\r\n     self.source.with_provider_connection(connection_options) do |openstack|\r\n       instance = openstack.servers.create(clone_options)\r\n+\r\n+      $log.warn(\"start_clone servers.create instance: #{instance.inspect}\")\r\n       return instance.id\r\n     end\r\n   end\r\n\r\n```"}}