Bug 1549502 - Upgrade from sat6.2 -> 6.3 failed at migrate_foreman: "can't modify frozen Array"
Summary: Upgrade from sat6.2 -> 6.3 failed at migrate_foreman: "can't modify frozen Ar...
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.3.0
Hardware: All
OS: Linux
high vote
Target Milestone: Unspecified
Assignee: Ivan Necas
QA Contact: Sanket Jagtap
Depends On:
TreeView+ depends on / blocked
Reported: 2018-02-27 09:46 UTC by Ivan Necas
Modified: 2021-06-10 14:53 UTC (History)
8 users (show)

Fixed In Version: tfm-rubygem-katello-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-04-13 13:32:28 UTC
Target Upstream Version:

Attachments (Terms of Use)
A possible patch to mitigate the issue (656 bytes, patch)
2018-02-27 10:00 UTC, Ivan Necas
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 22743 0 Normal Closed Update failed at migrate_foreman: "can't modify frozen Array" 2020-11-06 16:33:55 UTC
Red Hat Product Errata RHBA-2018:1126 0 None None None 2018-04-13 13:33:08 UTC

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- `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):

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

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.


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