Description of problem: The docker client that is used to pull docker containers appears to enforce a restriction on the naming of docker repositories; however, pulp does not enforce those restrictions. As a result, a user can create, sync and publish a repository to later find that they cannot pull the content from it. Version-Release number of selected component (if applicable): pulp-docker-plugins-0.2.1-0.1.alpha.el6.noarch How reproducible: always Steps to Reproduce: 1. create a docker repository with a pulp id that contains a capital letter (e.g. Default_Organization-docker-busybox) 2. sync & publish the repo for example: Id: Default_Organization-docker-busybox Display Name: busybox Description: None Content Unit Counts: Docker Image: 10 3. attempt to pull the repo from a client using 'docker pull' Actual results: # docker pull fortello-docker.devel:5000/Default_Organization-docker-busybox 2014/10/01 13:33:41 Invalid repository name (Default_Organization-docker-busybox), only [a-z0-9-_.] are allowed Expected results: Either the docker pull should successfully pull the repository or pulp should not allow the user to create the invalid repository. The following is an example of a successful case: # docker pull fortello-docker.devel:5000/org-docker_product-busybox Pulling repository fortello-docker.devel:5000/org-docker_product-busybox 9e2c56202029: Download complete b1c51f7d9f04: Download complete 35fcdc96c01b: Download complete d473e653126b: Download complete 511136ea3c5a: Download complete 388abcde152c: Download complete 93a914beb87c: Download complete c1853e76a63d: Download complete e3c64994cc50: Download complete 7e8bd5521539: Download complete Additional info:
we will validate the repo-registry-id during repo create and update, including if the repo-registry-id is not provided and we use a default.
https://github.com/pulp/pulp_docker/pull/52
pulp 2.6.0 beta 5
Fails-qa [root@cloud-qe-17 docker]# rpm -qa pulp-server pulp-server-2.6.0-0.5.beta.el7.noarch [root@cloud-qe-17 docker]# [root@cloud-qe-17 docker]# pulp-admin docker repo update --repo-id=busybox --repo-registry-id=pulpdemo/busybox This command may be exited via ctrl+c without affecting the request. [\] Running... Updating distributor: docker_web_distributor_name_cli Task Failed Pulp exception occurred: PulpDataException
Updated to allow a single slash to allow the namespace. https://github.com/pulp/pulp_docker/pull/54/files
this should be in POST since PR is not merged, not MODIFIED
It appears to have been merged now.
2.6.0-0.7.beta
Failed QA >> rpm -qa pulp-server pulp-server-2.6.0-0.7.beta.el7.noarch >> rpm -qa pulp-docker* pulp-docker-plugins-0.2.2-1.el7.noarch pulp-docker-admin-extensions-0.2.2-1.el7.noarch 1) If capitals are not allowed in repo-id there should be an Error message: like for >> pulp-admin rpm repo create --repo-id R?epo Validation failed for argument [--repo-id]: value must contain only letters, numbers, underscores, periods and hyphens and not a PulpDataException: >> pulp-admin docker repo create --repo-id "Busybox" --feed=https://index.docker.io The server indicated one or more values were incorrect. The server provided the following error message: Pulp exception occurred: PulpDataException More information can be found in the client log file ~/.pulp/admin.log. 2) Exception here >> pulp-admin docker repo create --repo-id "busybox" --feed=https://index.docker.io --upstream-name=busybox Repository [busybox] successfully created >> pulp-admin docker repo update --repo-id=busybox --repo-registry-id=pulpdemo/busybox This command may be exited via ctrl+c without affecting the request. [\] Running... Updating distributor: docker_web_distributor_name_cli Task Failed Pulp exception occurred: PulpDataException >> less /var/log/messages Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) Exception raised from distributor [docker_distributor_export] while validating config for repo [busybox] Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) Traceback (most recent call last): Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/distributor.py", line 317, in update_distributor_config Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) config_conduit) Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/distributor_export.py", line 95, in validate_config Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) return configuration.validate_config(config, repo) Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/configuration.py", line 60, in validate_config Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) raise PulpCodedValidationException(validation_exceptions=errors) Feb 18 06:06:46 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (9960-85248) PulpCodedValidationException: A validation error occurred. Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) Task pulp.server.tasks.repository.distributor_update[84e3a37e-b6a8-487c-846c-f076a19dd9f2] raised unexpected: PulpDataException((),) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) Traceback (most recent call last): Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) R = retval = fun(*args, **kwargs) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 328, in __call__ Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) return super(Task, self).__call__(*args, **kwargs) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__ Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) return self.run(*args, **kwargs) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/pulp/server/tasks/repository.py", line 141, in distributor_update Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) distributor = manager.update_distributor_config(repo_id, distributor_id, config, auto_publish) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/distributor.py", line 317, in update_distributor_config Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) config_conduit) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/distributor_export.py", line 95, in validate_config Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) return configuration.validate_config(config, repo) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/configuration.py", line 60, in validate_config Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) raise PulpCodedValidationException(validation_exceptions=errors) Feb 18 06:06:46 localhost pulp: celery.worker.job:ERROR: (9929-85248) PulpDataException: Pulp exception occurred: PulpDataException Feb 18 06:06:46 localhost pulp: celery.worker.job:INFO: Task pulp.server.async.tasks._release_resource[657cea86-3f5c-4272-804b-f39353b9449f] succeeded in 0.068188174002s: None >> pulp-admin docker repo list --details +----------------------------------------------------------------------+ Docker Repositories +----------------------------------------------------------------------+ Id: busybox Display Name: busybox Description: None Content Unit Counts: Notes: Importers: Config: Feed: https://index.docker.io Upstream Name: busybox Id: docker_importer Importer Type Id: docker_importer Last Sync: None Repo Id: busybox Scheduled Syncs: Distributors: Auto Publish: True Config: Distributor Type Id: docker_distributor_web Id: docker_web_distributor_name_cli Last Publish: None Repo Id: busybox Scheduled Publishes: Auto Publish: False Config: Distributor Type Id: docker_distributor_export Id: docker_export_distributor_name_cli Last Publish: None Repo Id: busybox Scheduled Publishes: >> pulp-admin docker repo update --repo-id=busybox --repo-registry-id=pulpdemo_busybox This command may be exited via ctrl+c without affecting the request. [\] Running... Updating distributor: docker_web_distributor_name_cli Task Succeeded [\] Running... Updating distributor: docker_export_distributor_name_cli Task Succeeded >> pulp-admin docker repo list --details +----------------------------------------------------------------------+ Docker Repositories +----------------------------------------------------------------------+ Id: busybox Display Name: busybox Description: None Content Unit Counts: Notes: Importers: Config: Feed: https://index.docker.io Upstream Name: busybox Id: docker_importer Importer Type Id: docker_importer Last Sync: None Repo Id: busybox Scheduled Syncs: Distributors: Auto Publish: True Config: Auto Publish: True Repo-registry-id: pulpdemo_busybox Distributor Type Id: docker_distributor_web Id: docker_web_distributor_name_cli Last Publish: None Repo Id: busybox Scheduled Publishes: Auto Publish: False Config: Repo-registry-id: pulpdemo_busybox Distributor Type Id: docker_distributor_export Id: docker_export_distributor_name_cli Last Publish: None Repo Id: busybox Scheduled Publishes: Task also failed for --repo-registry-id='busybox/' and --repo-registry-id='/busybox'
The behavior is correct, but the error message is bad. This is due to this bug in core pulp: https://bugzilla.redhat.com/show_bug.cgi?id=1187200 1187200 has been fixed and will make it into 2.6.1, so I am going to bump this one to 2.6.1.
This is actually a pulp_docker issue that will be fixed in pulp_docker 1.0.0, so I am moving this to Redmine. https://pulp.plan.io/issues/291