Project

Profile

Help

Issue #2005

closed

unable to use pulp-admin to publish rpm repository created with API

Added by mmccune@redhat.com over 8 years ago. Updated over 4 years ago.

Status:
CLOSED - WORKSFORME
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.8.3
Platform Release:
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Attempting to publish a repo via pulp admin results in error:

pulp.server.async.tasks:INFO: Task failed : [e967dad0-8565-4232-ae4d-43e1864d9878]
celery.worker.job:ERROR: (26888-89504) Task pulp.server.managers.repo.publish.publish[e967dad0-8565-4232-ae4d-43e1864d9878] raised unexpected: MissingResource({'resource_id': {'repo_id': u'Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Supplementary_RPMs_x86_64_7Server', 'dis
celery.worker.job:ERROR: (26888-89504) Traceback (most recent call last):
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
celery.worker.job:ERROR: (26888-89504)     R = retval = fun(*args, **kwargs)
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 473, in __call__
celery.worker.job:ERROR: (26888-89504)     return super(Task, self).__call__(*args, **kwargs)
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 103, in __call__
celery.worker.job:ERROR: (26888-89504)     return super(PulpTask, self).__call__(*args, **kwargs)
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
celery.worker.job:ERROR: (26888-89504)     return self.run(*args, **kwargs)
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 959, in publish
celery.worker.job:ERROR: (26888-89504)     dist = model.Distributor.objects.get_or_404(repo_id=repo_id, distributor_id=dist_id)
celery.worker.job:ERROR: (26888-89504)   File "/usr/lib/python2.7/site-packages/pulp/server/db/querysets.py", line 116, in get_or_404
celery.worker.job:ERROR: (26888-89504)     raise pulp_exceptions.MissingResource(**kwargs)
celery.worker.job:ERROR: (26888-89504) MissingResource: Missing resource(s): repo_id=Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Supplementary_RPMs_x86_64_7Server, distributor_id=yum_distributor
celery.worker.job:INFO: Task pulp.server.async.tasks._queue_reserved_task[70b02573-8930-4275-8016-5d2eb9881a76] succeeded in 0.0376972062513s: None

command:

# pulp-admin rpm repo publish run --repo-id Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Supplementary_RPMs_x86_64_7Server
+----------------------------------------------------------------------+
Publishing Repository
[Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7
_Server_-_Supplementary_RPMs_x86_64_7Server]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Task Failed

Missing resource(s):
repo_id=Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_
Linux_7_Server_-_Supplementary_RPMs_x86_64_7Server,
distributor_id=yum_distributor

Repo info from list:

Id:                  Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Ha
                     t_Enterprise_Linux_7_Server_-_Supplementary_RPMs_x86_64_7Se
                     rver
Display Name:        Red Hat Enterprise Linux 7 Server - Supplementary RPMs
                     x86_64 7Server
Description:         None
Content Unit Counts: 
  Erratum:                20
  Package Category:       1
  Package Group:          6
  Rpm:                    129
  Yum Repo Metadata File: 1
Actions #2

Updated by amacdona@redhat.com over 8 years ago

  • Subject changed from unable to publish rpm repository to As a user, distributor_id is an optional parameter to pulp-admin publish
  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes

For repos generated with the API, pulp-admin is unable to publish because it assumes an incorrect value for the distributor_id. To work around this, please use the API rather than pulp-admin to publish.

Actions #3

Updated by amacdona@redhat.com over 8 years ago

  • Subject changed from As a user, distributor_id is an optional parameter to pulp-admin publish to unable to use pulp-admin to publish rpm repository created with API
Actions #4

Updated by bmbouter almost 8 years ago

  • Status changed from NEW to CLOSED - WORKSFORME

It is not expected to manage repositories with pulp-admin that have not been created with pulp-admin. pulp-admin has expectations of distributor names, so if you create the repo with the API you should execute your publish with the API to get the names correct.

If you create the repo with pulp-admin and sync the repo with pulp-admin it works, so I'm closing as WORKSFORME.

Actions #5

Updated by mikea over 6 years ago

bmbouter we've recently run into this problem after upgrading to the latest version of pulp_python. I still need to confirm some details with my coworkers, It appears that what pulp-admin expects for the distributor name has changed? We've been using the API to create repositories for years and have only just now seen this error.

Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024) Task pulp.server.managers.repo.publish.publish[052b1298-7211-4896-8171-560838ded069] raised unexpected: MissingResource({'repo_id': u'pypi', 'distributor_id': u'cli_python_distributor'},)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024) Traceback (most recent call last):
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     R = retval = fun(*args, **kwargs)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 529, in __call__
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     return super(Task, self).__call__(*args, **kwargs)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 107, in __call__
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     return super(PulpTask, self).__call__(*args, **kwargs)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     return self.run(*args, **kwargs)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1097, in publish
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     dist = model.Distributor.objects.get_or_404(repo_id=repo_id, distributor_id=dist_id)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)   File "/usr/lib/python2.7/site-packages/pulp/server/db/querysets.py", line 119, in get_or_404
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024)     raise pulp_exceptions.MissingResource(**kwargs)
Jul 25 12:28:58 lab21654prs501 pulp: celery.app.trace:ERROR: [052b1298] (5296-05024) MissingResource: Missing resource(s): repo_id=pypi, distributor_id=cli_python_distributor

The fact that the repository was created via the API does not negate the fact that administrators will need to launch a sync from pulp-admin from time to time.

There are several ways that we could make this less impacting.

1) have pulp default the importer/distributor names to what pulp-admin expects when creating the repository via the API (in fact, I'm surprised this is not already the case)
2) have pulp-admin interrogate the importers/distributors and use what's configured regardless of name, especially if there is just one (as is the case 99% of the time)
3) Allow the user to specify a importer/distributor id as part of the pulp-admin repo sync run command

I'll dig into this a bit more today on our end and likely change our code to force the same conventions that pulp-admin uses, but this is kind of a silly bug and I think WORKSFORME is probably not a good resolution for this issue.

Actions #6

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF