Bug 1332627 - Create repos in a way that pulp-admin can also manage them
Summary: Create repos in a way that pulp-admin can also manage them
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.2.0
Hardware: x86_64
OS: Linux
high
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 15:18 UTC by Pavel Moravec
Modified: 2021-04-06 17:57 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-04 18:48:14 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 2005 0 Normal CLOSED - WORKSFORME unable to use pulp-admin to publish rpm repository created with API 2016-12-09 15:32:01 UTC

Description Pavel Moravec 2016-05-03 15:18:15 UTC
Description of problem:
An attempt to call:

pulp-admin rpm repo publish run --repo-id whateverRepoID

fails with:

Missing resource(s):
repo_id=whateverRepoID, distributor_id=yum_distributor

That blocks fixing various pulp issues by managing repo content and re-publishing the repo again - that fails.


Interestingly, if I manage Satellite to call pulp.server.managers.repo.publish.publish, it succeeds. Just pulp-admin calling that fails.

More interestingly, inspecting repo_distributors mongo collection, it _has_ that distributor, but under different attribute:

"distributor_type_id" : "yum_distributor"

while pulp publish.py queries mongo:

repo_distributor = distributor_coll.find_one({'repo_id' : repo_id, 'id' : distributor_id})

So either mongo attribute has wrong name, or pulp publish.py queries wrong attribute (anyway changing the find_one accordingly does not help itself).



Version-Release number of selected component (if applicable):
Sat 6.1.8 (pulp 2.6.0.20-1)
Sat 6.2 Beta (pulp 2.8.1.3-1)


How reproducible:
100%


Steps to Reproduce:
1. Have synced some repos, optionally some CVs.
2. pulp-admin repo list  # just to have proper repo-id
3. pulp-admin rpm repo publish run --repo-id whateverRepoID


Actual results:
3. fails while logging to /var/log/messages:

May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400) Traceback (most recent call last):
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)     R = retval = fun(*args, **kwargs)
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 328, in __call__
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)     return super(Task, self).__call__(*args, **kwargs)
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)     return self.run(*args, **kwargs)
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)   File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/publish.py", line 83, in publish
May  3 17:16:25 pmoravec-sat61-rhel7 pulp: celery.worker.job:ERROR: (1740-74400)     raise MissingResource(repository=repo_id, distributor=distributor_id)


Expected results:
repo publish to succeed


Additional info:
Reproduced both in 6.1.8 and 6.2 beta. Fix in 6.2 GA is sufficient for me, ideally 6.1.9 backport is a plus. If not, pls. provide workaround.

Comment 6 pulp-infra@redhat.com 2016-11-21 18:53:37 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 7 pulp-infra@redhat.com 2016-11-21 18:53:40 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 9 pulp-infra@redhat.com 2016-12-09 15:32:02 UTC
The Pulp upstream bug status is at CLOSED - WORKSFORME. Updating the external tracker on this bug.

Comment 10 Brian Bouterse 2016-12-09 15:43:20 UTC
To have pulp-admin be able to manage Katello created repos, Katello would need to change the naming of its importers and distributors and likely other fields inside of those objects and repos. Those would be significant changes. Since those are all Katello changes, I'm setting the component to Content Management which was the component suggested in IRC.

I'm also retitling it to make it more clear that the required change is how the repo is created.

If that is something Katello wants to do, the easiest way to align with pulp-admin is to see what it does using the -vv flag when you have pulp-admin create a repository.

Comment 11 Michael Hrivnak 2016-12-13 16:28:00 UTC
+1 to everything Brian said.

I suspect katello will not want to do this, in which case this issue can probably be closed as wontfix.

FWIW we are happy to track pulp-admin RFEs upstream in our redmine. Since pulp-admin isn't part of the product, we're recommending that any pulp-admin RFE be tracked only upstream, even if it would be valuable to Satellite developers or support.

Comment 12 Justin Sherrill 2017-01-04 18:18:08 UTC
I'm fine updating the importers and distributors to use the new ids for new repos, but converting all the existing repos for an upgrade scenario would be too risky IMHO.   And without that its likely of limited value. 

I think we should get this for free with pulp 3.0, would you agree Michael?

Comment 13 Brian Bouterse 2017-01-04 18:42:47 UTC
I think with Pulp 3.0 it will take similar effort to align how pulp-admin and Katello use the API. The main difference I see with Pulp3 is the opportunity for the Pulp CLI to make backwards incompatible changes with its naming conventions. It's still going to take work, because even if the naming conventions of Katello were adopted by Pulp's CLI, the API is also changing, so Katello is going to have updates to make anyway. To realize this use case with Pulp3, I see work similar to what is described in Comment 12 as unavoidable.

Out of curiosity, does Katello publish it's naming conventions for importers, distributors, and repos anywhere?

What would be good for Pulp3 is for the naming conventions of Pulp's CLI to be consistent with itself and covered under semantic versioning. If Pulp published these conventions, Katello could adopt them as Katello ports to Pulp 3.0. This would involve an uber migration similar to what is described in Comment 12.

Maybe I'm thinking about this wrong, so I'm leaving the needsinfo for @mhrivnak.

Comment 14 Justin Sherrill 2017-01-04 18:47:47 UTC
Thanks for the reply brian!

To me its not about the naming conventions.  Katello doesn't really care what we name the ids.  We do name them a certain way but don't expect they will be named that way at all.  It could be randomly generated for all katello cares.  Katello looks up all distributors/importers by their type and I think an argument could be made that pulp-admin should do the same.  


After some discussion on IRC, this may or may not come with pulp 3.0.  I'm going to go ahead and close this as WONTFIX as'upgrading' customers to a new format would be too risky and not doing so would be of limited use


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