Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1549502

Summary: Upgrade from sat6.2 -> 6.3 failed at migrate_foreman: "can't modify frozen Array"
Product: Red Hat Satellite Reporter: Ivan Necas <inecas>
Component: UpgradesAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: cdonnell, ehelms, inecas, jentrena, mbacovsk, mmccune, rakumar, sjagtap
Target Milestone: UnspecifiedKeywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.5.59-1.el7sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-13 13:32:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A possible patch to mitigate the issue none

Description Ivan Necas 2018-02-27 09:46:53 UTC
Description of problem:
At some circumstances (not clear by the time of filing this bug), the upgrade to 6.3 can fail with the following error in migrate_foreman step;


[DEBUG 2018-02-24 10:05:07 main] API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
[DEBUG 2018-02-24 10:05:22 main] rake aborted!
[DEBUG 2018-02-24 10:05:22 main] can't modify frozen Array
[DEBUG 2018-02-24 10:05:22 main] /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.58/lib/katello/engine.rb:147:in `block in <class:Engine>'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
[DEBUG 2018-02-24 10:05:22 main] /opt/rh/rh-ror42/root/usr/share/gems/gems/railties-

Version-Release number of selected component (if applicable):
6.3.0

How reproducible:
Reproduced at one user, works locally or with other users

Comment 1 Ivan Necas 2018-02-27 09:54:49 UTC
I was only able to reproduce, when moving the 'katello.paths' to happen after `sooner_routes_load` initializer.

The possible fix should be patching katello package to enforce `:before => :sooner_routes_load` for the initializer.

The difference could be caused by some non-standard plugin being present in the system.

Comment 2 Ivan Necas 2018-02-27 10:00:02 UTC
Created attachment 1401245 [details]
A possible patch to mitigate the issue

To apply:

cd /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.58
patch -p1 < ~/katello.patch

Run foreman-rake db:migrate and continue with the upgrade, if successful

Comment 9 Ivan Necas 2018-03-01 14:12:21 UTC
Created redmine issue http://projects.theforeman.org/issues/22743 from this bug

Comment 10 Ivan Necas 2018-03-01 14:31:21 UTC
Fix proposed upstream https://github.com/Katello/katello/pull/7217

Comment 15 Satellite Program 2018-03-02 23:04:01 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/22743 has been resolved.

Comment 18 Sanket Jagtap 2018-03-28 09:24:09 UTC
Build : Satellite 6.3.1 snap1

Did a no-break satellite upgrade testing and the fix is present in satellite at 
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.*/lib/katello/engine.rb

The Upgrade was Successful from 6.2.14 to 6.3.1 and also from 6.3.0 to 6.3.1

Marking the BZ to Verified.

Comment 20 errata-xmlrpc 2018-04-13 13:32:28 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-2018:1126