Bug 846828 - [RFE] Uploading a new manifest from a different distributor fails
[RFE] Uploading a new manifest from a different distributor fails
Status: CLOSED NEXTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity unspecified (vote)
: Unspecified
: --
Assigned To: Mike McCune
Garik Khachikyan
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-08 16:33 EDT by Vagner Farias
Modified: 2015-01-04 16:59 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-04 11:07:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
katello-debug output (1.46 MB, application/x-tar)
2012-08-08 16:33 EDT, Vagner Farias
no flags Details
curl output related to comment #7 (2.48 KB, text/plain)
2012-08-09 14:52 EDT, Vagner Farias
no flags Details

  None (edit)
Description Vagner Farias 2012-08-08 16:33:38 EDT
Created attachment 603109 [details]
katello-debug output

Description of problem:
CF System Engine was correctly working and syncing Red Hat content until my employee subscription expired, on 07/28/12. I had it renewed and generated a new manifest on 07/30/12 and successfully uploaded it to CF on 08/02/12. 

I continued using CF but I haven't noticed any issue until I tried to sync Red Hat content. I thought there was some issue with the manifest and generated a new one and uploaded it to CF, on 08/07/12, using the "Force" checkbox. According to the UI, this completed successfully (and it was very fast). However, I still couldn't sync Red Hat content (grinder log attached).

Then I tried to upload again the same manifest and it returned the following error message:

RestClient::BadRequest: Candlepin::Owner: 400 Bad Request {"displayMessage":"Owner has already imported from another distributor"} (POST /candlepin/owners/Red_Hat_SA_Lab/imports?force=true)

By mistake, today I uploaded this same manifest to the wrong organization (ACME_Corporation) and this process completed successfully. When I tried to upload it again to the correct organization (Red_Hat_SA_Lab), it returned:

RestClient::BadRequest: Candlepin::Owner: 400 Bad Request {"displayMessage":"This distributor has already been imported by another owner"} (POST /candlepin/owners/Red_Hat_SA_Lab/imports)

I used the "force" option to try again and it returned:

RestClient::BadRequest: Candlepin::Owner: 400 Bad Request {"displayMessage":"This distributor has already been imported by another owner"} (POST /candlepin/owners/Red_Hat_SA_Lab/imports?force=true)

Today I also noticed that the certificate at /etc/pki/pulp/content/Red_Hat_SA_Lab-Red_Hat_Enterprise_Linux_Server-Red_Hat_CloudForms_Tools_for_RHEL_6_RPMs_x86_64_6_3 is still the one that expired on 07/28/12, so it seems it was never updated.

Version-Release number of selected component (if applicable):
candlepin-0.6.5-1.el6_2.noarch
candlepin-tomcat6-0.6.5-1.el6_2.noarch
katello-0.1.319-1.el6cf.noarch
katello-all-0.1.319-1.el6cf.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.0.7-1.el6_3.noarch
katello-cli-0.1.113-1.el6cf.noarch
katello-cli-common-0.1.113-1.el6cf.noarch
katello-common-0.1.319-1.el6cf.noarch
katello-configure-0.1.111-1.el6cf.noarch
katello-glue-candlepin-0.1.319-1.el6cf.noarch
katello-glue-foreman-0.1.319-1.el6cf.noarch
katello-glue-pulp-0.1.319-1.el6cf.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-selinux-0.1.10-1.el6.noarch
pulp-1.0.4-1.el6.noarch
pulp-admin-1.0.4-1.el6.noarch
pulp-client-lib-1.0.4-1.el6.noarch
pulp-common-1.0.4-1.el6.noarch
pulp-selinux-server-1.0.4-1.el6.noarch


How reproducible:
Always on Red_Hat_SA_Lab organization

Steps to Reproduce:
1. Generate a manifest at Customer Portal
2. Upload it to CF System Engine thru web interface
  
Actual results:
Manifest is not uploaded. Message shown: This distributor has already been imported by another owner.

Expected results:
Manifest should be successfully uploaded.

Additional info:
ACME_Corporation is able to sync Red Hat content.
Comment 2 Justin Sherrill 2012-08-09 09:42:02 EDT
Hey Vagner,  

When you generated a new manifest, did you create a new distributor within the customer support portal?  or did you just generate a new manifest from an existing one?

-Justin
Comment 3 Vagner Farias 2012-08-09 10:22:32 EDT
Hello Justin,

I don't remeber how I generated this manifest I've already attached. However, I'll attach a new manifest I generated yesterday, after deleting the distributor and adding the subscriptions. I created the distributor with the same name, though (rhsalab).

This new manifest still can't be uploaded and I get exactly the same error.
Comment 5 Justin Sherrill 2012-08-09 14:01:02 EDT
Hi Vagner,

I discussed this at length with the candlepin developers and I believe you have discovered a fairly big hole in the functionality of System Engine.  Currently when creating a distributor within the support portal, creating a manifest, and importing it into an organization within system engine that distributor is locked to that organization.  You cannot import a manifest from another distributor into that organization.  So by deleting that distributor, you are never able to import another manifest into that same organization.  

Candlepin does provide a way to 'reset' an organization such that a new distributor's manifest can be imported, however this is not exposed in system engine (which is the giant hole in the product).  I believe this is being worked on within the next few weeks. 

So in the meantime, the only thing I can tell you to do is to create a new org and start over from scratch in that organization with a new distributor (i know how horrible this is).  If this isn't possible we may be able to find a way of calling candlepin directly to 'reset' that organization and allow a new distributor's manifest to be imported.  I'm not sure how involved this would be at the moment.

Hope that makes sense.

-Justin
Comment 6 Vagner Farias 2012-08-09 14:40:13 EDT
This is a brand new environment, so I can start over. However, I'd be interested in knowing how to reset the organization through Candlepin. Is there any documentation you could suggest me to take a look?
Comment 7 Vagner Farias 2012-08-09 14:50:34 EDT
One more question: how come I could upload a manifest for the first time (on 08/02/12)? Maybe this one I had generated before I deleted and recreated the distributor, but the certificate at /etc/pki/pulp/content/Red_Hat_SA_Lab-Red_Hat_Enterprise_Linux_Server-Red_Hat_CloudForms_Tools_for_RHEL_6_RPMs_x86_64_6_3 is still the original one, expired on 07/28/12. 

Could this be a different issue? See attached log.
Comment 8 Vagner Farias 2012-08-09 14:52:55 EDT
Created attachment 603337 [details]
curl output related to comment #7
Comment 9 Justin Sherrill 2012-08-09 17:52:04 EDT
With some further discussion even the api that candlepin provides today wouldn't quite do what we want.   It would delete all the subscription information (including products, content).  Upon importing a new manifest I'm not sure how katello would react to recreating everything and linking it back up with items in katello.  So for now, I wouldn't recommend trying that route.
Comment 10 Vagner Farias 2012-08-10 08:15:12 EDT
Ok. I already have a working environment again. Thanks!

I suggest that someone write a KB article about this until we have a solution. It took me a couple of days trying things cause I thought I was doing something wrong. :-)
Comment 11 Tom McKay 2012-08-21 11:22:23 EDT
This will require some work to solve. First, candlepin will need to be able handle removing the previous manifest and smoothly importing the new one from a different distributor. By "smoothly" I mean that the new subscriptions should smoothly overlay the old subscriptions to ease the burden on the user. Additionally, content already promoted and synced to pulp should be maintained "smoothly" as well.
Comment 13 Mike McCune 2012-09-10 11:21:51 EDT
moving to 2.0, no time left to fix in 1.1
Comment 14 Tom McKay 2013-04-17 07:41:08 EDT
This is the RFE to allow manifest deletion in katello (as it is possible in headpin).
Comment 15 Bryan Kearney 2014-09-04 11:07:37 EDT
Katello supports manifest deletion in the Satellite 6 GA release. I am closing this as NEXTRELEASE. If you believe this is an error, please feel free to re-open.

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