Project

General

Profile

Bug #15817

Handle 'use latest' correctly when removing puppet modules from CVs

Added by Brad Buckingham over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web UI
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1317978
Cloning bug to 6.2

In Satellite 6.1, users are allowed to remove puppet content even if there are CVs that reference the content with the 'use latest' option set. This is confusing, since if the module is deleted, there's no more 'latest' version.
Ideally, we would not allow removal of puppet content from a product if any CV has 'latest' set. Instead, present the user with an error message listing which CVs need to be adjusted.
++ This bug was initially created as a clone of Bug #1271000 ++
Description of problem:
Customer has published a content view with a Puppet module and deployed that to a puppet agent. Now he has deleted the puppet module from the Product without removing the same from the content view. After this while navigating to the "Puppet Modules" tab under the content view page, only the loading spinner is rotating and there is no error message also.
Version-Release number of selected component (if applicable):
Satellite v 6.1.2
How reproducible:
Always
Steps to Reproduce:
1. Create a product.
2. Create a puppet type repo in this product.
3. Manually upload a puppet module to this repo.
4. Create and publish a Content View with this puppet module.
5. Deploy the puppet module to a puppet agent.
6. Delete the puppet module from the product.
7. Attempt to view the Puppet Modules tab of the affected CV
Actual results:
The spinner is rotating without any errors in the WebUI.
Expected results:
1. Satellite should block the deletion task with some error message like "You cannot remove this module since it is associated to a Host".
2. The content view should continue to work without any issues.
Additional info:
Got the below error message from the "foreman-tail", while navigating to the "Puppet Modules" tab.
> /var/log/httpd/foreman-ssl_access_ssl.log <
10.65.223.173 - - [10/Oct/2015:14:51:06 +0530] "GET /content-views/details/views/content-view-repositories.html HTTP/1.1" 200 1407 "https://satellite.example.com/content_views/17/versions" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" > /var/log/foreman/production.log <
2015-10-10 14:51:06 [I] Processing by Katello::Api::V2::RepositoriesController#index as JSON
2015-10-10 14:51:06 [I] Parameters: {"content_type"=>"yum", "content_view_id"=>"17", "full_result"=>"true", "organization_id"=>"3", "page"=>"1", "search"=>"", "api_version"=>"v2"} > /var/log/httpd/foreman-ssl_access_ssl.log <
10.65.233.127 - - [10/Oct/2015:14:51:06 +0530] "GET /pulp/api/v2/repositories/deepan_vdc_org-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server/?details=true HTTP/1.1" 200 25369 "-" "Ruby"
10.65.233.127 - - [10/Oct/2015:14:51:10 +0530] "GET /pulp/api/v2/tasks/c48e1e40-f7b0-4bea-b745-a28ffc12b5d7/ HTTP/1.1" 200 2153 "-" "Ruby"
10.65.233.127 - - [10/Oct/2015:14:51:11 +0530] "GET /pulp/api/v2/repositories/deepan_vdc_org-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_RH_Common_RPMs_x86_64_7Server/?details=true HTTP/1.1" 200 25384 "-" "Ruby"
10.65.233.127 - - [10/Oct/2015:14:51:11 +0530] "GET /pulp/api/v2/repositories/deepan_vdc_org-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server/?details=true HTTP/1.1" 200 25329 "-" "Ruby"
10.65.233.127 - - [10/Oct/2015:14:51:11 +0530] "GET /pulp/api/v2/repositories/deepan_vdc_org-Red_Hat_Enterprise_Linux_Server-RHN_Tools_for_Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server/?details=true HTTP/1.1" 200 25401 "-" "Ruby"
10.65.223.173 - - [10/Oct/2015:14:51:06 +0530] "GET /katello/api/v2/repositories?content_type=yum&content_view_id=17&full_result=true&organization_id=3&page=1&search= HTTP/1.1" 200 3334 "https://satellite.example.com/content_views/17/versions" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" > /var/log/foreman/production.log <
2015-10-10 14:51:11 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/views/katello/api/v2/repositories/index.json.rabl within katello/api/v2/layouts/collection (5135.4ms)
2015-10-10 14:51:11 [I] Completed 200 OK in 5393ms (Views: 5118.0ms | ActiveRecord: 30.0ms) > /var/log/httpd/foreman-ssl_access_ssl.log <
10.65.223.173 - - [10/Oct/2015:14:51:16 +0530] "GET /content-views/details/puppet-modules/views/content-view-puppet-modules.html HTTP/1.1" 200 760 "https://satellite.example.com/content_views/17/repositories/yum" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36"
10.65.223.173 - - [10/Oct/2015:14:51:16 +0530] "GET /katello/api/v2/content_views/17/content_view_puppet_modules?organization_id=3&page=1&paged=true&search= HTTP/1.1" 500 121 "https://satellite.example.com/content_views/17/repositories/yum" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" > /var/log/foreman/production.log <
2015-10-10 14:51:16 [I] Processing by Katello::Api::V2::ContentViewPuppetModulesController#index as JSON
2015-10-10 14:51:16 [I] Parameters: {"organization_id"=>"3", "page"=>"1", "paged"=>"true", "search"=>"", "api_version"=>"v2", "content_view_id"=>"17"}
2015-10-10 14:51:16 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl within katello/api/v2/layouts/collection (50.8ms)
2015-10-10 14:51:16 [E] NoMethodError: undefined method `version' for nil:NilClass
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/models/katello/content_view_puppet_module.rb:38:in `computed_version'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/helpers.rb:18:in `data_object_attribute'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:77:in `attribute'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:38:in `block in compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:37:in `each_pair'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:37:in `compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:21:in `block in build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:166:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:20:in `build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:51:in `to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:285:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/partials.rb:27:in `object_to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/partials.rb:14:in `partial'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:124:in `extends'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:34:in `block in compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:33:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:33:in `compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:21:in `block in build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:166:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:20:in `build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:53:in `block in to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `map'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `map'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:53:in `to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:285:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/partials.rb:27:in `object_to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:108:in `child'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:46:in `block in compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:45:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:45:in `compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:21:in `block in build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:166:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:20:in `build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:51:in `to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:285:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/partials.rb:27:in `object_to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/partials.rb:14:in `partial'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:124:in `extends'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:34:in `block in compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:33:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:33:in `compile_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:21:in `block in build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:166:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/builder.rb:20:in `build'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:51:in `to_hash'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:63:in `to_json'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:285:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl:1:in `__opt_rh_ruby____root_usr_share_gems_gems_katello__________app_views_katello_api_v__content_view_puppet_modules_index_json_rabl___844917533928467896_90300260'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:45:in `render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:18:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:36:in `render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:17:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:110:in `_render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/streaming.rb:225:in `_render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:103:in `render_to_body'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:16:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:295:in `realtime'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/lib/katello/api/v2/rendering.rb:48:in `respond_with_template'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/lib/katello/api/v2/rendering.rb:63:in `respond_with_template_collection'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/lib/katello/api/v2/rendering.rb:76:in `try_specific_collection_template'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/lib/katello/api/v2/rendering.rb:11:in `respond_for_index'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/controllers/katello/concerns/api/api_controller.rb:94:in `respond'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb:34:in `index'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:539:in `block (4 levels) in run_1311309054001762424__process_action__3346382018427608631__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in conditional_callback_around_11512'
/usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_11512'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:505:in `block (3 levels) in _run
_1311309054001762424__process_action__3346382018427608631__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in conditional_callback_around_11511'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_3947'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_11511'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:493:in `block (2 levels) in _run
_1311309054001762424__process_action__3346382018427608631__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in conditional_callback_around_11510'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_11510'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:426:in `block in _run
_1311309054001762424__process_action__3346382018427608631__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in conditional_callback_around_11509'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_13'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_11509'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run
_1311309054001762424__process_action__3346382018427608631__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/app/controllers/katello/concerns/api/api_controller.rb:59:in `process_action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:42:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.5/lib/apipie/extractor/recorder.rb:97:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.5/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__659823101197188838__call__566524803176509328__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.67/lib/katello/middleware/silenced_logger.rb:29:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:134:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in `block in call'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `call'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
/opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2015-10-10 14:51:16 [I] Completed 500 Internal Server Error in 461ms (Views: 0.3ms | ActiveRecord: 1.6ms) > /var/log/httpd/foreman-ssl_access_ssl.log <
10.65.233.127 - - [10/Oct/2015:14:51:26 +0530] "GET /pulp/api/v2/tasks/c48e1e40-f7b0-4bea-b745-a28ffc12b5d7/ HTTP/1.1" 200 2153 "-" "Ruby"
--- Additional comment from RHEL Product and Program Management on 2015-10-13 14:20:38 EDT ---
Since this issue was entered in Red Hat Bugzilla, the pm_ack has been
set to + automatically for the next planned release
--- Additional comment from Simon Reber on 2015-10-21 08:13:07 EDT ---
Since it did not stop him from removing the module he is now left with a not working Satellite 6.1.2 and required to remove all existing and affected content view and rebuild everything from scratch.
--- Additional comment from Xixi on 2015-10-27 10:44:20 EDT ---
sat-prio thread http://post-office.corp.redhat.com/archives/sat6-prio/2015-October/msg00087.html
--- Additional comment from Mike McCune on 2015-10-27 12:06:33 EDT ---
moving this into 6.1.Z, scheduling for 6.1.5 in December.
--- Additional comment from Chris Roberts on 2015-10-27 12:11:54 EDT ---
Error in Postgres:
ERROR:  duplicate key value violates unique constraint "cp_env_cnt_env_id_cntid_ky" 
DETAIL: Key (environment_id, contentid)=(4-15, 4188) already exists.
STATEMENT: insert into cp_env_content (created, updated, contentId, enabled, environment_id, id) values ($1, $2, $3, $4, $5, $6)
ERROR: current transaction is aborted, commands ignored until end of transaction block
STATEMENT: SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME, CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema' WHEN true THEN CASE WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind WHEN 'r' THEN 'SYSTEM TABLE' WHEN 'v' THEN 'SYSTEM VIEW' WHEN 'i' THEN 'SYSTEM INDEX' ELSE NULL END WHEN n.nspname = 'pg_toast' THEN CASE c.relkind WHEN 'r' THEN 'SYSTEM TOAST TABLE' WHEN 'i' THEN 'SYSTEM TOAST INDEX' ELSE NULL END ELSE CASE c.relkind WHEN 'r' THEN 'TEMPORARY TABLE' WHEN 'i' THEN 'TEMPORARY INDEX' WHEN 'S' THEN 'TEMPORARY SEQUENCE' WHEN 'v' THEN 'TEMPORARY VIEW' ELSE NULL END END WHEN false THEN CASE c.relkind WHEN 'r' THEN 'TABLE' WHEN 'i' THEN 'INDEX' WHEN 'S' THEN 'SEQUENCE' WHEN 'v' THEN 'VIEW' WHEN 'c' THEN 'TYPE' WHEN 'f' THEN 'FOREIGN TABLE' ELSE NULL END ELSE NULL END AS TABLE_TYPE, d.description AS REMARKS FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0) LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class') LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog') WHERE c.relnamespace = n.oid AND c.relname LIKE 'PROBABLYNOT' AND (false OR ( c.relkind = 'r' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema' ) ) ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME
ERROR: syntax error at or near "quit" at character 1
STATEMENT: quit
--- Additional comment from Chris Duryee on 2015-11-04 12:24:29 EST ---
I'm having some trouble reproducing this issue. Did you have to register an actual host to the Satellite to make it happen, or did you just create a host via the web UI and associate the puppet module with it?
--- Additional comment from Deepannagaraj Nagarathinam on 2015-11-04 12:38:17 EST ---
(In reply to Chris Duryee from comment #6)
> I'm having some trouble reproducing this issue. Did you have to register an
> actual host to the Satellite to make it happen, or did you just create a
> host via the web UI and associate the puppet module with it?
Hi Chris,
We need to deploy the puppet module (added to the content view) to the (actual) host registered to the Satellite.
--- Additional comment from Simon Reber on 2015-11-04 12:58:15 EST ---
(In reply to Chris Duryee from comment #6)
> I'm having some trouble reproducing this issue. Did you have to register an
> actual host to the Satellite to make it happen, or did you just create a
> host via the web UI and associate the puppet module with it?
In fact, there is no host need to be registerd to Satellite.
What you need to-do, is create a product that has puppet modules included. Add this product to a content view and make sure you assign some of the puppet modules to the content view.
When done, publish and promote the content view.
After that, go to Product and delete one of the puppet modules, that is assigned to the recently promoted content view.
Return back to the Content View and try to load the overview of puppet modules, assigned to the respective content view.
You will notice that it just keeps loading the page infinite without returning any value.
The only current way to resolve is to remove the content view and re-start from scratch.
So the fix should then introduce a check, that prevents users from deleting puppet modules that are still available in a promoted content view.
--- Additional comment from Bryan Kearney on 2015-11-18 12:45:02 EST ---
Pushing out of 6.1.5 due to capacity issues.
--- Additional comment from Mike McCune on 2015-12-17 10:08:38 EST ---
Pushing out of 6.1.6 due to capacity issues.
--- Additional comment from Chris Duryee on 2016-02-12 11:52:45 EST ---
repro steps I used:
  • create a new product
  • create a new puppet repo, no sync source
  • upload ntpd puppet module to repo
  • create a CV, go to add puppet modules page
  • add latest version of puppet module
  • view puppet repo details, it should show "Latest (Currently X.Y.Z)"
  • go back to product, drill down into repo and delete puppet module
  • go back to same CV puppet module details page, you'll get a spinner that goes forever and there will be a 500 error in the log
The bug is that the area that creates the "Latest (Currently X.Y.Z)" string wasnt handling a null value, which is what you get if the repo is deleted. What you should see with the fix is "Unable to determine version" when we can't figure out the version.
--- Additional comment from Chris Duryee on 2016-02-12 12:14:44 EST ---
https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello/merge_requests/119
--- Additional comment from  on 2016-02-12 12:33:05 EST ---
New test is created and will be automated soon. https://github.com/SatelliteQE/robottelo/pull/3290
--- Additional comment from Bryan Kearney on 2016-02-26 10:39:44 EST ---
This bug was included in SNAP1 which was delivered on 25 February, 2016.
--- Additional comment from Mike McCune on 2016-02-26 13:32:25 EST ---
Targeting this for a 6.1.9 release.
--- Additional comment from Mike McCune on 2016-03-07 17:53:57 EST ---
MODIFIED: 
https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello/merge_requests/119
--- Additional comment from Mike McCune on 2016-03-10 13:55:23 EST ---
6.1.8 ON_QA move.
--- Additional comment from Sachin Ghai on 2016-03-11 08:15:54 EST ---
Verified with Satellite 6.1.8
I performed following steps to reproduce the issue:
1) created a product
2) created puppet type repo without URL
3) uploaded a motd puppet module
4) created a CV
5) added puppet module along with other rhel repo
6) selected the latest version
7) published the CV
8) Now removed the puppet modules from product -> puppet repo
Puppet module was deleted successfully, however a exception raised in production.log:
--
2016-03-11 13:50:29 [I] Processing by Katello::Api::V2::RepositoriesController#remove_content as JSON
2016-03-11 13:50:29 [I] Parameters: {"id"=>"10", "uuids"=>["06a5a280-572a-4b0e-a21b-15bec164bfda"], "organization_id"=>"1", "api_version"=>"v2", "repository"=>{"id"=>"10"}}
2016-03-11 13:50:39 [E] undefined method `[]' for nil:NilClass (NoMethodError)
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.84/app/lib/actions/pulp/repository/distributor_publish.rb:35:in `distributor_id'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.84/app/lib/actions/pulp/repository/distributor_publish.rb:27:in `invoke_external_task'
/opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.7.9/lib/dynflow/action/polling.rb:83:in `initiate_external_action'
/opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.7.9/lib/dynflow/action/polling.rb:18:in `run'
/opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.7.9/lib/dynflow/action/cancellable.rb:9:in `run'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.84/app/lib/actions/pulp/abstract_async_task.rb:57:in `run'
--
Later, when I checked content-view --> puppet-module tab, I still found the listing of motd puppet module. Please see the screenshot.
So what is expected here ?
Can user delete the puppet-module fro products if its part of published CV ?
and shouldn't it be removed from CV if it can be removed from products ?
Please advice what is expected ?
--- Additional comment from Sachin Ghai on 2016-03-11 08:17 EST ---
--- Additional comment from Chris Duryee on 2016-03-11 09:25:08 EST ---
I believe the deletion behavior itself is OK, deleting something from a product (puppet module, rpm, etc) should not remove the units from CVs.
I am looking into the stack trace now.
--- Additional comment from Simon Reber on 2016-03-11 09:28:18 EST ---
(In reply to Chris Duryee from comment #20)
> I believe the deletion behavior itself is OK, deleting something from a
> product (puppet module, rpm, etc) should not remove the units from CVs.
>
> I am looking into the stack trace now.
This bug is about when removing something from a product that is used in a Content View that it breaks the Content view.
So basically removing something within a product that is used within a Content View should simply not be possible and raise an error to the customer, telling that he first needs to remove the respective Content View before removing product.
--- Additional comment from Bryan Kearney on 2016-03-11 10:06:11 EST ---
Upstream bug component is Content Management
--- Additional comment from Chris Duryee on 2016-03-11 11:35:18 EST ---
Simon,
I think we are close on agreement on how this should work. Here is a scenario I tested:
add puppet repo to product
add puppet module to CV (in this case, 'ntpd' module)
publish CV version 1.0, confirm ntpd module is under /etc/puppet/environments
go back to product, click 'manage puppet modules', remove ntpd module
go to CV again, click "puppet modules" tab which shows that the puppet module is still there (page no longer creates an error)
confirm ntpd module is still there under /etc/puppet/environments
publish CV version 2.0, 'ntpd' module is no longer under /etc/puppet/environments (this is a bug, it's trying to find the latest version and failing. IMO this is an improvement over previous behavior at least, since users are no longer blocked)
promote CV version 1.0 to a new environment, puppet module is in /etc/puppet/environments and shown in published version in web UI even though we deleted it from the product (this is correct, published CVs are immutable)

I think if a puppet module is deleted from a product, we should either:
  • block deletion until all 'use latest' versions are flipped to specific versions, or
  • go through and flip all 'use latest' to pin them to the last known version we have in the CV
I would vote for #1 since it would cause the least amount of surprise by the user.
I think though that if the user has selected a specific version and associated it with a CV, then that version should stay associated even after deletion from the product. The CV should  not be impacted by things that happen in the product IMO, unless the 'use latest' flag is set.
Does this seem congruent with your thoughts on this bug?
--- Additional comment from Tom McKay on 2016-03-11 12:56:54 EST ---
What is the behavior of "use latest" for RPMs when the RPM is removed from the product? I would wish the same behavior.
--- Additional comment from Chris Duryee on 2016-03-15 09:33:08 EDT ---
It sounds like there are some additional features that would be useful, related to the 'latest' functionality. However, I don't think it would be good to add them to a 6.1.z release.
Sachin,
Would you be comfortable with verifying this bug since the page no longer raises a 500 error, and we can track the additional changes requested in a new BZ?
--- Additional comment from Simon Reber on 2016-03-15 09:43:58 EDT ---
(In reply to Chris Duryee from comment #23)
> Simon,
>
> I think we are close on agreement on how this should work. Here is a
> scenario I tested:
>
> add puppet repo to product
> add puppet module to CV (in this case, 'ntpd' module)
> publish CV version 1.0, confirm ntpd module is under /etc/puppet/environments
> go back to product, click 'manage puppet modules', remove ntpd module
>
> go to CV again, click "puppet modules" tab which shows that the puppet
> module is still there (page no longer creates an error)
> confirm ntpd module is still there under /etc/puppet/environments
>
> publish CV version 2.0, 'ntpd' module is no longer under
> /etc/puppet/environments (this is a bug, it's trying to find the latest
> version and failing. IMO this is an improvement over previous behavior at
> least, since users are no longer blocked)
>
> promote CV version 1.0 to a new environment, puppet module is in
> /etc/puppet/environments and shown in published version in web UI even
> though we deleted it from the product (this is correct, published CVs are
> immutable)
I'm not sure that this is the intended functionality. I think we should not allow deleting anything out of products that is actively used within a Content View. I think your solution does somehow resolve the problem. But what, if somebody does delete a module by mistake. During the next publish and propagate we simply lose this functionality.
If we would would prevent the user from deleting the module because it's still used in a Content View we could avoid that and the user would actually need to follow a work-flow to properly remove the module before deleting it.
> ***
>
>
> I think if a puppet module is deleted from a product, we should either:
>
> * block deletion until all 'use latest' versions are flipped to specific
> versions, or
> * go through and flip all 'use latest' to pin them to the last known
> version we have in the CV
>
> I would vote for #1 since it would cause the least amount of surprise by the
> user.
>
> I think though that if the user has selected a specific version and
> associated it with a CV, then that version should stay associated even after
> deletion from the product. The CV should not be impacted by things that
> happen in the product IMO, unless the 'use latest' flag is set.
>
> Does this seem congruent with your thoughts on this bug?
As I said, I don't think we should allow them to delete a module/product as long as it's actively used in a Content View.
--- Additional comment from Chris Duryee on 2016-03-15 12:16:29 EDT ---
Sachin,
I was able to repro the stack trace with the following steps:
  • create new custom product
  • add a puppet repo, add one module to repo
  • remove module from repo
The problem is that in Katello 2.2, puppet repos associated with products have no distributors, so when the metadata generate task runs, it fails. This is an error that should be fixed, but should not affect functionality.
In Katello 3.0, puppet repos associated with products have a distributor so this should no longer happen. If you want, I can create a new bug for this issue so we can ensure it gets addressed.
--- Additional comment from Chris Duryee on 2016-03-15 12:26:42 EDT ---
bug for behavior in #27 https://bugzilla.redhat.com/show_bug.cgi?id=1317976

Associated revisions

Revision 8de4f8a9 (diff)
Added by David Davis over 2 years ago

Fixes #15817 - Fix publishing CV after puppet module removed (#6254)

History

#1 Updated by Brad Buckingham over 2 years ago

#2 Updated by Justin Sherrill over 2 years ago

  • Subject changed from Handle 'use latest' correctly when removing puppet modules from CVs to Handle 'use latest' correctly when removing puppet modules from CVs
  • Legacy Backlogs Release (now unused) set to 162

#3 Updated by Brad Buckingham over 2 years ago

  • Target version set to 123

#4 Updated by Brad Buckingham over 2 years ago

#5 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6254 added

#6 Updated by Anonymous over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF