Project

Profile

Help

Story #1005

closed

pulp-admin docker repo create misses mandatory option --feed

Added by mkovacik@redhat.com almost 9 years ago. Updated about 5 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Target Release - Docker:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

At the moment it is possible to create a docker repo without specifying --feed on the command line.
Later when synchronizing the repo, it leads to a server-side exception verifying mandatory fields presence:

[root@ip-172-31-20-145 ~]# pulp-admin -u admin -p admin docker repo create --repo-id hello-world --upstream-name hello-world
Repository [hello-world] successfully created

[root@ip-172-31-20-145 ~]# pulp-admin -u admin -p admin docker repo sync run --repo-id hello-world
+----------------------------------------------------------------------+
                 Synchronizing Repository [hello-world]
+----------------------------------------------------------------------+

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

Task Failed

Missing values for: ['feed']

[root@ip-172-31-20-145 ~]#

### $ cat /var/log/messages
### ------%<---------------
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.strategy:INFO: Received task: pulp.server.managers.repo.sync.sync[4276f7d5-76b9-4e2e-9e28-4ac95600d4d2]
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136) Exception caught from plugin during sync for repo [hello-world]
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136) Traceback (most recent call last):
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/sync.py", line 164, in _do_sync
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)     sync_report = sync_repo(transfer_repo, conduit, call_config)
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 483, in wrap_f
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)     return f(*args, **kwargs)
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/importer.py", line 83, in sync_repo
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)     working_dir=working_dir)
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/sync.py", line 53, in __init__
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)     self.validate(config)
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/sync.py", line 89, in validate
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136)     raise MissingValue(missing)
May 27 10:20:56 ip-172-31-20-145 pulp: pulp.server.managers.repo.sync:ERROR: (2836-43136) MissingValue: Missing values for: ['feed']
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.strategy:INFO: Received task: pulp.server.async.tasks._release_resource[0dee8c1f-c3d7-47ac-a783-245379df3755]
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136) Task pulp.server.managers.repo.sync.sync[4276f7d5-76b9-4e2e-9e28-4ac95600d4d2] raised unexpected: MissingValue(['feed'],)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136) Traceback (most recent call last):
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     R = retval = fun(*args, **kwargs)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 328, in __call__
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     return super(Task, self).__call__(*args, **kwargs)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 437, in __protected_call__
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     return self.run(*args, **kwargs)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/sync.py", line 110, in sync
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     call_config)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/sync.py", line 164, in _do_sync
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     sync_report = sync_repo(transfer_repo, conduit, call_config)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp/server/async/tasks.py", line 483, in wrap_f
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     return f(*args, **kwargs)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/importer.py", line 83, in sync_repo
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     working_dir=working_dir)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/sync.py", line 53, in __init__
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     self.validate(config)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)   File "/usr/lib/python2.6/site-packages/pulp_docker/plugins/importers/sync.py", line 89, in validate
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136)     raise MissingValue(missing)
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:ERROR: (2735-43136) MissingValue: Missing values for: ['feed']
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:INFO: Task pulp.server.async.tasks._queue_reserved_task[f9d11683-4c39-4397-96c8-a3e5cf0c8ba3] succeeded in 0.0382881090045s: None
May 27 10:20:56 ip-172-31-20-145 pulp: celery.worker.job:INFO: Task pulp.server.async.tasks._release_resource[0dee8c1f-c3d7-47ac-a783-245379df3755] succeeded in 0.0315523919999s: None

Please, either introduce a /etc/pulp/admin/conf.d/docker.conf with a default feed or make the command line option mandatory

Actions #1

Updated by mhrivnak almost 9 years ago

  • Status changed from NEW to CLOSED - NOTABUG

This is working as designed. Not all docker repos will be sync'd. For example, many users will only get docker images into pulp via upload. Users with promotion workflows (such as all katello users) will copy images from one repo to another. Thus a feed is only required if you do a sync, and the validation at sync time appears to be working correctly.

Actions #2

Updated by mkovacik@redhat.com almost 9 years ago

mhrivnak wrote:

This is working as designed. Not all docker repos will be sync'd. For example, many users will only get docker images into pulp via upload. Users with promotion workflows (such as all katello users) will copy images from one repo to another. Thus a feed is only required if you do a sync, and the validation at sync time appears to be working correctly.

I see. But wouldn't an explicit --feed=None be more user-friendly in case one plans to upload local images into the repo being created?
Or perhaps pulp-admin logging a more explanatory error message in case the sync fails because of this particular reason?
I still believe setting default feed None in /etc/pulp/admin/conf.d/docker.conf would be useful for those that do much more image uploads than syncing.

Actions #3

Updated by rbarlow almost 9 years ago

On 05/27/2015 11:17 AM, Pulp wrote:

I still believe setting default feed |None| in
|/etc/pulp/admin/conf.d/docker.conf| would be useful for those that do
much more image uploads than syncing.

I think the way it currently is makes the most sense. Users are likely
to have some repos that sync from a feed, and other repos that do not.
It doesn't accomplish anything to have a default set to None, because
then when someone tries to sync that repo they will still get the same
(or similar) error message.

--
Randy Barlow

Actions #4

Updated by mhrivnak almost 9 years ago

I agree with Randy. This is the way all of our other importers work, and for docker especially, I think most of a user's repos will not use sync.

And where would you draw the line? Do we need to require a value be set for proxy, auth credentials, max speed, num threads, ssl client cert, and every other setting the importer might use?

FWIW, the logging is much more polite in 2.7. Instead of a traceback, you'll see just the error message.

Actions #5

Updated by mkovacik@redhat.com almost 9 years ago

Guys, thanks. I agree. The non-mandatory switch makes most sense.

Actions #6

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF