Bug #24374
closedUser db upgrade from 3.4 to 3.7 failed at Upgrade Step: set_upstream_pool_id
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1607776
Description of problem: Customer db upgrade from 6.3 -> 6.4 failed at Upgrade Step: set_upstream_pool_id
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column katello_subscriptions.product_id does not exist
LINE 1: ...katello_subscriptions"."organization_id" = $1 AND "katello_s...
^
: SELECT "katello_subscriptions".* FROM "katello_subscriptions" WHERE "katello_subscriptions"."organization_id" = $1 AND "katello_subscriptions"."product_id" = $2 LIMIT $3
Version-Release number of selected component (if applicable):
Katello 3.7
How reproducible:
Steps to Reproduce:
1. Restored 6.3 db
2. Enable 6.4 repos
3. satellite-installer --scenario satellite --upgrade
Actual results:
Upgrade failed at Upgrade Step: set_upstream_pool_id showing
Upgrade Step: set_upstream_pool_id (this may take a while) ...
/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
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column katello_subscriptions.product_id does not exist
LINE 1: ...katello_subscriptions"."organization_id" = $1 AND "katello_s...
^
: SELECT "katello_subscriptions".* FROM "katello_subscriptions" WHERE "katello_subscriptions"."organization_id" = $1 AND "katello_subscriptions"."product_id" = $2 LIMIT $3
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:682:in `prepare'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:682:in `block in prepare_statement'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:677:in `prepare_statement'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:622:in `exec_cache'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:605:in `execute_and_clear'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:375:in `select_prepared'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:40:in `select_all'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/query_cache.rb:97:in `select_all'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/querying.rb:39:in `find_by_sql'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:678:in `exec_queries'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:546:in `load'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:255:in `records'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:508:in `find_take'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:100:in `take'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:78:in `find_by'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/querying.rb:7:in `find_by'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/core.rb:208:in `find_by'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/pool.rb:85:in `stacking_subscription'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/pool.rb:104:in `import_data'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:44:in `block (2 levels) in import_all'
/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/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:42:in `block in import_all'
/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/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:38:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/lib/katello/tasks/import_subscriptions.rake:6: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)>'
PG::UndefinedColumn: ERROR: column katello_subscriptions.product_id does not exist
LINE 1: ...katello_subscriptions"."organization_id" = $1 AND "katello_s...
^
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:682:in `prepare'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:682:in `block in prepare_statement'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:677:in `prepare_statement'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:622:in `exec_cache'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:605:in `execute_and_clear'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:375:in `select_prepared'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:40:in `select_all'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/query_cache.rb:97:in `select_all'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/querying.rb:39:in `find_by_sql'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:678:in `exec_queries'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:546:in `load'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation.rb:255:in `records'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:508:in `find_take'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:100:in `take'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/finder_methods.rb:78:in `find_by'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/querying.rb:7:in `find_by'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/core.rb:208:in `find_by'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/pool.rb:85:in `stacking_subscription'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/pool.rb:104:in `import_data'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:44:in `block (2 levels) in import_all'
/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/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:42:in `block in import_all'
/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/katello-3.7.0.rc1.6/app/models/katello/glue/candlepin/candlepin_object.rb:38:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1.6/lib/katello/tasks/import_subscriptions.rake:6: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 => katello:import_subscriptions
(See full trace by running task with --trace)
Importing Subscriptions
foreman-rake katello:import_subscriptions failed! Check the output for error!
Upgrade step set_upstream_pool_id failed. Check logs for more information.
Expected results: Successful upgrade.
Additional info:
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Justin Sherrill
- Pull request https://github.com/Katello/katello/pull/7565 added
Updated by Justin Sherrill over 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|3830ac7bfdb77bd7f5909ee6544217f8ae3ade52.
Updated by Andrew Kofink over 6 years ago
- Subject changed from Customer db upgrade from 6.3 -> 6.4 failed at Upgrade Step: set_upstream_pool_id to User db upgrade from 3.4 to 3.7 failed at Upgrade Step: set_upstream_pool_id
- Description updated (diff)
- Target version set to Katello 3.7.1
- Triaged changed from No to Yes
Updated by Jonathon Turel over 6 years ago
- Has duplicate Bug #24649: Katello Upgrade from 3.6.0 to 3.7.0 fails on subscription import added