Bug 2028205

Summary: db:seed can fail when there are host mismatches
Product: Red Hat Satellite Reporter: Jonathon Turel <jturel>
Component: Hosts - ContentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Stephen Wadeley <swadeley>
Severity: high Docs Contact:
Priority: high    
Version: 6.10.0CC: aeladawy, ahumbe, dmule, fgarciad, hakon.gislason, momran, msunil, nkim, onerleka, osousa, pcreech, pmendezh, pmoravec, rcavalca, risantam, rrajput, sadas, saydas, zhunting
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-4.3.0-1.el7sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2043705 (view as bug list) Environment:
Last Closed: 2022-07-05 14:30:33 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 Jonathon Turel 2021-12-01 17:30:48 UTC
Description of problem:

upgrading to 6.10 can fail when running db:seed in this way:

rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Environments expecting environments used by hosts or inherited (check mismatches report).
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/validations.rb:53:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:318:in `block in save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:318:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/suppressor.rb:48:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39/app/lib/katello/lazy_accessor.rb:67:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-4.1.5/app/models/foreman_tasks/concerns/action_triggering.rb:31:in `block in save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-4.1.5/app/models/foreman_tasks/concerns/action_triggering.rb:127:in `dynflow_task_wrap'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-4.1.5/app/models/foreman_tasks/concerns/action_triggering.rb:31:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39/app/services/katello/organization_creator.rb:31:in `block in seed!'


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

Installer fails to proceed

Expected results:

db:seed continues and does not block the installer


Additional info:

Comment 1 Jonathon Turel 2021-12-01 17:34:53 UTC
Created redmine issue https://projects.theforeman.org/issues/34059 from this bug

Comment 2 Jonathon Turel 2021-12-01 20:13:09 UTC
*** Bug 2019467 has been marked as a duplicate of this bug. ***

Comment 21 Bryan Kearney 2022-01-06 20:04:44 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34059 has been resolved.

Comment 24 Ahmed Eladawy 2022-02-16 10:17:10 UTC
*** Bug 2028786 has been marked as a duplicate of this bug. ***

Comment 28 errata-xmlrpc 2022-07-05 14:30:33 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 (Moderate: Satellite 6.11 Release), 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-2022:5498