Project

General

Profile

Actions

Bug #36562

closed

Upgrade to Katello 4.5 can fail if some on_demand repositories have checksum_type set

Added by Sayan Das over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
Triaged:
Yes
Found in Releases:

Description

For any reason if an on_demand repo have a sha1 or sha256 checksum_type set in Katello:RootRepository then, Upgrade from Katello 4.4 -> 4.5 will fail on db:migration.

The migration that fails is RemoveDrpmFromIgnorableContent. That's because it executed root.save! in https://github.com/Katello/katello/blob/master/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb#L9 and that errors out on those on_demand repos due to https://github.com/Katello/katello/blob/master/app/models/katello/root_repository.rb#L213-L217

  • Invoke db:migrate (first_time)
  • Invoke db:load_config (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute db:load_config
  • Invoke plugin:refresh_migrations (first_time)
  • Invoke environment
  • Execute plugin:refresh_migrations
  • Execute db:migrate
    20220228173251 RemoveDrpmFromIgnorableContent: migrating =================
    rake aborted!
    StandardError: An error has occurred, this and all later migrations canceled:

Validation failed: Checksum type Checksum type cannot be set for yum repositories with on demand download policy.
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/validations.rb:80:in `raise_validation_error'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/validations.rb:53:in `save!'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/transactions.rb:318:in `block in save!'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/transactions.rb:212:in `transaction'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/transactions.rb:318:in `save!'
/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/suppressor.rb:48:in `save!'
/usr/share/gems/gems/katello-4.5.0.33/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb:9:in `block in up'
/usr/share/gems/gems/katello-4.5.0.33/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb:3:in `each'
/usr/share/gems/gems/katello-4.5.0.33/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb:3:in `up'

Actions

Also available in: Atom PDF