Bug 1747654 - Upgrade to 6.6 failed at foreman-rake db:migrate - undefined method `searchable_value='
Summary: Upgrade to 6.6 failed at foreman-rake db:migrate - undefined method `searchab...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Upgrades
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: 6.6.0
Assignee: Kavita
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks: 1737488
TreeView+ depends on / blocked
 
Reported: 2019-08-31 13:34 UTC by Nikhil Kathole
Modified: 2019-10-22 12:48 UTC (History)
6 users (show)

Fixed In Version: foreman-1.22.0.24-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 12:47:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 27745 Normal Closed rails db:migrate fails while running upgrade 2020-01-15 06:47:16 UTC
Red Hat Product Errata RHSA-2019:3172 None None None 2019-10-22 12:48:06 UTC

Description Nikhil Kathole 2019-08-31 13:34:08 UTC
Description of problem:

Upgrade to 6.6 failed at foreman-rake db:migrate - undefined method `searchable_value='

# foreman-rake db:migrate --trace
** 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
== 20181105061336 CastKeyTypesAndValuesInParameters: migrating ================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `searchable_value=' for #<GroupParameter:0x000000000b68ceb8>
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activemodel-5.2.1/lib/active_model/attribute_methods.rb:430:in `method_missing'
/usr/share/foreman/app/models/parameter.rb:81:in `set_searchable_value'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:605:in `catch'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:605:in `block in default_terminator'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:199:in `block in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:131:in `run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/callbacks.rb:342:in `create_or_update'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:275:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:46:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block (2 levels) in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:309:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:44:in `save'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:37:in `block in save_param'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/auditor.rb:336:in `without_auditing'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:34:in `save_param'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:29:in `override_key_type_and_value'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:10:in `block (2 levels) in up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:4:in `block in up'
/usr/share/foreman/app/models/concerns/authorizable.rb:106:in `skip_permission_check'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:3:in `up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:817:in `exec_migration'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/opt/rh/rh-ruby25/root/usr/share/ruby/benchmark.rb:293:in `measure'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:797:in `block in migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:796:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:977:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1343:in `ddl_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `block in migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1036:in `up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1011:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'

Caused by:
NoMethodError: undefined method `searchable_value=' for #<GroupParameter:0x000000000b68ceb8>
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activemodel-5.2.1/lib/active_model/attribute_methods.rb:430:in `method_missing'
/usr/share/foreman/app/models/parameter.rb:81:in `set_searchable_value'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:605:in `catch'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:605:in `block in default_terminator'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:199:in `block in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:131:in `run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/callbacks.rb:342:in `create_or_update'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:275:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:46:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block (2 levels) in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:309:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:44:in `save'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:37:in `block in save_param'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/auditor.rb:336:in `without_auditing'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:34:in `save_param'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:29:in `override_key_type_and_value'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:10:in `block (2 levels) in up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:4:in `block in up'
/usr/share/foreman/app/models/concerns/authorizable.rb:106:in `skip_permission_check'
/usr/share/foreman/db/migrate/20181105061336_cast_key_types_and_values_in_parameters.rb:3:in `up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:817:in `exec_migration'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/opt/rh/rh-ruby25/root/usr/share/ruby/benchmark.rb:293:in `measure'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:797:in `block in migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:796:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:977:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1343:in `ddl_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `block in migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1036:in `up'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1011:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate


Version-Release number of selected component (if applicable):
Satellite 6.6.0 snap 18

foreman-1.22.0.21-1.el7sat.noarch.rpm
foreman-cli-1.22.0.21-1.el7sat.noarch.rpm
foreman-debug-1.22.0.21-1.el7sat.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1. Install 6.5
2. perform upgrade using foreman-maintain 

Actual results:
Installer failed at 

 foreman-rake db:migrate failed! Check the output for error!
 Upgrade step migrate_foreman failed. Check logs for more information.
                                       [FAIL]
 Failed executing LANG=en_US.utf-8 satellite-installer --upgrade, exit status 1
 --------------------------------------------------------------------------------
 Scenario [Migration scripts to Satellite 6.6] failed.
 
 The following steps ended up in failing state:
 
   [installer-upgrade]
 
 Resolve the failed steps and rerun
 the command. In case the failures are false positives,
 use --whitelist="installer-upgrade"


Expected results:
Successful upgrade.


Additional info:

Regression.

Comment 4 Kavita 2019-08-31 16:02:40 UTC
@Nikhil,

I have raised pull-request to fix migration(https://github.com/theforeman/foreman/pull/7010).
Would it be possible to verify with this patch upgrade runs successfully on your reproducer &
not giving any migration failures? 

Or let me know if I can do testing on reproducer with this patch change.

Comment 5 Nikhil Kathole 2019-08-31 16:49:33 UTC
Thank you for the quick fix Kavita.

I tested the patch and the upgrade completed successfully with it.

Comment 8 Kavita 2019-09-05 09:26:07 UTC
Thank you Bryan. 

I got the review comment from Shim on the pull-request. I will do appropriate changes as per suggestions.

Comment 11 Bryan Kearney 2019-09-06 12:02:49 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27745 has been resolved.

Comment 13 Nikhil Kathole 2019-09-16 10:38:48 UTC
VERIFIED

Version tested:
Satellite 6.6.0 snap 20

Satellite upgrade completed successfully.

Upgrade Step: migrate_foreman...
 API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
 == 20171109095957 AddKeyTypeToParameters: migrating ===========================
 -- add_column(:parameters, :key_type, :string, {:limit=>255})
    -> 0.0057s
 == 20171109095957 AddKeyTypeToParameters: migrated (0.0059s) ==================
 
 == 20180129143410 CreateJwtSecrets: migrating =================================
 -- adapter_name()
    -> 0.0000s
 -- create_table(:jwt_secrets, {})
    -> 1.0294s
 == 20180129143410 CreateJwtSecrets: migrated (1.0297s) ========================
 
 == 20180628125416 AddAnsibleRoleIdToLookupKeys: migrating =====================
 -- add_column(:lookup_keys, :ansible_role_id, :integer, {})
    -> 0.0039s
 -- add_index(:lookup_keys, :ansible_role_id)
    -> 0.1290s
 == 20180628125416 AddAnsibleRoleIdToLookupKeys: migrated (0.1332s) ============
 
 == 20180705230311 SmartProxyCapabilities: migrating ===========================
 -- rename_table(:features_smart_proxies, :smart_proxy_features)
    -> 0.0158s
 -- change_table(:smart_proxy_features, {:bulk=>true})
    -> 0.0747s
 == 20180705230311 SmartProxyCapabilities: migrated (0.0908s) ==================
 
 == 20180823081502 RemoveForemanDockerSupport: migrating =======================
 -- table_exists?(:docker_images)
    -> 0.0018s
 -- table_exists?(:docker_tags)
    -> 0.0031s
 -- table_exists?(:docker_container_wizard_states_images)
    -> 0.0017s
 -- column_exists?(:docker_container_wizard_states_images, :capsule_id)
    -> 0.0070s
 -- remove_column(:docker_container_wizard_states_images, :capsule_id)
    -> 0.0040s
 -- table_exists?(:containers)
    -> 0.0017s
 -- column_exists?(:containers, :capsule_id)
    -> 0.0119s
 -- remove_column(:containers, :capsule_id)
    -> 0.0048s
 == 20180823081502 RemoveForemanDockerSupport: migrated (0.0373s) ==============
 
 == 20181005065724 FilterAndExcludeHostParents: migrating ======================
 -- add_column(:foreman_virt_who_configure_configs, :filter_host_parents, :text)
    -> 0.0028s
 -- add_column(:foreman_virt_who_configure_configs, :exclude_host_parents, :text)
    -> 0.0013s
 == 20181005065724 FilterAndExcludeHostParents: migrated (0.0044s) =============
 
 == 20181019135324 AddRemoteTaskOperation: migrating ===========================
 -- add_column(:foreman_tasks_remote_tasks, :operation, :string, {})
    -> 0.0036s
 == 20181019135324 AddRemoteTaskOperation: migrated (0.0037s) ==================
 
 == 20181031155025 AddTrendCounterCreatedAtUniqueConstraint: migrating =========
 -- add_index(:trend_counters, [:trend_id, :created_at], {:unique=>true})
    -> 0.0101s
 == 20181031155025 AddTrendCounterCreatedAtUniqueConstraint: migrated (0.0631s) 
 == 20181105061336 CastKeyTypesAndValuesInParameters: migrating ================
 == 20181105061336 CastKeyTypesAndValuesInParameters: migrated (0.3100s) =======
 
 == 20181116104823 FixedIgnoreTaxonomiesForAuditFilters: migrating =============
 == 20181116104823 FixedIgnoreTaxonomiesForAuditFilters: migrated (1.2530s) ====
 
 == 20181224174419 AddIndexToEnvironmentClassByLookupKeyAndPuppetclass: migrating -- add_index(:environment_classes, [:puppetclass_lookup_key_id, :puppetclass_id], {:name=>"index_env_classes_on_lookup_key_and_class"})
    -> 0.0327s
 == 20181224174419 AddIndexToEnvironmentClassByLookupKeyAndPuppetclass: migrated (0.0329s) 
 == 20190103093409 AddDeploymentOptionToPolicy: migrating ======================
 -- add_column(:foreman_openscap_policies, :deploy_by, :string)
    -> 0.0106s
 -- change_column(:foreman_openscap_policies, :deploy_by, :string, {:null=>false})
    -> 0.0024s
 == 20190103093409 AddDeploymentOptionToPolicy: migrated (0.1695s) =============
 
 == 20190104125749 AddKubeconfigToConfig: migrating ============================
 -- add_column(:foreman_virt_who_configure_configs, :kubeconfig_path, :string, {:null=>true})
    -> 0.0014s
 == 20190104125749 AddKubeconfigToConfig: migrated (0.0017s) ===================
 
 == 20190107160723 UnitsUuidToBackendIdent: migrating ==========================
 -- rename_column("katello_rpms", :uuid, :pulp_id)
    -> 0.0085s
 -- rename_column("katello_errata", :uuid, :pulp_id)
    -> 0.0094s
 -- rename_column("katello_package_groups", :uuid, :pulp_id)
    -> 0.0057s
 -- rename_column("katello_files", :uuid, :pulp_id)
    -> 0.0076s
 -- rename_column("katello_yum_metadata_files", :uuid, :pulp_id)
    -> 0.0041s
 -- rename_column("katello_srpms", :uuid, :pulp_id)
    -> 0.0082s
 -- rename_column("katello_module_streams", :uuid, :pulp_id)
    -> 0.0037s
 -- rename_column("katello_debs", :uuid, :pulp_id)
    -> 0.0079s
 -- rename_column("katello_docker_tags", :uuid, :pulp_id)
    -> 0.0079s
 -- rename_column("katello_docker_manifests", :uuid, :pulp_id)
    -> 0.0031s
 -- rename_column("katello_docker_manifest_lists", :uuid, :pulp_id)
    -> 0.0029s
 -- rename_column("katello_puppet_modules", :uuid, :pulp_id)
    -> 0.0056s
 -- rename_column("katello_ostree_branches", :uuid, :pulp_id)
    -> 0.0032s
 == 20190107160723 UnitsUuidToBackendIdent: migrated (0.0794s) =================
 
 == 20190108151133 DebReleaseNameUnknown: migrating ============================
 == 20190108151133 DebReleaseNameUnknown: migrated (0.0225s) ===================
 
 == 20190111153330 RemoveRemoteExecutionWithoutProxySetting: migrating =========
 == 20190111153330 RemoveRemoteExecutionWithoutProxySetting: migrated (0.0030s) 
 == 20190116120705 RemoveTimestampsFromLogs: migrating =========================
 -- remove_column(:logs, :created_at, :datetime)
    -> 0.0023s
 -- remove_column(:logs, :updated_at, :datetime)
    -> 0.0011s
 == 20190116120705 RemoveTimestampsFromLogs: migrated (0.0037s) ================
 
 == 20190121084601 ChangeComputeResourcePasswordLength: migrating ==============
 -- change_column(:compute_resources, :password, :text, {:limit=>nil})
    -> 0.0032s
 == 20190121084601 ChangeComputeResourcePasswordLength: migrated (0.0034s) =====
 
 == 20190122115421 RenameHostStatusesReport: migrating =========================
 == 20190122115421 RenameHostStatusesReport: migrated (0.0713s) ================
 
 == 20190219152921 AddPulp3Attributes: migrating ===============================
 -- create_table(:katello_distribution_references)
    -> 0.0269s
 -- create_table(:katello_repository_references)
    -> 0.0449s
 -- add_column(:katello_repositories, :remote_href, :string)
    -> 0.0017s
 -- add_column(:katello_repositories, :publication_href, :string)
    -> 0.0013s
 -- add_column(:katello_repositories, :version_href, :string)
    -> 0.0013s
 == 20190219152921 AddPulp3Attributes: migrated (0.0766s) ======================
 
 == 20190221201724 AddDependencySolvingToKatelloContentView: migrating =========
 -- add_column(:katello_content_views, :solve_dependencies, :boolean, {:default=>false})
    -> 0.0421s
 == 20190221201724 AddDependencySolvingToKatelloContentView: migrated (0.0423s) 
 == 20190225115728 CreateStoredValues: migrating ===============================
 -- create_table(:stored_values)
    -> 0.0194s
 == 20190225115728 CreateStoredValues: migrated (0.0196s) ======================
 
 == 20190228160047 AddValueTypeAndResourceTypeToTemplateInput: migrating =======
 -- add_column(:template_inputs, :value_type, :string, {:default=>"plain", :null=>false})
    -> 0.0198s
 -- add_column(:template_inputs, :resource_type, :string)
    -> 0.0013s
 == 20190228160047 AddValueTypeAndResourceTypeToTemplateInput: migrated (0.0214s) 
 == 20190318094437 AddImportedAttrToAnsibleVariables: migrating ================
 -- add_column(:lookup_keys, :imported, :boolean)
    -> 0.0013s
 == 20190318094437 AddImportedAttrToAnsibleVariables: migrated (0.0542s) =======
 
 == 20190318153925 AddTaskStateUpdatedAt: migrating ============================
 -- add_column(:foreman_tasks_tasks, :state_updated_at, :timestamp, {:index=>true})
    -> 0.0015s
 == 20190318153925 AddTaskStateUpdatedAt: migrated (0.0017s) ===================
 
 == 20190328114657 RemoveTopLevelAnsibleVariablesSetting: migrating ============
 == 20190328114657 RemoveTopLevelAnsibleVariablesSetting: migrated (0.0060s) ===
 
 == 20190404030833 RemoveEnabledFromSyncPlans: migrating =======================
 -- remove_column(:katello_sync_plans, :enabled)
    -> 0.0026s
 == 20190404030833 RemoveEnabledFromSyncPlans: migrated (0.0027s) ==============
 
 == 20190510082811 AddTaxonomyIdTaxableTypeIndicesToTaxableTaxonomies: migrating -- add_index(:taxable_taxonomies, ["taxonomy_id", "taxable_type"])
    -> 0.1936s
 -- remove_index(:taxable_taxonomies, :taxonomy_id)
    -> 0.0083s
 == 20190510082811 AddTaxonomyIdTaxableTypeIndicesToTaxableTaxonomies: migrated (0.2023s) 
 == 20190702182118 AddMetadataProcessAfterToKatelloEvent: migrating ============
 -- add_column(:katello_events, :metadata, :text)
    -> 0.0073s
 -- add_column(:katello_events, :process_after, :datetime)
    -> 0.0010s
 == 20190702182118 AddMetadataProcessAfterToKatelloEvent: migrated (0.0086s) ===
 
 == 20190705060630 AddSearchableValueToParameters: migrating ===================
 -- add_column(:parameters, :searchable_value, :text)
    -> 0.0015s
 == 20190705060630 AddSearchableValueToParameters: migrated (0.0469s) ==========
 
 foreman-rake db:migrate finished successfully!

Comment 15 errata-xmlrpc 2019-10-22 12:47:58 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.

https://access.redhat.com/errata/RHSA-2019:3172


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