Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1641785

Summary: Upgrade from Satellite 6.3.4 to 6.4.0 fails in "Upgrade Step: clear_checksum_type..."
Product: Red Hat Satellite Reporter: German Pulido <gpulido>
Component: RepositoriesAssignee: Stephen Benjamin <stbenjam>
Status: CLOSED ERRATA QA Contact: vijsingh
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: egolov, fgarciad, gpulido, inecas, iwindon, mbacovsk, mmccune, molasaga
Target Milestone: 6.5.0Keywords: Triaged, Upgrades
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.10.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1661277 (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:
Embargoed:

Description German Pulido 2018-10-22 18:27:54 UTC
Description of problem:
Upgrading Red Hat Satellite from version 6.3.4 to 6.4.0 following procedure from https://access.redhat.com/documentation/en-us/red_hat_satellite/6.4/html-single/upgrading_and_updating_red_hat_satellite/#upgrading_red_hat_satellite fails:

...
Upgrade Step: clear_checksum_type...
/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::RecordInvalid: Validation failed: Upstream password requires upstream username be set.
/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/katello-3.7.0.41/app/lib/katello/lazy_accessor.rb:87:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/persistence.rb:294:in `block in update!'
/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/persistence.rb:292:in `update!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.41/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake:21:in `block (6 levels) in <top (required)>'
/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/transactions.rb:299:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.41/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake:9:in `block (5 levels) in <top (required)>'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:63:in `block (2 levels) in find_each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:63:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:63:in `block in find_each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:129:in `block in find_in_batches'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:230:in `block in in_batches'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:214:in `loop'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:214:in `in_batches'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:128:in `find_in_batches'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/relation/batches.rb:62:in `find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.41/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake:8:in `block (4 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:upgrades:3.8:clear_checksum_type
(See full trace by running task with --trace)
foreman-rake katello:upgrades:3.8:clear_checksum_type failed! Check the output for error!
Upgrade step clear_checksum_type failed. Check logs for more information.
                                      [FAIL]
Failed executing LANG=en_US.utf-8 satellite-installer --upgrade, exit status 1
--------------------------------------------------------------------------------
Scenario [Migration scripts to Satellite 6.4] failed.

The following steps ended up in failing state:

  [installer-upgrade]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="installer-upgrade"


[root@satellite6 ~]# 


Version-Release number of selected component (if applicable):
6.4.0

How reproducible:
Always

Steps to Reproduce:
1. Update Satellite to 6.3.4
2. Try to upgrade to 6.4.0
3.

Actual results:
Upgrade fails

Expected results:
Upgrade completes successfully

Additional info:

Comment 7 Stephen Benjamin 2018-11-20 17:31:22 UTC
Created redmine issue https://projects.theforeman.org/issues/25518 from this bug

Comment 9 vijsingh 2019-01-23 12:50:55 UTC
Verified:

@Satellite 6.5.0 Snap 12.0

Steps/Observation:

  - Installed Satellite on 6.4.1 GA version
  - Create repo and updated upstream username only
  - Upgraded Satellite @Satellite 6.5.0 Snap 12.0
  - Post-upgrade upstream username does not exists

  - Post upgrade tried below on a different repo and invalid credentials getting clean too with "katello:upgrades:3.10:clear_invalid_repo_credentials"
  
   # foreman-rake console
   irb(main):001:0> repo = Katello::RootRepository.last
   irb(main):002:0> repo.upstream_username = 'potato'
   => "potato"
   irb(main):003:0> repo.save!(validate: false)
   => true
   irb(main):004:0> exit
      
   # katello:upgrades:3.10:clear_invalid_repo_credentials

Comment 14 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