Project

General

Profile

Actions

Bug #12024

closed

NoMethodError: undefined method `first' for nil:NilClass

Added by Marek Hulán over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

After load balancing PR was merged, I'm getting NoMethodError when I run new job. After short debugging it seems that when Foreman can't reach the proxy it breaks the balancer instead of just skipping the proxy.

Setting this as release blocker.

The trace

2015-10-01T13:40:19 [foreman-tasks/action] [E] undefined method `first' for nil:NilClass (NoMethodError)
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/services/proxy_load_balancer.rb:12:in `next'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:48:in `block in determine_proxy'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:47:in `each'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:47:in `determine_proxy'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:26:in `block in create_sub_plans'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activerecord-3.2.21/lib/active_record/associations/collection_proxy.rb:91:in `map'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activerecord-3.2.21/lib/active_record/associations/collection_proxy.rb:91:in `method_missi
ng'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:24:in `create_sub_plans'
 | /home/ares/z/dynflow/lib/dynflow/action/with_sub_plans.rb:29:in `initiate'
 | /home/ares/z/dynflow/lib/dynflow/action/with_sub_plans.rb:16:in `block in run'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matchers/abstract.rb:74:in `block in assigns'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matchers/abstract.rb:73:in `tap'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matchers/abstract.rb:73:in `assigns'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matching.rb:56:in `match_value'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matching.rb:36:in `block in match?'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matching.rb:35:in `each'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matching.rb:35:in `match?'
 | /home/ares/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/algebrick-0.7.3/lib/algebrick/matching.rb:23:in `match'
 | /home/ares/z/dynflow/lib/dynflow/action/with_sub_plans.rb:11:in `run'
 | /home/ares/Projekty/Zdrojaky/foreman_remote_execution/app/lib/actions/remote_execution/run_hosts_job.rb:36:in `run'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:26:in `call'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /home/ares/z/dynflow/lib/dynflow/middleware.rb:16:in `pass'
 | /home/ares/z/dynflow/lib/dynflow/middleware.rb:29:in `run'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:22:in `call'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /home/ares/z/dynflow/lib/dynflow/middleware.rb:16:in `pass'
 | /home/ares/Projekty/Zdrojaky/foreman-tasks/app/lib/actions/middleware/keep_current_user.rb:30:in `block in run'
 | /home/ares/Projekty/Zdrojaky/foreman-tasks/app/lib/actions/middleware/keep_current_user.rb:53:in `restore_curent_user'
 | /home/ares/Projekty/Zdrojaky/foreman-tasks/app/lib/actions/middleware/keep_current_user.rb:30:in `run'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:22:in `call'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /home/ares/z/dynflow/lib/dynflow/middleware.rb:16:in `pass'
 | /home/ares/z/dynflow/lib/dynflow/action/progress.rb:30:in `with_progress_calculation'
 | /home/ares/z/dynflow/lib/dynflow/action/progress.rb:16:in `run'
 | /home/ares/z/dynflow/lib/dynflow/middleware/stack.rb:22:in `call'
 | /home/ares/z/dynflow/lib/dynflow/middleware/world.rb:30:in `execute'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:505:in `block (2 levels) in execute_run'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:504:in `catch'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:504:in `block in execute_run'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:419:in `call'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:419:in `block in with_error_handling'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:419:in `catch'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:419:in `with_error_handling'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:499:in `execute_run'
 | /home/ares/z/dynflow/lib/dynflow/action.rb:260:in `execute'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:9:in `block (2 levels) in execute'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract.rb:155:in `call'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract.rb:155:in `with_meta_calculation'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:8:in `block in execute'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:22:in `open_action'
 | /home/ares/z/dynflow/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:7:in `execute'


Related issues 2 (0 open2 closed)

Related to Foreman Remote Execution - Bug #11554: Remote Execution Proxy should be a more formal associationClosedStephen Benjamin08/25/2015Actions
Related to Foreman Remote Execution - Feature #11827: Load balance actions across multiple proxiesClosedStephen Benjamin09/15/2015Actions
Actions #1

Updated by Marek Hulán over 8 years ago

  • Related to Bug #11554: Remote Execution Proxy should be a more formal association added
Actions #2

Updated by Marek Hulán over 8 years ago

  • Related to Feature #11827: Load balance actions across multiple proxies added
Actions #3

Updated by Marek Hulán over 8 years ago

So it fails only if there's no proxy that can be used (which can cause old version of smart_proxy_dynflow).

Actions #4

Updated by The Foreman Bot over 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/50 added
  • Pull request deleted ()
Actions #5

Updated by Marek Hulán over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF