Bug 1332596 - 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"
Summary: Publishing or Promoting a Puppet Content View fails with "Validation failed: ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Smart Variables
Version: 6.1.8
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 14:34 UTC by anerurka
Modified: 2019-10-10 12:02 UTC (History)
4 users (show)

Fixed In Version: foreman-1.11.0.53-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-14 21:00:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15814 0 Normal Closed Updating a puppet class fails with "Validation failed: Merge overrides can only be set for array or hash, Avoid duplicat... 2020-12-18 15:48:40 UTC
Red Hat Product Errata RHBA-2016:1885 0 normal SHIPPED_LIVE Satellite 6.2.2 bug fix update 2016-09-15 00:57:56 UTC

Description anerurka 2016-05-03 14:34:21 UTC
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  ).

Comment 3 Brad Buckingham 2016-07-24 16:10:14 UTC
Created redmine issue http://projects.theforeman.org/issues/15814 from this bug

Comment 4 Bryan Kearney 2016-07-24 18:15:14 UTC
Upstream bug component is WebUI

Comment 5 Bryan Kearney 2016-08-16 18:15:07 UTC
Upstream bug component is Provisioning

Comment 6 Bryan Kearney 2016-08-16 20:15:05 UTC
Upstream bug component is Smart Variables

Comment 7 Bryan Kearney 2016-08-24 08:15:25 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15814 has been closed

Comment 8 jcallaha 2016-09-09 18:04:24 UTC
Verified in Satellite 6.2.2 Snap 1.1

Performed the steps outlined on three content views with three separate puppet modules. No errors encountered.

Comment 10 errata-xmlrpc 2016-09-14 21:00:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1885


Note You need to log in before you can comment on or make changes to this bug.