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 1945321 - foreman-rake katello:correct_puppet_environments fails when trying to make changes
Summary: foreman-rake katello:correct_puppet_environments fails when trying to make ch...
Keywords:
Status: CLOSED DUPLICATE of bug 1908101
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-31 16:37 UTC by Joniel Pasqualetto
Modified: 2024-06-14 01:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-05 13:32:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joniel Pasqualetto 2021-03-31 16:37:31 UTC
Description of problem:
Running "foreman-rake katello:correct_puppet_environments" works fine (COMMIT=false is implicit), but when changing it to COMMIT=true it fails.


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

Satellite 6.8

How reproducible:

Always

Steps to Reproduce:
1. Delete a repository on pulp, so there are changes to be made:
# pulp-admin puppet repo delete --repo-id 1-test2-v2_0-puppet-a968298d-b8f8-4daa-8f13-25c767521d3c
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Repository [1-test2-v2_0-puppet-a968298d-b8f8-4daa-8f13-25c767521d3c]
successfully deleted



2. Run the rake with commit=false:

~~~
# foreman-rake katello:correct_puppet_environments
All operations will be skipped.  Re-run with COMMIT=true to perform corrections.
Processing Puppet Environment 1/50: 1-RHEL7-v1_0-puppet-70fe1e72-5cf1-4667-b780-e0c1171a15fe (1)
Processing Puppet Environment 2/50: 1-RHEL8-v1_0-puppet-cf725cb1-7194-43b2-8046-3d34fe59b055 (2)
Processing Puppet Environment 3/50: 1-RHEL7-v2_0-puppet-391a7dde-3b44-4369-8533-d8e1141424be (3)

(...)

Processing Puppet Environment 50/50: 1-test2-v2_0-puppet-a968298d-b8f8-4daa-8f13-25c767521d3c (56)
Content View Puppet Environment 56 Missing, Creating.
~~~

See, that environment 56 is missing (the one I deleted on step 1):

3. Run it again with COMMIT=true:

~~~
# foreman-rake katello:correct_puppet_environments COMMIT=true
Processing Puppet Environment 1/50: 1-RHEL7-v1_0-puppet-70fe1e72-5cf1-4667-b780-e0c1171a15fe (1)
Processing Puppet Environment 2/50: 1-RHEL8-v1_0-puppet-cf725cb1-7194-43b2-8046-3d34fe59b055 (2)

(...)

Processing Puppet Environment 50/50: 1-test2-v2_0-puppet-a968298d-b8f8-4daa-8f13-25c767521d3c (56)
Content View Puppet Environment 56 Missing, Creating.
rake aborted!
The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/rails.rb:75:in `world'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:23:in `trigger'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:29:in `block in trigger_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:49:in `block in rails_safe_trigger_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:48:in `rails_safe_trigger_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:27:in `trigger_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/lib/foreman_tasks.rb:58:in `sync_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.18/lib/katello/tasks/repository.rake:157:in `handle_missing_puppet_env'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.18/lib/katello/tasks/repository.rake:80:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:70:in `block (2 levels) in find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:70:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:70:in `block in find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:136:in `block in find_in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:238:in `block in in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:222:in `loop'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:222:in `in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:135:in `find_in_batches'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:69:in `find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.18/lib/katello/tasks/repository.rake:77:in `with_index'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.18/lib/katello/tasks/repository.rake:77:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => katello:correct_puppet_environments
(See full trace by running task with --trace)

~~~

Actual results:

Rake fails and don't recreate the missing repository

Expected results:
Rake would recreate the missing repository

Additional info:

Comment 2 Joniel Pasqualetto 2021-03-31 16:55:46 UTC
Workaround:

Edit the file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.18/lib/katello/tasks/repository.rake and look to line 71. Its content should be like below:

~~~
  task :correct_puppet_environments => ["environment", "check_ping"] do
~~~

Change it to:

~~~
  task :correct_puppet_environments => ["environment", "disable_dynflow", "check_ping"] do
~~~

Comment 3 Brad Buckingham 2021-04-05 13:32:09 UTC

*** This bug has been marked as a duplicate of bug 1908101 ***


Note You need to log in before you can comment on or make changes to this bug.