Project

General

Profile

Actions

Bug #11112

open

Matcher for unlisted attribute fails with "comparison of Array with Array failed"

Added by Juris Pavlyuchenkov almost 9 years ago. Updated over 8 years ago.

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

Description

If you have smart variable matcher for environment, add another matcher for FQDN, and try to edit host afterwards, it will fail with the following error:

ArgumentError
comparison of Array with Array failed
app/services/classification/base.rb:41:in `block in values_hash'
app/services/classification/base.rb:39:in `values_hash'
app/services/classification/base.rb:17:in `inherited_values'
app/views/puppetclasses/_class_parameters.html.erb:2:in `_6bd4e894887042c12c1c876d3bbd59b5'
app/views/puppetclasses/_classes_parameters.html.erb:12:in `_efecede07e99fec46c2aace6cca47e7e'
app/views/hosts/_form.html.erb:96:in `block (2 levels) in _d083b3a0d59e018a9d7bfcdea74457b4'
app/helpers/layout_helper.rb:273:in `form_for'
app/views/hosts/_form.html.erb:8:in `block in _d083b3a0d59e018a9d7bfcdea74457b4'
app/models/taxonomy.rb:61:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:147:in `as_location'
app/models/taxonomy.rb:60:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:112:in `as_org'
app/models/taxonomy.rb:59:in `as_taxonomy'
app/views/hosts/_form.html.erb:6:in `_d083b3a0d59e018a9d7bfcdea74457b4'
app/views/hosts/edit.html.erb:9:in `_ad432273d701fcf94b0032cbe38693a1'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Moreover, the following errors will appear in Puppet reports:

Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node test.node.local: Failed to find test.node.local via exec: Execution of '/etc/puppet/node.rb test.node.local' returned 1:

In my case, I have a Puppet class variable "deploy_keys" and a smart variable matcher: "environment = staging".
Later on, I add matcher "fqdn = test.node.local" and voila, errors start to appear.

Foreman version: 1.8.2


Files

Screenshot 2015-07-14 15.27.17.png View Screenshot 2015-07-14 15.27.17.png 121 KB Juris Pavlyuchenkov, 07/14/2015 08:28 AM
Screenshot 2015-07-14 15.28.01.png View Screenshot 2015-07-14 15.28.01.png 101 KB Juris Pavlyuchenkov, 07/14/2015 08:28 AM

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #8333: Incorrect matcher values with multi-key matchersClosedOri Rabin11/10/2014Actions
Actions #1

Updated by Dominic Cleal almost 9 years ago

  • Category set to Parameters
  • translation missing: en.field_release set to 62

Perhaps related to #8333, it changed the classification sorting.

Actions #2

Updated by Dominic Cleal almost 9 years ago

  • Related to Bug #8333: Incorrect matcher values with multi-key matchers added
Actions #3

Updated by Ori Rabin almost 9 years ago

  • Status changed from New to Need more information

Juris,
I wasn't able to reproduce.
I'm assuming because of the error that the parameter type is array.
Can you please add the values you gave for each matcher?
Are you using merge overrides?

Updated by Juris Pavlyuchenkov almost 9 years ago

Parameter type is set as string and I do not use merge overrides.

Please find the screenshots attached.

Actions #5

Updated by Dominic Cleal almost 9 years ago

  • Status changed from Need more information to New
Actions #6

Updated by Tomer Brisker over 8 years ago

Could not reproduce with 1.8.2.
Note that your "order" field doesn't contain environment at all.

Actions #7

Updated by Juris Pavlyuchenkov over 8 years ago

Tomer Brisker wrote:

Could not reproduce with 1.8.2.
Note that your "order" field doesn't contain environment at all.

Here it is! Added "environment" to "order" field and it works now. Thank you!

Actions #8

Updated by Dominic Cleal over 8 years ago

  • Subject changed from Multiple matchers fail with "comparison of Array with Array failed" to Matcher for unlisted attribute fails with "comparison of Array with Array failed"
  • translation missing: en.field_release deleted (62)

Thanks for confirming!

Actions

Also available in: Atom PDF