Project

General

Profile

Bug #14769

UI - show.html.erb error on accessing compute resource details on RHEL6.7

Added by Stephen Benjamin almost 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugins-Engines
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1328878
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:

Associated revisions

Revision d46b64a2 (diff)
Added by Marek Hulán almost 4 years ago

Fixes #14769 - avoid template comments because of deface

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).

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.

Revision da9efe51 (diff)
Added by Marek Hulán almost 4 years ago

Fixes #14769 - avoid template comments because of deface

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).

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.

(cherry picked from commit d46b64a2e8debb5298bf58f1941ef3204e401735)

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-docker/pull/161 added

#2 Updated by Dominic Cleal almost 4 years ago

  • Project changed from Foreman to Docker
  • Category deleted (Compute resources)
  • Assignee changed from Marek Hulán to Stephen Benjamin

#3 Updated by The Foreman Bot almost 4 years ago

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

#4 Updated by Marek Hulán almost 4 years ago

  • Project changed from Docker to Foreman
  • Category set to Plugins-Engines
  • Assignee changed from Stephen Benjamin to Marek Hulán
  • Pull request deleted (https://github.com/theforeman/foreman-docker/pull/161)

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). 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.

#5 Updated by Marek Hulán almost 4 years ago

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

#6 Updated by Marek Hulán almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 155

present since 1.8, should be safe to backport to 1.11 so foreman_docker can be run on el6 with latest stable, feel free to reset

Also available in: Atom PDF