Error with AWS provider

Hi,
I cant understand why i got this error during the last refresh :

undefined method `include?’ for nil:NilClass

I have 4 account with AWS on the same ManageIQ and they are only one who don’t have this issue.
ManageIQ : Ivanchuk-5
Any idea ?
Thanks
Bruno

Maybe if you tell us which of the 750 calls to the include?-method you are talking about?

$ grep 'include?' -R manageiq-providers-amazon/ manageiq/ | wc -l
749

Hi, sorry i have only this info like i wrote
image

There should be at least a stack trace in the logs:

# AWS Provider Log
/var/www/miq/vmdb/log/aws.log

# The general log files evm.log and production.log might have some hints too, though I doubt it if it is an provider issue

You said that one of the 4 accounts works and 3 do not.

  • Are these fresh accounts, you are setting up for ManageIQ specifically? Or did they exist earlier and you are just connecting ManageIQ to them?
  • Are these Accounts supposed to be configured the same? Or were they managed separately?
  • Did the refresh work in the past?


Sorry that you got the rude answer.
But “undefined method for NilClass” errors are basically impossible to debug with just the error message alone.

Hi, thanks
i can say it’s strange sometime all is ok and sometime i got this error
Yes they are managed separately it’s not the same customer but this morning all was fine and after some time i got again this error
i ll try to catch all error in aws or other .log
Thanks

Hello,
Sorry to come back but after some days i v still the same issues sometime the collect pass but sometime not in evm.log i saw this error but i don’t understand where is the issues if someone can help :slight_smile:

[----] I, [2020-07-02T08:52:58.281400 #2094:9125f8]  INFO -- : Exception in realtime_block :ems_refresh - Timings: {:collect_inventory_for_targets=>0.09415650367736816, :parse_targeted_inventory=>0.017689943313598633, :ems_refresh=>0.11212873458862305}
[----] E, [2020-07-02T08:52:58.281818 #2094:9125f8] ERROR -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) EMS: [fbf449c4-775d-4e77-8991-f78b1f571486], id: [9] Refresh failed
[----] E, [2020-07-02T08:52:58.282099 #2094:9125f8] ERROR -- : [NoMethodError]: undefined method `include?' for nil:NilClass  Method:[block (2 levels) in <class:LogProxy>]
[----] E, [2020-07-02T08:52:58.282196 #2094:9125f8] ERROR -- : /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-providers-amazon-8ac0dc3f8054/app/models/manageiq/providers/amazon/inventory/parser/cloud_manager.rb:327:in `block in flavors'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-providers-amazon-8ac0dc3f8054/app/models/manageiq/providers/amazon/inventory/parser/cloud_manager.rb:319:in `each'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-providers-amazon-8ac0dc3f8054/app/models/manageiq/providers/amazon/inventory/parser/cloud_manager.rb:319:in `flavors'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-providers-amazon-8ac0dc3f8054/app/models/manageiq/providers/amazon/inventory/parser/cloud_manager.rb:9:in `parse'
/var/www/miq/vmdb/app/models/manageiq/providers/inventory.rb:42:in `block in parse'
/var/www/miq/vmdb/app/models/manageiq/providers/inventory.rb:39:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/inventory.rb:39:in `parse'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:141:in `parse_targeted_inventory'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:92:in `block in refresh_targets_for_ems'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-gems-pending-e280ad44830f/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-gems-pending-e280ad44830f/lib/gems/pending/util/extensions/miq-benchmark.rb:28:in `realtime_block'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:91:in `refresh_targets_for_ems'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:41:in `block (2 levels) in refresh'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-gems-pending-e280ad44830f/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-gems-pending-e280ad44830f/lib/gems/pending/util/extensions/miq-benchmark.rb:35:in `realtime_block'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:41:in `block in refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:31:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:31:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:11:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:103:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:102:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:102:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:479:in `block in dispatch_method'
/usr/local/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
/usr/local/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
/usr/local/lib/ruby/2.5.0/timeout.rb:33:in `catch'
/usr/local/lib/ruby/2.5.0/timeout.rb:33:in `catch'
/usr/local/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:477:in `dispatch_method'
/var/www/miq/vmdb/app/models/miq_queue.rb:454:in `block in deliver'
/var/www/miq/vmdb/app/models/user.rb:290:in `with_user_group'
/var/www/miq/vmdb/app/models/miq_queue.rb:454:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:104:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:137:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:155:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:149:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:149:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:329:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:326:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:326: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:127:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:22:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:398:in `block in start_runner_via_fork'
/usr/local/lib/ruby/gems/2.5.0/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
/usr/local/lib/ruby/gems/2.5.0/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:396:in `start_runner_via_fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:386:in `start_runner'
/var/www/miq/vmdb/app/models/miq_worker.rb:437:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:269:in `start_worker'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:74:in `start_worker_for_ems'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:52:in `block in sync_workers'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:51:in `each'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:51:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:54: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:156:in `start'
/var/www/miq/vmdb/app/models/miq_server.rb:247:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:27:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:48:in `start'
/var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'
[----] E, [2020-07-02T08:52:58.282304 #2094:9125f8] ERROR -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) EMS: [fbf449c4-775d-4e77-8991-f78b1f571486], id: [9] Unable to perform refresh for the following targets:
[----] E, [2020-07-02T08:52:58.282402 #2094:9125f8] ERROR -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh)  --- ManageIQ::Providers::Amazon::CloudManager [fbf449c4-775d-4e77-8991-f78b1f571486] id [9]
[----] I, [2020-07-02T08:52:58.299481 #2094:9125f8]  INFO -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) Refreshing all targets...Complete
[----] E, [2020-07-02T08:52:58.299750 #2094:9125f8] ERROR -- : MIQ(MiqQueue#deliver) Message id: [483719], Error: [undefined method `include?' for nil:NilClass]
[----] E, [2020-07-02T08:52:58.299973 #2094:9125f8] ERROR -- : [ManageIQ::Providers::BaseManager::Refresher::PartialRefreshError]: undefined method `include?' for nil:NilClass  Method:[block (2 levels) in <class:LogProxy>]
[----] E, [2020-07-02T08:52:58.300179 #2094:9125f8] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:67:in `refresh'

Thanks
Bruno

This looks like a legit bug. Can you open a bug report here, please - https://github.com/ManageIQ/manageiq-providers-amazon ? cc @agrare

So we don’t collect flavors from amazon, they’re seeded from db/fixtures/aws_instance_types.yml and merged with user added instance types from advanced settings.

Can you post the contents of that file and if you made any modifications or added additional flavors to the additional_instance_types config section? That backtrace indicates that one of the flavors is missing its architecture section.

Thanks
my aws_instance_type.yml and my add section filesbru_add_type.txt (10.3 KB)
bru_aws_instance_type.ym (151.2 KB)

Thanks again

Thanks, yeah so if you look at your additional instance types:

:c5d.12xlarge:
  :virtualization_type:
  - :hvm
  :vpc_only: false

That flavor doesn’t have any architecture section which is why this is failing for you. We should be treating user provided data a little more carefully but you can resolve this by proving all of the data that is required of a flavor

Hi,
thanks i v tryed to delete this type by the Advanced menu but they come back even after a save they are a rule to edit this file ! ?
Bruno