Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1195212 - Unable to edit host_grp, host, puppet-classes upon creating an oscap policy
Unable to edit host_grp, host, puppet-classes upon creating an oscap policy
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI (Show other bugs)
6.1.0
Unspecified Unspecified
high Severity high (vote)
: Unspecified
: Unused
Assigned To: Shlomi Zadok
Kedar Bidarkar
http://projects.theforeman.org/issues...
:
Depends On:
Blocks: 1047797
  Show dependency treegraph
 
Reported: 2015-02-23 06:51 EST by Kedar Bidarkar
Modified: 2017-02-23 15:27 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:26:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 7764 None None None 2016-04-22 11:56 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Kedar Bidarkar 2015-02-23 06:51:59 EST
Description of problem:

Unable to edit host_grp, host, puppet-classes upon creating an oscap policy

Processing by HostgroupsController#edit as HTML
  Parameters: {"id"=>"5-rhel66_grp"}
  Rendered puppetclasses/_selectedClasses.html.erb (4.5ms)
  Rendered puppetclasses/_classes_in_groups.html.erb (0.0ms)
  Rendered puppetclasses/_classes.html.erb (7.2ms)
  Rendered puppetclasses/_class_selection.html.erb (43.5ms)
  Rendered common/_domain.html.erb (218.5ms)
  Rendered common/_domain_subnet.html.erb (225.7ms)
  Rendered common/os_selection/_architecture.html.erb (4.5ms)
  Rendered common/os_selection/_operatingsystem.html.erb (26.0ms)
  Rendered common/os_selection/_initial.html.erb (34.0ms)
  Rendered puppetclasses/_class_parameters.html.erb (15.7ms)
  Rendered puppetclasses/_classes_parameters.html.erb (27.3ms)
  Rendered hostgroups/_form.html.erb (384.4ms)
  Rendered hostgroups/edit.html.erb within layouts/application (384.8ms)
Operation FAILED: only generation of JSON objects or arrays allowed
  Rendered common/500.html.erb within layouts/application (8.8ms)
  Rendered layouts/base.html.erb (1.5ms)
Completed 500 Internal Server Error in 454ms (Views: 15.1ms | ActiveRecord: 16.6ms)


Processing by PuppetclassesController#edit as HTML
  Parameters: {"id"=>"5-foreman_scap_client"}
  Rendered common/_edit_habtm.html.erb (7.1ms)
  Rendered lookup_keys/_value.html.erb (215.0ms)
  Rendered lookup_keys/_fields.html.erb (254.4ms)
  Rendered lookup_keys/_value.html.erb (9.1ms)
  Rendered lookup_keys/_fields.html.erb (66.0ms)
Client connected.
Connected to server.
  Rendered lookup_keys/_value.html.erb (6.2ms)
  Rendered lookup_keys/_fields.html.erb (251.6ms)
  Rendered lookup_keys/_fields.html.erb (21.3ms)
  Rendered puppetclasses/_form.html.erb (649.1ms)
  Rendered puppetclasses/edit.html.erb within layouts/application (649.6ms)
Operation FAILED: only generation of JSON objects or arrays allowed
  Rendered common/500.html.erb within layouts/application (6.6ms)
  Rendered layouts/base.html.erb (1.3ms)
Completed 500 Internal Server Error in 684ms (Views: 10.4ms | ActiveRecord: 9.1ms)


Version-Release number of selected component (if applicable):
sat6.1 beta snap3

How reproducible:
upon creating an oscap policy

Steps to Reproduce:
1. create puppet_Repo, sync, puppet_cv , publish promote
2. make sure puppet-classes is visible
3. create a hostgroup, till this stage we would be able to edit the entities created in step 2) and 3).
4. Now create an oscap policy, after the policy is created the existing hostgroups and puppet-classes can no longer be edited.

Actual results:
unable to edit host-groups, foreman_scap_client or hosts 

We get the below message:
Operation FAILED: only generation of JSON objects or arrays allowed.

It appears that all entities for which foreman_scap_client puppet-class is associated cannot be edited.

Expected results:
editing of hostgroup and puppet-classes should be possible even after oscap policy creation.

Additional info:
Comment 1 Shlomi Zadok 2015-02-23 09:30:34 EST
May be related to https://github.com/sstephenson/execjs/pull/130
and we may need to downgrade our execjs gem or to refactor the policies_enc method.
Comment 2 Shlomi Zadok 2015-02-23 10:01:30 EST
I can verify it's the policies_enc json causing the problem
Comment 4 Shlomi Zadok 2015-02-24 03:22:04 EST
Seems there is an open issue on upstream for lookup_keys with the same issue:
http://projects.theforeman.org/issues/7764
Comment 5 Shlomi Zadok 2015-02-24 06:55:27 EST
The solution is to update json gem. 
I will be creating a json package for foreman, we should pull json gem from upstream package.
Comment 6 Shlomi Zadok 2015-02-24 08:04:54 EST
(In reply to Shlomi Zadok from comment #5)
> The solution is to update json gem. 
> I will be creating a json package for foreman, we should pull json gem from
> upstream package.

https://github.com/theforeman/foreman/pull/2195
No json package atm
Comment 7 Shlomi Zadok 2015-02-26 07:36:25 EST
Jason,
Can you cherry-pick https://github.com/theforeman/foreman/commit/8dcb01a429e88a12edd605672e6f4340de7ca977 for the next release of Sat6.1? This solves the issue.
Thanks.
Comment 8 Bryan Kearney 2015-03-01 17:34:17 EST
Connecting redmine issue http://projects.theforeman.org/issues/7764 from this bug
Comment 11 Kedar Bidarkar 2015-03-09 05:22:34 EDT
It's now VERIFIED with sat6.1 Beta snap5

Upon creating an OSCAP policy we no longer have editing issues with the above said entities.
Comment 12 Steve Loranz 2015-03-11 18:14:06 EDT
Upstream bug assigned to szadok@redhat.com
Comment 13 Bryan Kearney 2015-08-11 09:21:18 EDT
This bug is slated to be released with Satellite 6.1.
Comment 14 errata-xmlrpc 2015-08-12 01:26:58 EDT
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/RHSA-2015:1592

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