Bug 1328878 - UI - show.html.erb error on accessing compute resource details on RHEL6.7
Summary: UI - show.html.erb error on accessing compute resource details on RHEL6.7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Roman Plevka
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 13:12 UTC by Roman Plevka
Modified: 2019-09-26 16:21 UTC (History)
3 users (show)

Fixed In Version: foreman-1.11.0.17-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 10:59:13 UTC
Target Upstream Version:


Attachments (Terms of Use)
CR error (134.33 KB, image/png)
2016-04-20 13:13 UTC, Roman Plevka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14769 0 None None None 2016-04-22 19:04:58 UTC

Description Roman Plevka 2016-04-20 13:12:37 UTC
Description of problem:
There is an error regarding compute_resources/show.html.erb:27

There is no way of displaying/updating a compute resource via UI due to this bug

Occurs only on RHEL6


Version-Release number of selected component (if applicable):
sat 6.2.0 snap 8.2 RHEL6.7

How reproducible:
always

Steps to Reproduce:
1. create any CR using webui
2. recieve the error (happens on accessing CR details)

Actual results:
ISE 500

Expected results:
200 - CR details are displayed

Additional info:

Comment 1 Roman Plevka 2016-04-20 13:13:37 UTC
Created attachment 1149093 [details]
CR error

Comment 4 Marek Hulan 2016-04-21 13:07:03 UTC
It's one of foreman_docker override that breaks this page, it adds <%= a unless b %>, statement modifiers do not work in loud erb tags

Comment 5 Marek Hulan 2016-04-21 14:33:04 UTC
It seems more complicated, as a workaround either uninstall foreman_docker or comment second definition in /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.4/app/overrides/remove_docker_from_compute_profiles.rb

Comment 6 Stephen Benjamin 2016-04-21 20:38:11 UTC
Created redmine issue http://projects.theforeman.org/issues/14769 from this bug

Comment 7 Bryan Kearney 2016-04-22 08:13:59 UTC
Upstream bug assigned to stbenjam

Comment 8 Bryan Kearney 2016-04-22 08:14:01 UTC
Upstream bug component is Container Management

Comment 9 Bryan Kearney 2016-04-22 10:13:12 UTC
Upstream bug assigned to mhulan

Comment 10 Bryan Kearney 2016-04-22 10:13:14 UTC
Upstream bug component is Provisioning

Comment 11 Bryan Kearney 2016-04-22 12:13:44 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14769 has been closed
-------------
Marek Hulán
TL;DR: EL6 contains old libxml2/libxslt which can cause problems when using deface on a template that contains comment like <% #this %>

Longer version:
After many hours spent on debugging I realized that the issue is that when action view compiles the template, some lines are concatenated together just split by ";". This becomes problem when ERB tag contained commentary symbol #. The reason is that when deface override is applied it first converts the template to tree using Nokogiri (see "Parser.convert":https://github.com/DefaceCommunity/deface/blob/master/lib/deface/parser.rb#L106). This returns different results on different versions of underlying library. I didn't try to compile different versions but with libxml2-2.7.6-20.el6.x86_64 and libxslt-1.1.26-2.el6_3.1.x86_64 it does not wrap the silent erb tag with "\n" so as a result, this tag ends up on the same line as previous one. The same nokogiri but on newer lib versions (libxml2-2.9.1-5.el7_1.2.x86_64, libxslt-1.1.28-5.el7.x86_64) wrapped it.

I know that right solution would be to update libraries in EL6 or ship it ourselves but this seems much more complicated process than just removing the comment line which does not have a big value anyway. It seems to be only comment in our templates.

If we agree on this as a solution it's a fix in core, so moving back to Foreman.

-------------
Marek Hulán
Applied in changeset commit:d46b64a2e8debb5298bf58f1941ef3204e401735.

Comment 13 Roman Plevka 2016-04-24 08:56:19 UTC
VERIFIED
on sat 6.2.0 snap 9.2

- the page now loads without errors on rhel 6.7.

Comment 14 Bryan Kearney 2016-07-27 10:59:13 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:1501


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