Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-24805 NoMethodError undefined method `take_while' for nil:NilClass when running inventory sync
  3. SAT-25197

[DEV] NoMethodError undefined method `take_while' for nil:NilClass when running inventory sync

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • RH Cloud
    • Sprint 133, Sprint 134, Sprint 135, Sprint 136, Sprint 137, Sprint 138, Sprint 139, Sprint 140, Sprint 141

      Description of problem:

      InventorySync::Async::InventoryScheduledSync

      fails with

      Error:

      NoMethodError

      undefined method `take_while' for nil:NilClass

      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:71:in
        `to_ip_address_string'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:64:in
        `to_missing_host_record'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:31:in
        `block in create_missing_hosts'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:31:in
        `map'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:31:in
        `create_missing_hosts'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in
        `block in run_callbacks'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:24:in
        `create_facets'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in
        `block in run_callbacks'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:137:in
        `run_callbacks'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/query_inventory_job.rb:38:in
        `block (3 levels) in try_execute'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/query_inventory_job.rb:33:in
        `loop'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/query_inventory_job.rb:33:in
        `block (2 levels) in try_execute'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/relation/delegation.rb:88:in
        `each'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/relation/delegation.rb:88:in
        `each'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/query_inventory_job.rb:24:in
        `block in try_execute'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:117:in
        `block in run_callbacks'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_full_sync.rb:21:in
        `block in setup_statuses'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/connection_adapters/abstract/database_statements.rb:318:in
        `transaction'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/transactions.rb:209:in
        `transaction'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_full_sync.rb:19:in
        `setup_statuses'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in
        `block in run_callbacks'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:18:in
        `block in setup_facet_transaction'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in
        `block in transaction'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/connection_adapters/abstract/transaction.rb:319:in
        `block in within_new_transaction'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in
        `block (2 levels) in synchronize'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
        `handle_interrupt'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
        `block in synchronize'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
        `handle_interrupt'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
        `synchronize'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/connection_adapters/abstract/transaction.rb:317:in
        `within_new_transaction'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in
        `transaction'"
      • "/usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/transactions.rb:209:in
        `transaction'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/inventory_hosts_sync.rb:17:in
        `setup_facet_transaction'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in
        `block in run_callbacks'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:137:in
        `run_callbacks'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/inventory_sync/async/query_inventory_job.rb:23:in
        `try_execute'"
      • "/usr/share/gems/gems/foreman_rh_cloud-8.0.51/lib/foreman_rh_cloud/async/exponential_backoff.rb:37:in
        `poll_external_task'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action/polling.rb:100:in `poll_external_task_with_rescue'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action/polling.rb:22:in `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:588:in `block (3 levels)
        in execute_run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/rails_executor_wrap.rb:14:in
        `block in run'"
      • "/usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/execution_wrapper.rb:91:in
        `wrap'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/rails_executor_wrap.rb:13:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action/progress.rb:31:in `with_progress_calculation'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action/progress.rb:17:in `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/load_setting_values.rb:20:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_request_id.rb:15:in
        `block in run'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_request_id.rb:52:in
        `restore_current_request_id'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_request_id.rb:15:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_timezone.rb:15:in
        `block in run'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_timezone.rb:44:in
        `restore_curent_timezone'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_timezone.rb:15:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_taxonomies.rb:15:in
        `block in run'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_taxonomies.rb:45:in
        `restore_current_taxonomies'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_taxonomies.rb:15:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:32:in `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:27:in `pass'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware.rb:19:in `pass'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_user.rb:15:in
        `block in run'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_user.rb:54:in
        `restore_curent_user'"
      • "/usr/share/gems/gems/foreman-tasks-8.1.4/app/lib/actions/middleware/keep_current_user.rb:15:in
        `run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/stack.rb:23:in `call'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/middleware/world.rb:31:in `execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:587:in `block (2 levels)
        in execute_run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:586:in `catch'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:586:in `block in execute_run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:489:in `block in with_error_handling'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:489:in `catch'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:489:in `with_error_handling'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:581:in `execute_run'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/action.rb:302:in `execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:18:in
        `block (2 levels) in execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/execution_plan/steps/abstract.rb:167:in
        `with_meta_calculation'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:17:in
        `block in execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:32:in
        `open_action'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:16:in
        `execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/director.rb:94:in `execute'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors/sidekiq/worker_jobs.rb:11:in
        `block (2 levels) in perform'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors.rb:18:in `run_user_code'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors/sidekiq/worker_jobs.rb:9:in
        `block in perform'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors/sidekiq/worker_jobs.rb:25:in
        `with_telemetry'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors/sidekiq/worker_jobs.rb:8:in
        `perform'"
      • "/usr/share/gems/gems/dynflow-1.7.0/lib/dynflow/executors/sidekiq/serialization.rb:27:in
        `perform'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:202:in `execute_job'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:170:in `block (2 levels)
        in process'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:172:in `invoke'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:169:in `block in process'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:136:in `block (6 levels)
        in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:113:in `local'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:135:in `block (5 levels)
        in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq.rb:44:in `block in <module:Sidekiq>'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:131:in `block (4 levels)
        in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:263:in `stats'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:126:in `block (3 levels)
        in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:13:in `call'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:125:in `block (2 levels)
        in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:80:in `global'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:124:in `block in dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:39:in `prepare'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:123:in `dispatch'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:168:in `process'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:78:in `process_one'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:68:in `run'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:8:in `watchdog'"
      • "/usr/share/gems/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:17:in `block in safe_thread'"
      • "/usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block
        in create_with_logging_context'"

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

      6.13.5

      How reproducible:

      100%

      Steps to Reproduce:
      1. have IP address info missing on host
      2. execute insights inventory sync

      Actual results:

      Job fails

      Expected results:

      Job succeedes even with empty values

      Additional info:

      DEV Tracker for https://issues.redhat.com/browse/SAT-24805
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2277312

              rhn-support-chrobert Chris Roberts
              satellite-focaccia-bot Focaccia Bot
              Shimon Shtein Shimon Shtein
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: