Bug 1292898

Summary: 403 (Forbidden) errors for katello-disconnected sync of CloudForms repository
Product: Red Hat Quickstart Cloud Installer Reporter: Thom Carlin <tcarlin>
Component: DistributionAssignee: Jesus M. Rodriguez <jesusr>
Status: CLOSED CURRENTRELEASE QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0CC: apagac, arubin, bkearney, bmbouter, daviddavis, dkliban, ggainey, ipanova, jesusr, jmatthew, mhrivnak, pcreech, rchan, tcarlin, ttereshc
Target Milestone: TP2Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The disconnected server was only able to handle rpm repositories, not ISO repositories. The code was updated to support iso repositories as well.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-03 19:19:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1295880    
Bug Blocks: 1291836    

Description Thom Carlin 2015-12-18 16:52:04 UTC
Description of problem:

When attempting to setup a disconnected environment, receive 503 (Forbidden) errors for katello-disconnected sync of CloudForms.

Version-Release number of selected component (if applicable):

TP2

How reproducible:

100%

Steps to Reproduce:
1. Follow Sat 6 steps to setup disconnected environment, using RHCS-I repositories
2.
3.

Actual results:

sync for CloudForms goes to Error

Expected results:

Successful sync

Additional info:

Relevant log entries:
pulp: pulp_rpm.plugins.importers.yum.sync:INFO: Downloading metadata from https://cdn.redhat.com/content/dist/cf-me/server/5.3/x86_64/files/.
pulp: requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): cdn.redhat.com
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520) sync failed
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520) Traceback (most recent call last):
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 141, in run
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520)     metadata_files = self.get_metadata()
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 221, in get_metadata
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520)     raise FailedException(str(e))
pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: (6021-39520) FailedException: Forbidden
pulp: celery.worker.job:ERROR: (4211-39520) Task pulp.server.managers.repo.sync.sync[51d5f2f4-459d-478a-a97e-fed7d21a5560] raised unexpected: PulpExecutionException('Importer indicated a failed response',)
celery.worker.job:ERROR: (4211-39520) Traceback (most recent call last):
pulp: celery.worker.job:ERROR: (4211-39520)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
pulp: celery.worker.job:ERROR: (4211-39520)     R = retval = fun(*args, **kwargs)
pulp: celery.worker.job:ERROR: (4211-39520)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 328, in __call__
pulp: celery.worker.job:ERROR: (4211-39520)     return super(Task, self).__call__(*args, **kwargs)
celery.worker.job:ERROR: (4211-39520)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
pulp: celery.worker.job:ERROR: (4211-39520)     return self.run(*args, **kwargs)
pulp: celery.worker.job:ERROR: (4211-39520)   File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/sync.py", line 114, in sync
pulp: celery.worker.job:ERROR: (4211-39520)     raise PulpExecutionException(_('Importer indicated a failed response'))
pulp: celery.worker.job:ERROR: (4211-39520) PulpExecutionException: Importer indicated a failed response

Comment 1 Michael Hrivnak 2015-12-18 17:46:50 UTC
It appears that you are trying to sync it as a yum repository, but the URL specified does not point to a yum repository. I think you want to try importing it as an "iso" repository as pulp calls it. I'm not sure what exactly that looks like in the Sat6 UI.

Also, I assume you meant 403 Forbidden, and not 503 Service Unavailable?

Comment 2 pulp-infra@redhat.com 2015-12-18 18:00:20 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 3 pulp-infra@redhat.com 2015-12-18 18:00:22 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 4 Thom Carlin 2015-12-18 21:22:26 UTC
yes, 403 (updated title).

I am merely running katello-disconnected against a manifest (for a specific repository in that manifest), *not* specifying yum or iso repository.  If it is incorrect, we need to determine whether the problem is with the manifest or katello-disconnected.

Comment 5 Thom Carlin 2015-12-21 13:41:18 UTC
The reproducibility is *not* 100%.  It was 100% when I was testing it but since then it is erratic (time-based issue, perhaps)?

Agreed, this appears to be defined incorrectly in the manifest as a "yum" type respository instead of an ISO repository.

Comment 9 pulp-infra@redhat.com 2016-01-05 21:00:23 UTC
The Pulp upstream bug status is at CLOSED - NOTABUG. Updating the external tracker on this bug.

Comment 10 Jesus M. Rodriguez 2016-01-19 14:35:39 UTC
Fixed by PR: 
https://github.com/Katello/katello-utils/pull/4

Comment 11 Jesus M. Rodriguez 2016-01-20 15:21:11 UTC
A patch to BZ #1295880 has been submitted both upstream and downstream. The error in the original comment was a direct result of katello-disconnected not being able to export ISO/image repos from pulp, it was not a pulp issue. 

Thom documented a valid workaround in Comment #8.

In the interim, one could install stock katello-disconnected then do the following two items:

1) apply this patch to the installed katello-disconnected:
https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello-misc/commit/0fe3919cb22f9db0f1a6728472d6e632e701f546.diff

2) After exporting the content with the patched katello-disconnected, there is yet another script to fix the deficiency in pulp with publishing ISO/image to the directory structure used by the CDN:

https://bugzilla.redhat.com/show_bug.cgi?id=1300046#c1

This will give you a valid content tree useful for deploying in disconnected mode.

Comment 12 Antonin Pagac 2016-02-23 08:59:40 UTC
I was able to setup a disconnected host using katello-disconnected and I saw no errors. Export and expand finished successfully. I still had to move the content as documented in bug 1300046
Marking as verified.

katello-utils-2.2.6-1.el7sat.noarch