Bug 1494442 - symbol conversion error while detaching disks from an openstack instance
Summary: symbol conversion error while detaching disks from an openstack instance
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.7.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: GA
: 5.9.0
Assignee: Scott Seago
QA Contact: Ido Ovadia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-22 09:26 UTC by Felix Dewaleyne
Modified: 2021-09-09 12:37 UTC (History)
11 users (show)

Fixed In Version: 5.9.0.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:18:06 UTC
Category: Bug
Cloudforms Team: Openstack
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 0 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 18:37:12 UTC

Internal Links: 1556814

Description Felix Dewaleyne 2017-09-22 09:26:26 UTC
Description of problem:
symbol conversion error while detaching disks from an openstack instance

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

How reproducible:
all the time

Steps to Reproduce:
1.detach the volumes using the calls in additional info
2.
3.

Actual results:
[----] E, [2017-09-20T17:21:41.550514 #26571:91512c] ERROR -- : MIQ(MiqQueue#deliver) Message id: [15967714], Error: [no implicit conversion of Symbol into Hash]
[----] E, [2017-09-20T17:21:41.550810 #26571:91512c] ERROR -- : [TypeError]: no implicit conversion of Symbol into Hash  Method:[rescue in deliver]
[----] E, [2017-09-20T17:21:41.551014 #26571:91512c] ERROR -- : /var/www/miq/vmdb/app/models/vm_or_template.rb:330:in `merge'
/var/www/miq/vmdb/app/models/vm_or_template.rb:330:in `run_command_via_parent'
/var/www/miq/vmdb/app/models/vm_or_template/operations/configuration.rb:102:in `raw_detach_volume'
/var/www/miq/vmdb/app/models/vm_or_template/operations/configuration.rb:106:in `detach_volume'
/var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:343:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:107:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:135:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:153:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:341:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:338:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:338:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:160:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:134:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:343:in `block in start'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:341:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:270:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:150:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_worker.rb:150:in `times'
/var/www/miq/vmdb/app/models/miq_worker.rb:150: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:158:in `start'
/var/www/miq/vmdb/app/models/miq_server.rb:250:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:65:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:92:in `start'
/var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'
[----] I, [2017-09-20T17:21:41.551147 #26571:91512c]  INFO -- : MIQ(MiqQueue#delivered) Message id: [15967714], State: [error], Delivered in [0.016883466] seconds

Expected results:
volume detached

Additional info:
- method sample :
~~~
vm = $evm.vmdb('vm', 3076)
disks = $evm.vmdb('disk').where(:hardware_id => vm.id, :backing_type => 'CloudVolume')

disks.each do |disk|
  cloud_volume = disk.backing
  vm.detach_volume(cloud_volume.id) unless cloud_volume.nil?
end
~~~
- possible related error :
~~~
[----] E, [2017-09-20T19:17:12.067803 #5234:f9b12c] ERROR -- : MIQ(MiqQueue#deliver) Message id: [15975009], Error: [undefined method find_by_id_filtered' for #<ManageIQ::Providers::Openstack::CloudManager:0x00000002c44710>] [----] E, [2017-09-20T19:17:12.068221 #5234:f9b12c] ERROR -- : [NoMethodError]: undefined methodfind_by_id_filtered' for #ManageIQ::Providers::Openstack::CloudManager:0x00000002c44710 Method:[rescue in deliver]
~~~

https://github.com/ManageIQ/manageiq/blob/euwe-3/app/models/manageiq/providers/openstack/cloud_manager.rb#L317

Comment 2 Greg McCullough 2017-09-22 14:57:43 UTC
Pass to providers to review errors in backend model.

Comment 3 Tzu-Mainn Chen 2017-09-26 14:38:39 UTC
Related issue: https://github.com/ManageIQ/manageiq/issues/16002

Comment 4 Scott Seago 2017-10-04 14:49:22 UTC
A quick note on the steps to reproduce:
disks = $evm.vmdb('disk').where(:hardware_id => vm.id, :backing_type => 'CloudVolume')

This has an error in it -- it's the hardware ID that we're matching, not the VM ID, so it should change to:
disks = $evm.vmdb('disk').where(:hardware_id => vm.hardware.id, :backing_type => 'CloudVolume')

You might get lucky and have this work if every hardware object maps to a Vm or Template, and the database IDs happen to all be the same -- if you have any hosts, this probably won't work. I figured I'd mention it in case the code which was included is used anywhere in automate or test scripts.

Comment 5 Felix Dewaleyne 2017-10-06 13:44:29 UTC
(In reply to Scott Seago from comment #4)
> A quick note on the steps to reproduce:
> disks = $evm.vmdb('disk').where(:hardware_id => vm.id, :backing_type =>
> 'CloudVolume')
> 
> This has an error in it -- it's the hardware ID that we're matching, not the
> VM ID, so it should change to:
> disks = $evm.vmdb('disk').where(:hardware_id => vm.hardware.id,
> :backing_type => 'CloudVolume')
> 
> You might get lucky and have this work if every hardware object maps to a Vm
> or Template, and the database IDs happen to all be the same -- if you have
> any hosts, this probably won't work. I figured I'd mention it in case the
> code which was included is used anywhere in automate or test scripts.

passed to the customer - 
This script is just prototype for automation method and currently they are using fog/openstack library for direct openstack connection but will take into account the correction.

Comment 8 CFME Bot 2017-10-11 13:16:34 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/003dde792e5fad39127bca06fe895e708e81f7aa

commit 003dde792e5fad39127bca06fe895e708e81f7aa
Author:     Scott Seago <sseago>
AuthorDate: Tue Oct 10 09:27:38 2017 -0400
Commit:     Scott Seago <sseago>
CommitDate: Tue Oct 10 10:23:08 2017 -0400

    bug 1494442: fix attach/detach disks automate methods
    
    Fix for bug 1494442 - symbol conversion error while detaching disks
      from an openstack instance
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1494442

 app/models/vm_or_template/operations/configuration.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 9 CFME Bot 2017-10-16 16:43:54 UTC
New commit detected on ManageIQ/manageiq-providers-openstack/master:
https://github.com/ManageIQ/manageiq-providers-openstack/commit/1b4d3f1e3ccc8968910195d055d37bee9a8fa48b

commit 1b4d3f1e3ccc8968910195d055d37bee9a8fa48b
Author:     Scott Seago <sseago>
AuthorDate: Tue Oct 10 10:23:33 2017 -0400
Commit:     Scott Seago <sseago>
CommitDate: Tue Oct 10 16:52:42 2017 -0400

    bug 1494442: fix attach/detach disks automate methods
    
    Fix for bug 1494442 - symbol conversion error while detaching disks
      from an openstack instance
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1494442

 app/models/manageiq/providers/openstack/cloud_manager.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comment 10 Ido Ovadia 2018-02-25 18:12:38 UTC
Verified
========
5.9.0.21

Comment 13 errata-xmlrpc 2018-03-01 13:18:06 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-2018:0380


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