Project

General

Profile

Bug #15683

Error rendering info message in migration due to missed escaping

Added by Ivan Necas over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Upgrades
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

 foreman-installer --scenario katello --upgrade
 Upgrading...
 ...
 Upgrade Step: migrate_pulp...
 3772

 /usr/share/ruby/erb.rb:849:in `eval': (erb):45: syntax error, unexpected tGVAR, expecting ')' (SyntaxError)
   {'$set': {constants.PULP_USER_METADATA_FIELDNAME: {}}}, multi=True)
         ^
 (erb):81: syntax error, unexpected tGVAR, expecting ')'
 ... collection.update({}, {'$unset': {'owner_type': "", 'owner_...
 ...                               ^
 (erb):81: syntax error, unexpected tIDENTIFIER, expecting ')'
 ...ate({}, {'$unset': {'owner_type': "", 'owner_id': ''}}, mult...
 ...                               ^
 (erb):81: syntax error, unexpected tIDENTIFIER, expecting ')'
 ...': {'owner_type': "", 'owner_id': ''}}, multi=True)
 ...                               ^
 (erb):162: syntax error, unexpected tGVAR, expecting ')'
 ...{"translated_name": ""}, {'$set': {'translated_name': {}}}, ...
 ...                               ^
 (erb):162: syntax error, unexpected tIDENTIFIER, expecting ')'
 ...""}, {'$set': {'translated_name': {}}}, multi=True)
 ...                               ^
 (erb):203: syntax error, unexpected ')', expecting end-of-input
 ', :yellow) ).to_s); _erbout.force_encoding(__ENCODING__)
                    ^
     from /usr/share/ruby/erb.rb:849:in `result'
     from /usr/share/gems/gems/highline-1.6.21/lib/highline.rb:719:in `format_statement'
     from /usr/share/gems/gems/highline-1.6.21/lib/highline.rb:617:in `say'
     from /usr/share/katello-installer-base/hooks/boot/01-helpers.rb:19:in `log_and_say'
     from /usr/share/katello-installer-base/hooks/boot/01-helpers.rb:35:in `block in execute'
     from /usr/share/katello-installer-base/hooks/boot/01-helpers.rb:31:in `each'
     from /usr/share/katello-installer-base/hooks/boot/01-helpers.rb:31:in `execute'
     from /usr/share/katello-installer-base/hooks/pre/30-upgrade.rb:41:in `migrate_pulp'
     from /usr/share/katello-installer-base/hooks/pre/30-upgrade.rb:81:in `upgrade_step'
     from /usr/share/katello-installer-base/hooks/pre/30-upgrade.rb:101:in `block (4 levels) in load'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hooking.rb:34:in `instance_eval'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hooking.rb:34:in `block (4 levels) in load'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hook_context.rb:13:in `instance_exec'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hook_context.rb:13:in `execute'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hooking.rb:51:in `block in execute'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hooking.rb:49:in `each'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/hooking.rb:49:in `execute'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/kafo_configure.rb:377:in `run_installation'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/kafo_configure.rb:143:in `execute'
     from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
     from /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
     from /usr/share/gems/gems/kafo-0.7.5/lib/kafo/kafo_configure.rb:150:in `run'
     from /usr/sbin/satellite-installer:12:in `<main>'

 
The issues seems to be due to fact, that we user erb to show the
messages to the user:

 say "<%= color('#{message}', :#{style}) %>" 
 
The issue appear when the message contains (').

Associated revisions

Revision 70e6cf78 (diff)
Added by Ivan Necas over 2 years ago

Fixes #15683 - escape output before printing to user (#374)

History

#1 Updated by Ivan Necas over 2 years ago

  • Subject changed from Error rendering info message in migration due to missed escaping to Error rendering info message in migration due to missed escaping
  • Status changed from New to Assigned

#2 Updated by The Foreman Bot over 2 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/katello-installer/pull/374 added

#3 Updated by Ivan Necas over 2 years ago

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

#4 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) set to 171

#5 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) changed from 171 to 162

Also available in: Atom PDF