Bug #36299
closedThe migration for adding the new ansible_callback_enabled column is failing on nightly Katello
Description
[root@pipe-katello-server-nightly-centos8-stream forklift]# /usr/sbin/foreman-rake db:migrate
20221003153000 AddAnsibleCallbackEnabledToTemplates: migrating ===========
-- add_column(:templates, :ansible_callback_enabled, :boolean, {:default=>false})
-> 0.0104s
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Couldn't find Template without an ID
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/finder_methods.rb:456:in `find_with_ids'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/finder_methods.rb:69:in `find'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/querying.rb:22:in `find'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/core.rb:344:in `find'
/usr/share/gems/gems/foreman_ansible-11.1.2/db/migrate/20221003153000_add_ansible_callback_enabled_to_templates.rb:7:in `block in change'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/foreman_ansible-11.1.2/db/migrate/20221003153000_add_ansible_callback_enabled_to_templates.rb:6:in `change'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:867:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
ActiveRecord::RecordNotFound: Couldn't find Template without an ID
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/finder_methods.rb:456:in `find_with_ids'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/finder_methods.rb:69:in `find'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/querying.rb:22:in `find'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/core.rb:344:in `find'
/usr/share/gems/gems/foreman_ansible-11.1.2/db/migrate/20221003153000_add_ansible_callback_enabled_to_templates.rb:7:in `block in change'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/foreman_ansible-11.1.2/db/migrate/20221003153000_add_ansible_callback_enabled_to_templates.rb:6:in `change'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:867:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90: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)
Updated by Nofar Alfassi over 1 year ago
- Related to Bug #35585: Unable to enable callback plugin per-template added
Updated by The Foreman Bot over 1 year ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_ansible/pull/615 added
Updated by The Foreman Bot over 1 year ago
- Fixed in Releases foreman_ansible-11.1.2 added
Updated by Nofar Alfassi over 1 year ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_ansible|58ef65c043f267a419ee18dff5f1f3fba5c56f45.
Updated by Nofar Alfassi over 1 year ago
- Fixed in Releases foreman_ansible-11.2.0 added
- Fixed in Releases deleted (
foreman_ansible-11.1.2)
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/theforeman/foreman_ansible/pull/635 added
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/theforeman/foreman_ansible/pull/636 added
Updated by Nofar Alfassi over 1 year ago
- Pull request deleted (
https://github.com/theforeman/foreman_ansible/pull/636, https://github.com/theforeman/foreman_ansible/pull/635)
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/theforeman/foreman_ansible/pull/641 added
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/theforeman/foreman_ansible/pull/643 added
Updated by The Foreman Bot over 1 year ago
- Fixed in Releases foreman_ansible-10.0.0 added