Project

General

Profile

Actions

Bug #15814

closed

Updating a puppet class fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true"

Added by Brad Buckingham over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1332596
Description of problem:

Publishing or Promoting a Puppet Content View fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true"
Version-Release number of selected component (if applicable):
Satellite Server v.6.1.8
How reproducible:
Steps to Reproduce:
- Add any Puppet Module ex motd in Satellite
- Create a content view with this Puppet module
- Publish a new version of this content view
- Go to Configure - Puppet Classes, click on motd
- Click on Smart Class Parameters - content
- Click on Override, change the Parameter type to array, change the Default value to [], click on Merge overrides and Avoid duplicates, click the Submit button (note that this doesn't make sense for this particular module and parameter, but it may for other Puppet modules, and I was looking for an easy reproducer)
- Publish a new version of the content view created before
- Go back to Configure - Puppet Classes, click on motd
- Click on Smart Class Parameters - content
- Click on Override to clear it and click the Submit button
- Publish a new version of the content view created before
Actual results:
Fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true"
Expected results:
Content View should be Promoted or Published Successfully
Additional info:
Root cause  : 
When we cleared the override flag and saves a smart parameter, the merge_overrides and avoid_duplicates flags have to be cleared automatically however it is not and hence `override: false`,  but `merge_overrides: true` in db and hence next content-view publish failed.
Workaround :
Can be fixed this by activating "ovreride" in the UI, clearing both merge_overrides and avoid_duplicates, saving the smart parameter, editing it again, clearing "override" and saving it again.
But Need to determine the puppet classes ( Configure --> puppet class --> smart class parameter ) where this changes in past ( enabled the override flag and change the type equals to array/hash and enabled merge_overrides and later unchecked the override flag  ).

Related issues 1 (1 open0 closed)

Blocks Katello - Tracker #15825: Sprint 1 : Content-FocusedNewBrad Buckingham07/24/2016

Actions
Actions #1

Updated by Brad Buckingham over 7 years ago

Actions #2

Updated by Justin Sherrill over 7 years ago

  • Subject changed from Publishing or Promoting a Puppet Content View fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true" to Publishing or Promoting a Puppet Content View fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true"
  • translation missing: en.field_release set to 162
Actions #3

Updated by David Davis over 7 years ago

  • Is duplicate of deleted (Tracker #15825: Sprint 1 : Content-Focused)
Actions #4

Updated by David Davis over 7 years ago

Actions #5

Updated by David Davis over 7 years ago

  • Project changed from Katello to Foreman
  • Subject changed from Publishing or Promoting a Puppet Content View fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true" to Updating a puppet class fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicates can only be set for arrays that have merge_overrides set to true"
  • Category deleted (Web UI)

I'm not really sure what the solution is but I was able to reproduce this behavior in just Foreman with the following steps:

1. Create a puppet environment with the motd puppet module.
2. Go the Puppet Class edit screen for motd. Then go into a smart class param like content and override it.
3. Change the type to array, set the default to [], and select the merge_overrides checkbox. Then submit.
4. Go back into the smart class param screen and uncheck the override checkbox. Submit again.
5. Go to the environments page. Click on Import from Default.
6. Select the box for "Update: motd" and click update.

You'll get a validation error, "Validation failed: Merge overrides can only be set for array or hash" (https://i.imgur.com/13PO0nF.png).

Some potential solutions:

1. Have the code reset override specific params like merge_overrides when override is set to false
2. Have the code skip validating override params like merge_overrides if override is false

Actions #6

Updated by David Davis over 7 years ago

  • Category set to Parameters
Actions #7

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3737 added
Actions #8

Updated by Brad Buckingham over 7 years ago

  • Target version set to 123
Actions #9

Updated by David Davis over 7 years ago

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

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release changed from 162 to 160
Actions #11

Updated by The Foreman Bot over 7 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3800 added
Actions

Also available in: Atom PDF