Same happens for me:
[root@or ~]# foreman-rake db:migrate
Rubocop not loaded.
Rubocop not loaded.
Rubocop not loaded.
== 20220110223754 UpdateDisconnectedSettings: migrating =======================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:The single-table inheritance mechanism failed to locate the subclass: 'Setting::Content'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:227:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:824:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:811:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/core.rb:193:in `find_by'
/usr/share/gems/gems/katello-4.5.1/db/migrate/20220110223754_update_disconnected_settings.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'Caused by:
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Setting::Content'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:227:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:824:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:811:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/core.rb:193:in `find_by'
/usr/share/gems/gems/katello-4.5.1/db/migrate/20220110223754_update_disconnected_settings.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'Caused by:
NameError: uninitialized constant Setting::Content
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/inflector/methods.rb:284:in `const_get'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/inflector/methods.rb:284:in `block in constantize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/inflector/methods.rb:280:in `each'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/inflector/methods.rb:280:in `inject'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/inflector/methods.rb:280:in `constantize'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:229:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:824:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:811:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/core.rb:193:in `find_by'
/usr/share/gems/gems/katello-4.5.1/db/migrate/20220110223754_update_disconnected_settings.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:831:in `exec_migration'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:812:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:811:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:810:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1002:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.0.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1361:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1281:in `block in migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1280:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `block in migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1382:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1229:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1061:in `up'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/migration.rb:1036:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `each'
/usr/share/gems/gems/activerecord-6.0.6.1/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
This line fails: katello/db/migrate/20220110223754_update_disconnected_settings.rb at master · Katello/katello · GitHub
Because it would try to use Setting::Content which would result in:
The single-table inheritance mechanism failed to locate the subclass: ‘Setting::Content’
Therefore, I think the order of the db migrations is wrong.
The 20220110* would run BEFORE 20220419* but the code change was already done in foreman/katello. Therefore Setting.find(:content…) fails.
I’m currently on a broken system, because Setting with category Setting::Content exists, especially the Setting with the name “content_disconnected” and it tries to run the migration 20220110223754_update_disconnected_settings.rb but this is not possible.