Bug 1641017

Summary: Upgrade to Satellite 6.4 is failning on script 20180516103339_update_idm_params.rb
Product: Red Hat Satellite 6 Reporter: jjansky
Component: BrandingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: cmarinea, egolov, inecas, mbacovsk, nkathole, pdwyer, sshtein
Target Milestone: 6.5.0Keywords: PrioBumpGSS, Triaged, Upgrades
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_theme_satellite-3.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1646748 (view as bug list) Environment:
Last Closed: 2019-05-14 12:38:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description jjansky 2018-10-19 12:51:06 UTC
Description of problem:
Upgrade is failing from various of reason on script 20180516103339_update_idm_params.rb

How reproducible:
with customer database easily, i will try to obtain customer DB in 6.3 state


Steps to Reproduce:
1. satellite-installer --upgrade

Actual results:
FAILED because of various reasons, stacktrace always contains script 20180516103339_update_idm_params.rb

Expected results:
SUCCESS


Additional info:
Stacktraces in next comments

Solution written with help of Ivan Necas, not published yet
https://access.redhat.com/solutions/3660281

Comment 1 jjansky 2018-10-19 12:52:38 UTC
Validation failed: Override must be true to edit the parameter
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:46:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:6:in `block (2 levels) in up'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:336:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:105:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:5:in `block in up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:3:in `up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:795:in `exec_migration'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:776:in `block (2 levels) in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:775:in `block in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:408:in `with_connection'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:774:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1230:in `block in execute_migration_in_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `block in ddl_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `ddl_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
ActiveRecord::RecordInvalid: Validation failed: Override must be true to edit the parameter
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:46:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:6:in `block (2 levels) in up'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:336:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:105:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:5:in `block in up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:3:in `up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:795:in `exec_migration'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:776:in `block (2 levels) in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:775:in `block in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:408:in `with_connection'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:774:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1230:in `block in execute_migration_in_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `block in ddl_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `ddl_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
== 20180516103339 UpdateIdmParams: migrating ==================================
foreman-rake db:migrate failed! Check the output for error!

Comment 2 jjansky 2018-10-19 12:53:35 UTC
Stacktrace from second customer:

[DEBUG 2018-10-18T09:53:29 main] Validation failed: Hostgroup can't be blank
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:46:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:13:in `block (2 levels) in up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:336:in `without_auditing'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:105:in `without_auditing'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:12:in `block in up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:10:in `up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:795:in `exec_migration'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:776:in `block (2 levels) in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:775:in `block in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:408:in `with_connection'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:774:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1230:in `block in execute_migration_in_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `block in ddl_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `ddl_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
[DEBUG 2018-10-18T09:53:29 main] /opt/rh/rh-ruby24/root/usr/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
[DEBUG 2018-10-18T09:53:29 main] ActiveRecord::RecordInvalid: Validation failed: Hostgroup can't be blank
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:46:in `save!'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:13:in `block (2 levels) in up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:336:in `without_auditing'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/auditor.rb:105:in `without_auditing'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:12:in `block in up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/delegation.rb:39:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-2.0.1.11/db/migrate/20180516103339_update_idm_params.rb:10:in `up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:795:in `exec_migration'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:776:in `block (2 levels) in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:775:in `block in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:408:in `with_connection'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:774:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1230:in `block in execute_migration_in_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `block in ddl_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1298:in `ddl_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
[DEBUG 2018-10-18T09:53:29 main] /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
[DEBUG 2018-10-18T09:53:29 main] /opt/rh/rh-ruby24/root/usr/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
[DEBUG 2018-10-18T09:53:29 main] Tasks: TOP => db:migrate
[DEBUG 2018-10-18T09:53:29 main] (See full trace by running task with --trace)
[DEBUG 2018-10-18T09:53:29 main] == 20180516103339 UpdateIdmParams: migrating ==================================
[ERROR 2018-10-18T09:53:30 main] foreman-rake db:migrate failed! Check the output for error!

Comment 6 Nikhil Kathole 2019-02-06 06:14:57 UTC
Hi Ivan,

I upgraded satellite 6.4.1 to 6.5 snap 14 as per steps you mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1646748#c2.

Upgrade is successful but the global parameter idm_server invalid is not changed to freeipa_server invalid. Is it expected?

Steps:

1. Fresh install 6.4.1
2. #  foreman-rake console
/usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/content_facet_host_extensions.rb:7: warning: already initialized constant Katello::Concerns::ContentFacetHostExtensions::ERRATA_STATUS_MAP
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/content_facet_host_extensions.rb:7: warning: previous definition of ERRATA_STATUS_MAP was here
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/content_facet_host_extensions.rb:14: warning: already initialized constant Katello::Concerns::ContentFacetHostExtensions::TRACE_STATUS_MAP
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/content_facet_host_extensions.rb:14: warning: previous definition of TRACE_STATUS_MAP was here
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/subscription_facet_host_extensions.rb:13: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::SUBSCRIPTION_STATUS_MAP
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/models/katello/concerns/subscription_facet_host_extensions.rb:13: warning: previous definition of SUBSCRIPTION_STATUS_MAP was here
Loading production environment (Rails 5.1.6)
Failed to load console gems, starting anyway
irb(main):001:0> param = CommonParameter.new(name: 'idm_server invalid', value: 'example.com')
=> #<CommonParameter id: nil, name: "idm_server invalid", value: "example.com", reference_id: nil, created_at: nil, updated_at: nil, type: "CommonParameter", priority: nil, hidden_value: false>
irb(main):002:0> param.save(:validate => false)
=> true

3. Upgrade to satellite 6.5 snap 14 and is successful.

Comment 7 Ivan Necas 2019-02-06 08:16:31 UTC
This BZ i valid only for 6.3 -> 6.4 migrations as the use of the naming in branding has changed between 6.3 and 6.4. It's not expected we would do this change between 6.4 and 6.5 so as long as the upgrade succeeds, we should be good.

Comment 8 Nikhil Kathole 2019-02-06 08:33:24 UTC
Thanks Ivan.

VERIFIED

version tested:
Satellite 6.4.1 -> 6.5

Comment 11 errata-xmlrpc 2019-05-14 12:38:16 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:1222