Bug 754442

Summary: Manifest import fails on creating repos in pulp
Product: [Retired] Katello Reporter: Tomas Strachota <tstrachota>
Component: Webservice APIAssignee: Ivan Necas <inecas>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: inecas, lzap
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-16 18:40:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 755097    

Description Tomas Strachota 2011-11-16 14:10:12 UTC
Description of problem:
Importing both lastest november manifests fail with creating repositories in Pulp. Variable substitution don't get listing files from a CDN. The CDN returns access denied. The body of the returned 401 html page is wrongly used instead of the listing file.


Version-Release number of selected component (if applicable):
katello-0.1.104-1.git.57.dab58b8
pulp-0.0.244-5
candlepin-0.4.25-1


Steps to Reproduce:
1. clean katello db
2. create a new org
3. import one of the fte november manifests into the org's redhat provider
  
Actual results:
No repo is created.

Expected results:
Repositories with substituted variables in paths for every content from the manifest should be created.

Comment 1 Tomas Strachota 2011-11-16 14:11:44 UTC
Katello log:

Started POST "/api/providers/5/import_manifest" for 127.0.0.1 at Wed Nov 16 14:00:04 +0100 2011
  Processing by Api::ProvidersController#import_manifest as JSON
  Parameters: {"id"=>"5", "import"=>#<ActionDispatch::Http::UploadedFile:0x7ff5cfbde5f8 @original_filename="fte2NovemberSamTest2.zip", @tempfile=#<File:/tmp/RackMultipart20111116-6976-1kaocg9-0>, @headers="Content-Disposition: form-data; name=\"import\"; filename=\"/home/tom/Work/manifests/fte2NovemberSamTest2.zip\"\r\nContent-Type: application/zip\r\n", @content_type="application/zip">}
Setting locale: en
Warden is authenticating admin against database
Setting current user thread-local variable to admin
Authorizing admin for api/providers/import_manifest
Importing manifest for provider Red Hat
Resource POST request: /candlepin/owners/Import_Org_87c3dba/imports, import#<File:0x7ff5cfa5e6b0>
Processing response: 204
Resource GET request: /candlepin/owners/Import_Org_87c3dba/pools?
Processing response: 200
Resource GET request: /candlepin/products/69
Processing response: 200
Resource GET request: /candlepin/products/RH0197181
Processing response: 200
Resource GET request: /candlepin/subscriptions
Processing response: 200
Resource GET request: /candlepin/subscriptions
Processing response: 200
CDN: Requesting path /content/beta/rhel/server/5/listing
CDN: Requesting path /content/beta/rhel/server/5/</HEAD><BODY>/listing
CDN: Requesting path /content/beta/rhel/server/5/Reference&#32;&#35;18&#46;e76ee93f&#46;1321448474&#46;6f6418/listing
CDN: Requesting path /content/beta/rhel/server/5/</HTML>/listing
CDN: Requesting path /content/beta/rhel/server/5/You don't have permission to access "http&#58;&#47;&#47;cdn&#46;redhat&#46;com&#47;content&#47;beta&#47;rhel&#47;server&#47;5&#47;listing" on this server.<P>/listing
CDN: Requesting path /content/beta/rhel/server/5/ /listing
CDN: Requesting path /content/beta/rhel/server/5/<TITLE>Access Denied</TITLE>/listing
CDN: Requesting path /content/beta/rhel/server/5/<H1>Access Denied</H1>/listing
CDN: Requesting path /content/beta/rhel/server/5/</BODY>/listing
CDN: Requesting path /content/beta/rhel/server/5/<HTML><HEAD>/listing
Resource PUT request: /pulp/api/repositories/, {"feed_cert_data":{"key":"-----BEGIN RSA PRIVATE KEY-----\n
...
BODY OF THE CERTIFICATE
...
\n-----END CERTIFICATE-----\n"},"feed":"https://cdn.redhat.com/content/beta/rhel/server/5/<HTML><HEAD>/<TITLE>Access Denied</TITLE>/source/iso","content_types":"file","groupid":["product:69","env:7","org:3"],"preserve_metadata":true,"arch":"<TITLE>Access Denied</TITLE>","relative_path":"Import_Org_87c3dba/Locker/Red_Hat_Enterprise_Linux_Server/Red_Hat_Enterprise_Linux_5_Server_Beta_Source_ISOs_HTMLHEAD_TITLEAccess_DeniedTITLE","name":"Red Hat Enterprise Linux 5 Server Beta Source ISOs HTMLHEAD TITLEAccess DeniedTITLE","id":"Import_Org_87c3dba-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_5_Server_Beta_Source_ISOs_HTMLHEAD_TITLEAccess_DeniedTITLE"}
Pulp does not support arch '<TITLE>Access Denied</TITLE>'

Comment 2 Tomas Strachota 2011-11-16 14:16:59 UTC
In the comment #0:
sed s/401/403/

Comment 3 Lukas Zapletal 2011-11-16 16:43:14 UTC
Is this related somehow to:

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

Comment 4 Ivan Necas 2011-11-16 16:47:43 UTC
@lukas
Not sure, this is about Katello -> CDN communication, that bug is about client -> Pulp. It should not be related directly. This bug is more about the new manifests (the old one work). But I can not confirm yet.

Comment 5 Ivan Necas 2011-11-16 18:40:01 UTC
I've fixed handling of unauthorized access with raising an exception (commit a6d896ff2e54fccc55aa9b822115a05b1e33ccd5 )

The november manifest can't work, because it has another issuer and will not be accepted by CDN. Since this kind of manifest needs communicate with CDN while importing, it has no use for Katello. Using the older one until we get new manifest is the best solution for the time being.