Bug 1302160 - unknown attribute 'type' for Network. Method:[rescue in block in add_elements]
unknown attribute 'type' for Network. Method:[rescue in block in add_elements]
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers (Show other bugs)
5.5.0
Unspecified Unspecified
high Severity high
: GA
: 5.6.0
Assigned To: Ladislav Smola
Ola Pavlenko
openstack:smartstate
:
Depends On:
Blocks: 1302832
  Show dependency treegraph
 
Reported: 2016-01-26 19:32 EST by Marius Cornea
Modified: 2017-08-29 23:48 EDT (History)
7 users (show)

See Also:
Fixed In Version: 5.6.0.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1302832 (view as bug list)
Environment:
Last Closed: 2016-06-29 11:33:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marius Cornea 2016-01-26 19:32:45 EST
Description of problem:
During Openstack instance SSA the following error whos up in th evm log:
[ActiveRecord::UnknownAttributeError]: unknown attribute 'type' for Network.  Method:[rescue in block in add_elements]

SSA finishes fine.

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

How reproducible:
100%

Steps to Reproduce:
1. Run SSA for an Openstack instance
2. Check evm.log

Actual results:
The following error shows up:

[----] I, [2016-01-26T19:26:46.604051 #13964:635998]  INFO -- : Q-task_id([1047274a-c48b-11e5-b58b-525400b9ba01]) MIQ(ManageIQ::Providers::Openstack::CloudManager::Vm#add_elements) Adding XML elements for [7] from [miq]
[----] E, [2016-01-26T19:26:46.692309 #13964:635998] ERROR -- : Q-task_id([1047274a-c48b-11e5-b58b-525400b9ba01]) [ActiveRecord::UnknownAttributeError]: unknown attribute 'type' for Network.  Method:[rescue in block in add_elements]
[----] E, [2016-01-26T19:26:46.693208 #13964:635998] ERROR -- : Q-task_id([1047274a-c48b-11e5-b58b-525400b9ba01]) /opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/attribute_assignment.rb:59:in `rescue in _assign_attribute'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/attribute_assignment.rb:35:in `each'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/core.rb:566:in `init_attributes'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/core.rb:281:in `initialize'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/inheritance.rb:61:in `new'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/inheritance.rb:61:in `new'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/reflection.rb:141:in `build_association'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/associations/association.rb:250:in `build_record'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/associations/collection_association.rb:146:in `build'
/opt/rh/cfme-gemset/gems/activerecord-4.2.5/lib/active_record/associations/collection_proxy.rb:259:in `build'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:51:in `save_inventory_with_findkey'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:11:in `block in save_inventory_multi'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:10:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:10:in `save_inventory_multi'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:225:in `save_networks_inventory'
/var/www/miq/vmdb/app/models/network.rb:21:in `add_missing_elements'
/var/www/miq/vmdb/app/models/network.rb:8:in `add_elements'
/var/www/miq/vmdb/app/models/mixins/scanning_mixin.rb:90:in `block in add_elements'
/var/www/miq/vmdb/app/models/mixins/scanning_mixin.rb:88:in `each'
/var/www/miq/vmdb/app/models/mixins/scanning_mixin.rb:88:in `add_elements'
/var/www/miq/vmdb/app/models/mixins/scanning_mixin.rb:67:in `save_metadata'
/var/www/miq/vmdb/app/models/miq_queue.rb:343:in `block in deliver'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:89:in `block in timeout'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `block in catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:104:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:341:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106: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:151:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331: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:128:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:29:in `start_worker'
/var/www/miq/vmdb/lib/workers/bin/worker.rb:2:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/runner.rb:60:in `load'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/runner.rb:60:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:90:in `runner'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
/var/www/miq/vmdb/bin/rails:4:in `require'
/var/www/miq/vmdb/bin/rails:4:in `<main>'
[----] I, [2016-01-26T19:26:46.705738 #13964:635998]  INFO -- : Q-task_id([1047274a-c48b-11e5-b58b-525400b9ba01]) MIQ(MiqQueue#delivered) Message id: [6091], State: [ok], Delivered in [0.121838357] seconds
[----] I, [2016-01-26T19:26:46.733925 #13964:635998]  INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [6092], MiqWorker id: [39], Zone: [default], Role: [smartstate], Server: [], Ident: [generic], Target id: [7], In
Comment 3 Shveta 2016-02-01 16:31:36 EST
Assigning to add test case
Comment 4 Ladislav Smola 2016-04-21 08:46:01 EDT
On master seems like there is different error now, but SSA still finishes

[----] I, [2016-04-21T14:43:30.995272 #27791:109b98c]  INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [1864], MiqWorker id: [39], Zone: [default], Role: [smartstate], Server: [], Ident: [generic], Target id: [], Instance id: [], Task id: [agent_job_state_1461242606], Command: [Job.agent_state_update_queue], Timeout: [600], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: ["79f652f8-07be-11e6-916e-3c970e7e4812", "Synchronize", "Synchronization complete"], Dequeued in: [4.857529652] seconds
[----] I, [2016-04-21T14:43:30.995392 #27791:109b98c]  INFO -- : Q-task_id([agent_job_state_1461242606]) MIQ(MiqQueue#deliver) Message id: [1864], Delivering...
[----] I, [2016-04-21T14:43:30.997304 #27791:109b98c]  INFO -- : Q-task_id([agent_job_state_1461242606]) JOB([79f652f8-07be-11e6-916e-3c970e7e4812] Agent state update: state: [Synchronize], message: [Synchronization complete]
[----] E, [2016-04-21T14:43:30.998678 #27791:109b98c] ERROR -- : Q-task_id([agent_job_state_1461242606]) MIQ(MiqQueue#deliver) Message id: [1864], Error: [NotImplementedError]
[----] E, [2016-04-21T14:43:30.998764 #27791:109b98c] ERROR -- : Q-task_id([agent_job_state_1461242606]) [NotImplementedError]: NotImplementedError  Method:[rescue in deliver]
[----] E, [2016-04-21T14:43:30.998948 #27791:109b98c] ERROR -- : Q-task_id([agent_job_state_1461242606]) /home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute.rb:84:in `type_cast'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute.rb:46:in `original_value'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute.rb:44:in `original_value'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute.rb:123:in `changed_from_assignment?'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute.rb:55:in `changed?'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_mutation_tracker.rb:25:in `changed?'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_mutation_tracker.rb:9:in `block in changed_values'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_mutation_tracker.rb:8:in `each'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_mutation_tracker.rb:8:in `each_with_object'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_mutation_tracker.rb:8:in `changed_values'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_methods/dirty.rb:83:in `changed_attributes'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activemodel/lib/active_model/dirty.rb:137:in `changed?'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/timestamp.rb:85:in `should_record_timestamps?'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/timestamp.rb:72:in `_update_record'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/persistence.rb:534:in `create_or_update'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/callbacks.rb:298:in `block in create_or_update'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activesupport/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activesupport/lib/active_support/callbacks.rb:750:in `_run_save_callbacks'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/callbacks.rb:298:in `create_or_update'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/persistence.rb:125:in `save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/validations.rb:44:in `save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:319:in `block (2 levels) in save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:211:in `transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:319:in `block in save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:334:in `rollback_active_record_state!'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:318:in `save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/suppressor.rb:41:in `save'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/persistence.rb:266:in `block in update'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:234:in `block in transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:234:in `transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:211:in `transaction'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
/home/Ladas/.rvm/gems/ruby-2.2.3/bundler/gems/rails-597fa0b42f90/activerecord/lib/active_record/persistence.rb:264:in `update'
/home/Ladas/Projects/cfme/manageiq/app/models/job.rb:77:in `agent_state_update'
/home/Ladas/Projects/cfme/manageiq/app/models/job.rb:63:in `agent_state_update_queue'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue.rb:347:in `block in deliver'
/home/Ladas/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
/home/Ladas/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
/home/Ladas/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/home/Ladas/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/home/Ladas/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue.rb:343:in `deliver'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue_worker_base/runner.rb:146:in `loop'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_queue_worker_base/runner.rb:146:in `do_work'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:334:in `block in do_work_loop'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:331:in `loop'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:331:in `do_work_loop'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:153:in `run'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:128:in `start'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker/runner.rb:21:in `start_worker'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:346:in `block in start'
/home/Ladas/.rvm/gems/ruby-2.2.3/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/home/Ladas/.rvm/gems/ruby-2.2.3/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:344:in `start'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:274:in `start_worker'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:154:in `block in sync_workers'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:154:in `times'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_worker.rb:154:in `sync_workers'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_server/worker_management/monitor.rb:52:in `block in sync_workers'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_server/worker_management/monitor.rb:50:in `each'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers'
/home/Ladas/Projects/cfme/manageiq/app/models/miq_server.rb:173:in `start'
Comment 5 Ladislav Smola 2016-05-13 10:19:58 EDT
after fixing, there are still 2 errors in log

https://github.com/ManageIQ/manageiq/issues/8685
https://github.com/ManageIQ/manageiq/issues/8687
Comment 7 CFME Bot 2016-05-24 23:30:24 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b4ad821a54cf332b3ba05518e723b205cf2e0b28

commit b4ad821a54cf332b3ba05518e723b205cf2e0b28
Author:     Ladislav Smola <lsmola@redhat.com>
AuthorDate: Fri May 13 16:16:00 2016 +0200
Commit:     Ladislav Smola <lsmola@redhat.com>
CommitDate: Fri May 20 15:30:55 2016 +0200

    Fix unknown attribute 'type' for Network
    
    Fix unknown attribute 'type' for Network, Network model doesn't
    have an type attribute, we should not fill it.
    
    Fixes BZ:
    https://bugzilla.redhat.com/show_bug.cgi?id=1302160

 gems/pending/metadata/linux/LinuxOSInfo.rb | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
Comment 8 Ronnie Rasouli 2016-06-09 04:26:12 EDT
 grep ActiveRecord::UnknownAttributeError evm.log is empty 

verified on 5.6.0.10
Comment 10 errata-xmlrpc 2016-06-29 11:33:39 EDT
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/RHBA-2016:1348

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