-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #37859 - Re-drop evr extension in katello #11159
base: master
Are you sure you want to change the base?
Conversation
bbc9a51
to
accb31a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working fine still! I think it's safe to merge even now, yeah? We could also wait until we learn more about how remote databases will deal with the changes, up to you. Worst case we have another revert (but I really hope not!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding an error if the permissions aren't sufficient?
execute <<~SQL | ||
DROP EXTENSION evr CASCADE; | ||
SQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute <<~SQL | |
DROP EXTENSION evr CASCADE; | |
SQL | |
begin | |
execute <<~SQL | |
DROP EXTENSION evr CASCADE; | |
SQL | |
rescue ActiveRecord::StatementInvalid | |
msg = _('Due to the PostgreSQL 12 to 13 upgade, run' \ | |
" UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname='foreman');" \ | |
" as a PostgreSQL admin before migrating the database.") | |
raise ActiveRecord::StatementInvalid, msg | |
end |
The logs looks like this as a result:
== 20240924161240 KatelloRecreateEvrConstructs: migrating =====================
-- extension_enabled?("evr")
-> 0.0014s
-- execute("DROP EXTENSION evr CASCADE;\n")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Due to the PostgreSQL 12 to 13 upgade, run UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname='foreman'); as a PostgreSQL admin before migrating the database.
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:14:in `rescue in up'
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:6:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Caused by:
ActiveRecord::StatementInvalid: Due to the PostgreSQL 12 to 13 upgade, run UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname='foreman'); as a PostgreSQL admin before migrating the database.
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:14:in `rescue in up'
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:6:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Caused by:
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: must be owner of extension evr
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:49:in `exec'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:49:in `block (2 levels) in execute'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `block in execute'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:in `execute'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:929:in `block in method_missing'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:897:in `block in say_with_time'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:897:in `say_with_time'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:918:in `method_missing'
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:7:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Caused by:
PG::InsufficientPrivilege: ERROR: must be owner of extension evr
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:49:in `exec'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:49:in `block (2 levels) in execute'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `block in execute'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:in `execute'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:929:in `block in method_missing'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:897:in `block in say_with_time'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:897:in `say_with_time'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:918:in `method_missing'
/usr/share/gems/gems/katello-4.15.0.pre.master/db/migrate/20240924161240_katello_recreate_evr_constructs.rb:7:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.8/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be just for remote database users. We can discuss later with @ekohl if it makes sense for the installer to also catch this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality is being added to the installer here: theforeman/foreman-installer#984
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, partially. I suppose this change would make the error more obvious in case of weird edge case issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as in https://github.com/theforeman/foreman-installer/pull/984/files#r1830495691 ;)
What are the changes introduced in this pull request?
This brings back the changes from #11087 which were reverted as part of #11103 to stop blocking 4.14.
Considerations taken when implementing this change?
Also pulled in some updates from #11098 which came out of additional reviews on the first katello PR.
What are the testing steps for this pull request?
Same as testing steps for #11087
Check sudo rpm -qa evr
Remove the rpm: sudo rpm -e evr_package_from_above
Run bundle exec rails katello:reset to mimic fresh installs
Test the usual flows with applicability
To test existing systems just delete the evr package and make sure everything continues to work as normal.