Description of problem: Satellite 6.0 manifest cannot be refreshed after updating entitlements Version-Release number of selected component (if applicable): Satellite 6.0 How reproducible: Customer Satellite 6.0 is currently broken and issue is %100 repeatable Steps to Reproduce: 1. Add entitlements to manifest via the Red Hat Customer Portal 2. From the Satellite GUI attempt to 'Refresh Manifest' Actual results: The manifest is not refreshed and an error message indicating it has failed is printed in the GUI. Expected results: The new manifest will be updated to reflect the recent changes made in the Red Hat Customer Portal to the manifest. Additional info: There are errors logged in '/var/log/foreman/production.log' when the 'Refresh Manifest' button is clicked in the Satellite GUI. The main error that caught my attention is: DeleteRestrictionError: Cannot delete record because of dependent repositories Full sosreport and foreman-debug are attached to the SFDC case that will be attached to this bug.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
I reproduced this on master. Steps: 1. Create a manifest. Add an entitlement. 2. Upload your manifest to Sat 6 3. Import some repos 4. Go back to your manifest in the portal and remove your entitlement. 5. Refresh your manifest. Error: Error during manifest refresh: {"displayMessage"=>"Cannot delete record because of dependent repositories", "conflicts"=>["UNKNOWN"]} Cannot delete record because of dependent repositories (ActiveRecord::DeleteRestrictionError) /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/associations/builder/has_many.rb:63:in `block in define_restrict_depe ndency_method' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:419:in `block in _run__2267080065653584473__destroy__4 328099252031340246__callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12651' /home/dadavis/Projects/katello/app/models/katello/glue.rb:47:in `on_destroy' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12651' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:403:in `_run__2267080065653584473__destroy__4328099252 031340246__callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/callbacks.rb:254:in `destroy' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:254:in `block in destroy' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transacti on' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:254:in `destroy' /home/dadavis/Projects/katello/app/models/katello/glue.rb:93:in `destroy' /home/dadavis/Projects/katello/app/models/katello/glue/provider.rb:322:in `block in import_products_from_cp' /home/dadavis/Projects/katello/app/models/katello/glue/provider.rb:322:in `each' /home/dadavis/Projects/katello/app/models/katello/glue/provider.rb:322:in `import_products_from_cp' /home/dadavis/Projects/katello/app/models/katello/glue.rb:176:in `execute' /home/dadavis/Projects/katello/app/models/katello/glue.rb:126:in `block in process' /home/dadavis/Projects/katello/app/models/katello/glue.rb:113:in `each' /home/dadavis/Projects/katello/app/models/katello/glue.rb:113:in `process' /home/dadavis/Projects/katello/app/models/katello/glue.rb:35:in `on_save' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_10413' [166/1942] /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:403:in `_run__1305189568191205195__save__4328099252031 340246__callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_save_callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/callbacks.rb:264:in `create_or_update' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/persistence.rb:104:in `save!' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/validations.rb:56:in `save!' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:33:in `save!' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `block in save!' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transacti on' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `save!' /home/dadavis/Projects/katello/app/models/katello/glue/provider.rb:260:in `queue_import_manifest' /home/dadavis/Projects/katello/app/models/katello/glue/provider.rb:40:in `refresh_manifest' /home/dadavis/Projects/katello/app/lib/actions/katello/provider/manifest_refresh.rb:37:in `run' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/action.rb:456:in `block (3 levels) in execute_run' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `call' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `pass' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware.rb:16:in `pass' /home/dadavis/Projects/katello/app/lib/actions/middleware/propagate_candlepin_errors.rb:21:in `block in run' /home/dadavis/Projects/katello/app/lib/actions/middleware/propagate_candlepin_errors.rb:31:in `propagate_candlepin_errors' /home/dadavis/Projects/katello/app/lib/actions/middleware/propagate_candlepin_errors.rb:21:in `run' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:22:in `call' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `pass' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware.rb:16:in `pass' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:27:in `block in run' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:57:in `block (2 levels) in as_remote_user' /home/dadavis/Projects/katello/app/lib/katello/util/thread_session.rb:84:in `pulp_config' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:43:in `as_pulp_user' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:56:in `block in as_remote_user' /home/dadavis/Projects/katello/app/lib/katello/util/thread_session.rb:91:in `cp_config' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:38:in `as_cp_user' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:55:in `as_remote_user' /home/dadavis/Projects/katello/app/lib/actions/middleware/remote_action.rb:27:in `run' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:22:in `call' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `pass' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware.rb:16:in `pass' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/action/progress.rb:30:in `with_progress_calculation' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/action/progress.rb:16:in `run' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:22:in `call' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `pass' /home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/dynflow-0.7.5/lib/dynflow/middleware.rb:16:in `pass' /home/dadavis/Projects/katello/app/lib/actions/middleware/keep_locale.rb:23:in `block in run' /home/dadavis/Projects/katello/app/lib/actions/middleware/keep_locale.rb:34:in `with_locale'
Created redmine issue http://projects.theforeman.org/issues/9011 from this bug
Created a patch for this bug: https://github.com/Katello/katello/pull/4944 Waiting on Mike McCune to test/review it.
Created attachment 982538 [details] debugs
Moving to POST since upstream bug http://projects.theforeman.org/issues/9011 has been closed ------------- David Davis Applied in changeset commit:katello|90f0f8e1f06401826f12e775765aef32eb3f3e16.
Verified against two Satellite 6.0.8 systems, one running RHEL 6.6 and the other 7.0. Verification procedure: 1. In the portal, create a manifest and add a subscription to it. Download the manifest. 2. Upload the manifest to a satellite. 3. Sync some repositories provided by the manifest's subscriptions to the satellite. 4. In the portal, remove subscriptions from the manifest. 5. On the satellite, refresh the manifest. The outcome of the procedure is that all already-synced products are listed as orphaned. Snippet from /var/log/foreman/production.log: Orphaned Product id 9 found while refreshing/importing manifest. Orphaned Product id 10 found while refreshing/importing manifest. Orphaned Product id 11 found while refreshing/importing manifest. Orphaned Product id 12 found while refreshing/importing manifest. Orphaned Product id 13 found while refreshing/importing manifest. Orphaned Product id 14 found while refreshing/importing manifest. Orphaned Product id 15 found while refreshing/importing manifest. Orphaned Product id 16 found while refreshing/importing manifest. Orphaned Product id 17 found while refreshing/importing manifest. Orphaned Product id 18 found while refreshing/importing manifest. Orphaned Product id 19 found while refreshing/importing manifest. Orphaned Product id 20 found while refreshing/importing manifest. Orphaned Product id 21 found while refreshing/importing manifest. Orphaned Product id 22 found while refreshing/importing manifest. Orphaned Product id 23 found while refreshing/importing manifest. Orphaned Product id 24 found while refreshing/importing manifest. Orphaned Product id 25 found while refreshing/importing manifest.
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/RHBA-2015:0247