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 12 months ago. Updated 9 months 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 #1

Updated by The Foreman Bot 12 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/10635 added
Actions #2

Updated by Partha Aji 12 months ago

  • Target version set to Katello 4.8.3
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot 11 months ago

  • Fixed in Releases Katello 4.10.0 added
Actions #4

Updated by Sayan Das 11 months ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Ewoud Kohl van Wijngaarden 11 months ago

  • Fixed in Releases Katello 4.8.3 added
Actions #6

Updated by William Clark 9 months ago

  • Target version changed from Katello 4.8.3 to Katello 4.9.2
Actions #7

Updated by The Foreman Bot 9 months ago

  • Pull request https://github.com/Katello/katello/pull/10754 added
Actions #8

Updated by The Foreman Bot 9 months ago

  • Pull request deleted (https://github.com/Katello/katello/pull/10635, https://github.com/Katello/katello/pull/10754)
Actions #9

Updated by The Foreman Bot 9 months ago

  • Fixed in Releases Katello 4.9.2 added
Actions

Also available in: Atom PDF