Error Refreshing in Openstack when admin is just a member


#1

Hi,
I’m hitting this error when refreshing provider with the openstack. The cause of the error was admin is just a normal member of a project. If I made admin user as an ‘admin’ role of that project, the error went away.

I was wondering if this is a bug - as in if the admin is not authorized to access a resource, just continue?
Possibly a duplicate/same resolution as this? OpenStack provider privileges

fog logs to help note the issue:

[----] I, [2015-08-24T17:33:40.980077 #1956:65de98]  INFO -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) Refreshing all targets...
[----] I, [2015-08-24T17:33:40.980164 #1956:65de98]  INFO -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) EMS: [MyTestCloud], id: [4] Refreshing targets for EMS: [MyTestCloud], id: [4]...
[----] I, [2015-08-24T17:33:40.980227 #1956:65de98]  INFO -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) EMS: [MyTestCloud], id: [4]   EmsOpenstack [MyTestCloud] id [4]
[----] I, [2015-08-24T17:33:43.317263 #1980:953e90]  INFO -- : MIQ(ScheduleWorker.do_work) Number of scheduled items to be processed: 1.
[----] I, [2015-08-24T17:33:43.323226 #1980:953e90]  INFO -- : MIQ(MiqQueue.put)        Message id: [299967],  id: [], Zone: [default], Role: [smartstate], Server: [], Ident: [generic], Target id: [], Instance id: [], Task id: [job_dispatcher], Command: [JobProxyDispatcher.dispatch], Timeout: [600], Priority: [20], State: [ready], Deliver On: [], Data: [], Args: []
[----] E, [2015-08-24T17:33:44.635181 #1956:65de98] ERROR -- : <Fog> excon.error     #<Excon::Errors::Forbidden: Expected([200, 204]) <=> Actual(403 Forbidden)
excon.error.response
  :body          => "<html><h1>Forbidden</h1><p>Access was denied to this resource.</p></html>"
  :headers       => {
    "Content-Length" => "73"
    "Content-Type"   => "text/html; charset=UTF-8"
    "Date"           => "Mon, 24 Aug 2015 21:33:44 GMT"
    "X-Trans-Id"     => "tx88888888888888888888888888888888"
  }
  :local_address => "172.1.0.2"
  :local_port    => 47928
  :reason_phrase => "Forbidden"
  :remote_ip     => "172.1.0.8"
  :status        => 403
  :status_line   => "HTTP/1.1 403 Forbidden\r\n"
>

[----] E, [2015-08-24T17:33:44.635429 #1956:65de98] ERROR -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) EMS: [MyTestCloud], id: [4] Refresh failed
[----] E, [2015-08-24T17:33:44.635517 #1956:65de98] ERROR -- : [NoMethodError]: undefined method `directories' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2015-08-24T17:33:44.635607 #1956:65de98] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/parsers/openstack.rb:162:in `block in get_object_store'
/var/www/miq/lib/openstack/openstack_handle/handle.rb:286:in `call'
/var/www/miq/lib/openstack/openstack_handle/handle.rb:286:in `block in service_for_each_accessible_tenant'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/gems/fog-core-1.30.0/lib/fog/core/collection.rb:19:in `each'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/gems/fog-core-1.30.0/lib/fog/core/collection.rb:19:in `each'
/var/www/miq/lib/openstack/openstack_handle/handle.rb:286:in `service_for_each_accessible_tenant'
/var/www/miq/vmdb/app/models/ems_refresh/parsers/openstack.rb:161:in `get_object_store'
/var/www/miq/vmdb/app/models/ems_refresh/parsers/openstack.rb:50:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/ems_refresh/parsers/openstack.rb:9:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/openstack_refresher.rb:6:in `parse_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:20:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:8:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:8:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/base_refresher.rb:8:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:80:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:78:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:78:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:356:in `block in deliver'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:352:in `deliver'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:107:in `deliver_queue_message'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:135:in `deliver_message'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:152:in `block in do_work'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:146:in `loop'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:146:in `do_work'
/var/www/miq/vmdb/lib/workers/worker_base.rb:323:in `block in do_work_loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:320:in `loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:320:in `do_work_loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:141:in `run'
/var/www/miq/vmdb/lib/workers/worker_base.rb:122:in `start'
/var/www/miq/vmdb/lib/workers/worker_base.rb:23:in `start_worker'
/var/www/miq/vmdb/lib/workers/bin/worker.rb:3:in `<top (required)>'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/runner.rb:52:in `eval'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/runner.rb:52:in `<top (required)>'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/bundler/gems/rails-4842a8377644/railties/lib/rails/commands.rb:64:in `require'
/opt/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/bundler/gems/rails-4842a8377644/railties/lib/rails/commands.rb:64:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
[----] E, [2015-08-24T17:33:44.635635 #1956:65de98] ERROR -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) EMS: [MyTestCloud], id: [4] Unable to perform refresh for the following targets:
[----] E, [2015-08-24T17:33:44.635758 #1956:65de98] ERROR -- :  --- EmsOpenstack [MyTestCloud] id [4]
[----] I, [2015-08-24T17:33:44.643180 #1956:65de98]  INFO -- : MIQ(EmsRefresh::Refreshers::OpenstackRefresher.refresh) Refreshing all targets...Complete

172.1.0.8 = Storage/Swift Node
172.1.0.2 =MIQ appliance


#2

@kirank hello, this should work with Capablanca release. Though it’s not a bug, admin role over tenants is a requirement, so you have all actions available.