Project

General

Profile

Actions

Bug #19417

closed

keep_params throws error if params don't contain top level hash

Added by Tomer Brisker over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

This can be reproduced in discovery by trying to provision a host and selecting an architecture

 | NoMethodError (undefined method `has_key?' for nil:NilClass):
 |   app/controllers/concerns/foreman/controller/parameters/keep_param.rb:11:in `block in keep_param'
 |   app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `each'
 |   app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `inject'
 |   app/controllers/concerns/foreman/controller/parameters/keep_param.rb:10:in `keep_param'
 |   app/controllers/concerns/foreman/controller/parameters/host.rb:34:in `host_params'
 |   app/controllers/concerns/foreman/controller/host_details.rb:58:in `item_params'
 |   app/controllers/concerns/foreman/controller/host_details.rb:50:in `block in assign_parameter'
 |   app/models/taxonomy.rb:72:in `block (2 levels) in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:150:in `as_location'
 |   app/models/taxonomy.rb:71:in `block in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:115:in `as_org'
 |   app/models/taxonomy.rb:70:in `as_taxonomy'
 |   app/controllers/concerns/foreman/controller/host_details.rb:49:in `assign_parameter'
 |   app/controllers/concerns/foreman/controller/host_details.rb:8:in `architecture_selected'
 |   app/controllers/concerns/application_shared.rb:15:in `set_timezone'
 |   app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 |   lib/middleware/catch_json_parse_errors.rb:8:in `call'
 |   lib/middleware/tagged_logging.rb:18:in `call'
 | 


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #3917: Add strong_parameters to foremanClosedDominic Cleal12/19/2013Actions
Actions #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/4491 added
Actions #2

Updated by Dominic Cleal over 7 years ago

  • Category set to Rails
Actions #3

Updated by Anonymous over 7 years ago

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

Updated by Tomer Brisker over 7 years ago

  • Translation missing: en.field_release set to 209

Setting this to 1.15.0 since discovery (and possibly other plugins) would be broken otherwise.

Actions #5

Updated by Dominic Cleal over 7 years ago

This doesn't look like a regression, keep_param has always expected the top level hash ever since commit 1261280. Why is it any different in 1.15.0?

Actions #6

Updated by Tomer Brisker over 7 years ago

  • Related to Feature #3917: Add strong_parameters to foreman added
Actions #7

Updated by Tomer Brisker over 7 years ago

It's possible this has actually been broken for a while but hasn't been discovered yet due to lack of tests.

Actions #8

Updated by Dominic Cleal over 7 years ago

  • Translation missing: en.field_release deleted (209)

I'll unset the field then, and let a release manager set it to a future bug fix release then. It missed 1.15.0 and doesn't appear to be a regression in the current RCs.

Actions #9

Updated by Tomer Brisker over 7 years ago

Further digging led me to find #19436 which, which is what caused this issue to appear (sending discovered_host param to the hosts controller instead of the host controller). I agree this fix can wait for next release, the other one is a regression though.

Actions #10

Updated by Daniel Lobato Garcia over 7 years ago

  • Translation missing: en.field_release set to 276
Actions #11

Updated by Daniel Lobato Garcia over 7 years ago

Setting to 1.15.3 as Raboo on IRC comments this is blocking the discovery workflow in their installation

Actions

Also available in: Atom PDF