Bug 1183114 - Satellite 6.0 manifest cannot be refreshed after updating entitlements
Summary: Satellite 6.0 manifest cannot be refreshed after updating entitlements
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.0.4
Hardware: All
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2015-01-16 17:52 UTC by Andrew Sanders
Modified: 2019-09-26 13:52 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-20 18:32:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0247 0 normal SHIPPED_LIVE Red Hat Satellite 6 server bug fix update 2015-02-20 23:30:44 UTC

Description Andrew Sanders 2015-01-16 17:52:17 UTC
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.

Comment 1 RHEL Program Management 2015-01-16 17:53:27 UTC
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.

Comment 5 David Davis 2015-01-17 20:07:33 UTC
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'

Comment 6 Partha Aji 2015-01-17 20:07:55 UTC
Created redmine issue http://projects.theforeman.org/issues/9011 from this bug

Comment 7 David Davis 2015-01-20 15:57:49 UTC
Created a patch for this bug:

https://github.com/Katello/katello/pull/4944

Waiting on Mike McCune to test/review it.

Comment 10 Chris Roberts 2015-01-21 22:12:59 UTC
Created attachment 982538 [details]
debugs

Comment 12 Bryan Kearney 2015-01-23 13:05:09 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9011 has been closed
-------------
David Davis
Applied in changeset commit:katello|90f0f8e1f06401826f12e775765aef32eb3f3e16.

Comment 18 jaudet 2015-02-11 18:17:37 UTC
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.

Comment 20 errata-xmlrpc 2015-02-20 18:32:20 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, 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


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