Bug #36562
closedUpgrade to Katello 4.5 can fail if some on_demand repositories have checksum_type set
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'
Updated by The Foreman Bot over 1 year ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/10635 added
Updated by Partha Aji over 1 year ago
- Target version set to Katello 4.8.3
- Triaged changed from No to Yes
Updated by The Foreman Bot over 1 year ago
- Fixed in Releases Katello 4.10.0 added
Updated by Sayan Das over 1 year ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|f0ab69db3927014c5e570366162d8bbb1fbc6044.
Updated by Ewoud Kohl van Wijngaarden over 1 year ago
- Fixed in Releases Katello 4.8.3 added
Updated by William Clark about 1 year ago
- Target version changed from Katello 4.8.3 to Katello 4.9.2
Updated by The Foreman Bot about 1 year ago
- Pull request https://github.com/Katello/katello/pull/10754 added
Updated by The Foreman Bot about 1 year ago
- Pull request deleted (
https://github.com/Katello/katello/pull/10635, https://github.com/Katello/katello/pull/10754)
Updated by The Foreman Bot about 1 year ago
- Fixed in Releases Katello 4.9.2 added