Bug 1474249 - Satellite shouldn't allow to delete the default organization of a puppet content view environment generated by Katello.
Summary: Satellite shouldn't allow to delete the default organization of a puppet cont...
Keywords:
Status: CLOSED DUPLICATE of bug 1479736
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.2.10
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-24 08:33 UTC by Hao Chang Yu
Modified: 2021-12-10 15:10 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1479736 (view as bug list)
Environment:
Last Closed: 2017-08-22 13:58:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hao Chang Yu 2017-07-24 08:33:44 UTC
Description of problem:
When a restricted user trying to promote a content view, Satellite will attempt to destroy the puppet environment content view. This is due to the fact that the puppet environment content view doesn't have any organization and cause the restricted user cannot find it.

Steps to Reproduce:
1. Create a content view with puppet modules
2. Publish and promote it to a life cycle environment, such as develop
3. Add the generated puppet content view environment to a hostgroup or host.
3. Go to Configure > Environment > click the puppet environment cv, such as KT_org_develop_my_puppet_cv_1_36 > remove all organizations > Submit
4. Logout and Login as a restricted user
5. Publish and promote the content view again, then you should get the following error.

337: Actions::Katello::ContentViewPuppetEnvironment::Destroy (error) [ 2375.02s / 0.15s ]  Skip
Started at: 2017-07-06 21:51:15 UTC

Ended at: 2017-07-06 22:30:50 UTC

Real time: 2375.02s

Execution time (excluding suspended state): 0.15s

Input:

---
content_view_puppet_environment:
  id: <id>
  name: my-test-cv
Output:

--- {}
Error:

RuntimeError

---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/models/katello/model.rb:8:in
  `destroy!'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/lib/actions/katello/content_view_puppet_environment/destroy.rb:15:in
  `finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:528:in
  `block (2 levels) in execute_finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:26:in
  `call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:26:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware.rb:17:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action/progress.rb:30:in
  `with_progress_calculation'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action/progress.rb:22:in
  `finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:22:in
  `call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:26:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware.rb:17:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/lib/actions/middleware/keep_locale.rb:15:in
  `block in finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/lib/actions/middleware/keep_locale.rb:22:in
  `with_locale'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.137/app/lib/actions/middleware/keep_locale.rb:15:in
  `finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:22:in
  `call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:26:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware.rb:17:in
  `pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware.rb:38:in
  `finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/stack.rb:22:in
  `call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/middleware/world.rb:30:in
  `execute'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:527:in
  `block in execute_finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:419:in
  `call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:419:in
  `block in with_error_handling'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:419:in
  `catch'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:419:in
  `with_error_handling'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:526:in
  `execute_finalize'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.4/lib/dynflow/action.rb:260:in

The task has given a Runtime error without an error message. After some investigations, I found that puppet environment cannot be deleted because there is at least one hostgroup/host using it.

Actual results:
Satellite try to delete the puppet content view environment that is still in use by host/hostgroup

Expected results:
Satellite should not delete the puppet content view environment that is still in use by host/hostgroup

Comment 15 Ivan Necas 2017-08-09 10:01:01 UTC
I've created an additional BZ describing the behavior that leads to this state.

https://bugzilla.redhat.com/show_bug.cgi?id=1479736

Comment 16 Ivan Necas 2017-08-22 13:58:07 UTC
Given the fix in https://bugzilla.redhat.com/show_bug.cgi?id=1479736 should also lead to fixing this issue, I'm closing this issue as duplicate.

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


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