Project

General

Profile

Actions

Bug #5687

closed

Save error when updating host/group params with array/json parameters

Added by Ollie Lawson over 10 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When updating parameters, if there is an "array" param that has successfully validated when updating other parameters I get the error:

Warning!

Validation failed: Value is invalid array

I think this is because Foreman is escaping the JSON in the array again (double escape) which makes it invalid.

See attached screenshot for example.

Stack trace is:
ActiveRecord::RecordInvalid
Validation failed: Value is invalid array
app/models/concerns/host_common.rb:34:in `block in lookup_values_attributes='
app/models/concerns/host_common.rb:27:in `each_value'
app/models/concerns/host_common.rb:27:in `lookup_values_attributes='
app/controllers/hosts_controller.rb:112:in `block in update'
app/models/taxonomy.rb:49:in `block in no_taxonomy_scope'
app/models/taxonomy.rb:56:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:143:in `as_location'
app/models/taxonomy.rb:55:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:108:in `as_org'
app/models/taxonomy.rb:54:in `as_taxonomy'
app/models/taxonomy.rb:48:in `no_taxonomy_scope'
app/controllers/hosts_controller.rb:104:in `update'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'!!


Files

Capture_1.PNG View Capture_1.PNG 17 KB Ollie Lawson, 05/13/2014 10:57 AM
Actions #1

Updated by Ollie Lawson over 10 years ago

My bad, screenshot attached this time

Actions #2

Updated by Dominic Cleal over 10 years ago

  • Status changed from New to Feedback

I think this is bug #4639, as the screenshot shows a Ruby style hash (with => separators rather than : for JSON) when you're editing it.

Please try Foreman 1.4.4 which contains the fix: http://theforeman.org/manuals/1.4/index.html#Releasenotesfor1.4.4

Actions #3

Updated by Ollie Lawson over 10 years ago

Thanks Dominic, I'll update my version now and check.

Actions #4

Updated by Anonymous over 7 years ago

  • Status changed from Feedback to Resolved

no reaction, closing

Actions

Also available in: Atom PDF