Red Hat Bugzilla – Bug 1195212
Unable to edit host_grp, host, puppet-classes upon creating an oscap policy
Last modified: 2017-02-23 15:27:21 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:
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.
I can verify it's the policies_enc json causing the problem
Seems there is an open issue on upstream for lookup_keys with the same issue: http://projects.theforeman.org/issues/7764
The solution is to update json gem. I will be creating a json package for foreman, we should pull json gem from upstream package.
(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
Jason, Can you cherry-pick https://github.com/theforeman/foreman/commit/8dcb01a429e88a12edd605672e6f4340de7ca977 for the next release of Sat6.1? This solves the issue. Thanks.
Connecting redmine issue http://projects.theforeman.org/issues/7764 from this bug
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.
Upstream bug assigned to szadok@redhat.com
This bug is slated to be released with Satellite 6.1.
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