Upgrading from Satellite 6.9 to Satellite 6.10 fails with error "undefined method operatingsystems' for nil:NilClass"
Environment
- Red Hat Satellite 6.10
Issue
-
Upgrading from Satellite 6.9 to Satellite 6.10 fails with error
undefined method operatingsystems' for nil:NilClassduring thedb:migratestep i.e. while applying the20210115124508 TemplateKindRegistrationmigration:undefined method operatingsystems' for nil:NilClass /usr/share/foreman/db/migrate/20210115124508_template_kind_registration.rb:26:in block in up' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/delegation.rb:87:in each' /opt/theforeman/tfm/root/usr/share /gems/gems/activerecord-6.0.3.7/lib/active_record/relation/delegation.rb:87:in each' /usr/share/foreman/db/migrate/20210115124508_template_kind_registration.rb:25:in up' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7 /lib/active_record/migration.rb:831:in exec_migration' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:812:in block (2 levels) in migrate' /opt/rh/rh-ruby27/root/usr /share/ruby/benchmark.rb:293:in measure' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:811:in block in migrate' /opt/theforeman/tfm/root/usr/share /gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in with_connection' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:810:in migrate' /opt/theforeman/tfm/root/usr/share /gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1002:in migrate' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1310:in block in execute_migration_in_transaction' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/migration.rb:1361:in block in ddl_transaction' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in block in transaction' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in block in within_new_transaction' /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in block (2 levels) in synchronize' /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in handle_interrupt' /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize' /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in handle_interrupt'
Resolution
-
This issue is fixed with an ERRATA release mentioned in
Public Red Hat BugzillaThis content is not included.2070991. -
However, the issue still persists while performing an upgrade to 6.11 which is being tracked under
Public Red Hat BugzillaThis content is not included.2063190. -
For more information, open a This content is not included.support case with
Red Hat Technical Support Team.
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Diagnostic Steps
-
Execute the
foreman-rake db:migrate --trace --verbosecommand to observe the following error traceback:[root@nsatellite ~]# foreman-rake db:migrate --trace --verbose 'ErbParser' is ignored. 'RubyParser' is ignored. ** Invoke db:migrate (first_time) ** Invoke db:load_config (first_time) ** Invoke environment (first_time) ** Execute environment API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. ** Execute db:load_config ** Invoke plugin:refresh_migrations (first_time) ** Invoke environment ** Execute plugin:refresh_migrations ** Execute db:migrate == 20210115124508 TemplateKindRegistration: migrating ========================= rake aborted! StandardError: An error has occurred, this and all later migrations canceled:
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.