Issue #291
closedPulp allows creation of docker repos that have invalid names
Description
Docker has more strict requirements for repo-registry-id than pulp. It allows only [a-z0-9-_.] and a single slash.
Bug was originally tracked on BZ as a pulp bug.
https://bugzilla.redhat.com/show_bug.cgi?id=1148556
In Pulp 2.6.0, this will respond with a pretty unhelpful PulpDataException, but this was fixed in 2.6.1
Related issues
Updated by Skullman about 8 years ago
There is also no information about this strict name limitation in documentation. Please, add the note into documentation.
Updated by bmbouter about 8 years ago
- Triaged changed from No to Yes
- Severity set to Medium
Updated by amacdona@redhat.com about 8 years ago
This was fixed with 2 PRs. The first did not allow slashes, which are required.
https://github.com/pulp/pulp_docker/pull/52/
https://github.com/pulp/pulp_docker/pull/54/
Updated by amacdona@redhat.com about 8 years ago
As with the rest of the plugin specific CLI, there is not really a good place to document this behavior. This issue will result in either a DKR1005 or DKR1006 error:
This helpful error message will not be visible in 2.6.0 due to a separate pulp bug, but will be visible in 2.6.1.
I have updated a recipe to include this.
Updated by bmbouter about 8 years ago
- Platform Release deleted (
2.6.1) - Target Release - Docker set to 1.0.1
Updated by igulina@redhat.com almost 8 years ago
- Status changed from 5 to ASSIGNED
rpm -qa docker
python-pulp-docker-common-1.0.0-1.el7.noarch
pulp-docker-admin-extensions-1.0.0-1.el7.noarch
pulp-docker-plugins-1.0.0-1.el7.noarch
rpm -qa pulp-server
pulp-server-2.6.1-0.2.beta.el7.noarch
pulp-admin docker repo create --repo-id "Busybox" --feed=https://index.docker.io
A validation error occurred.
If repo-registry-id is not specified, it will default to the id must contain
only lower case letters, integers, hyphens, periods, and may include a single
slash. Please specify a valid registry id or change the repo id.
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 Succeeded
[\]
Running...
Updating distributor: docker_export_distributor_name_cli
Task Succeeded
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
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 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:
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) Exception rai
sed from distributor [docker_distributor_export] while validating config for repo [busybox]
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) Traceback (mo
st recent call last):
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) File "/usr/
lib/python2.7/site-packages/pulp/server/managers/repo/distributor.py", line 313, in update_distributor_config
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) config_conduit)
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/distributor_export.py", line 95, in validate_config
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) return configuration.validate_config(config, repo)
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/configuration.py", line 60, in validate_config
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) raise PulpCodedValidationException(validation_exceptions=errors)
Mar 31 08:10:03 localhost pulp: pulp.server.managers.repo.distributor:ERROR: (12784-71872) PulpCodedValidationException: A validation error occurred.
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) Task pulp.server.tasks.repository.distributor_update[7b42515c-e65e-4de7-a29f-5ae699a054ae] raised unexpected: PulpDataException((),)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) Traceback (most recent call last):
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) R = retval = fun(*args, **kwargs)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 328, in call
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) return super(Task, self).__call__(*args, **kwargs)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in protected_call
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) return self.run(*args, **kwargs)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/pulp/server/tasks/repository.py", line 141, in distributor_update
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) distributor = manager.update_distributor_config(repo_id, distributor_id, config, auto_publish)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/distributor.py", line 313, in update_distributor_config
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) config_conduit)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/distributor_export.py", line 95, in validate_config
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) return configuration.validate_config(config, repo)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/distributors/configuration.py", line 60, in validate_config
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) raise PulpCodedValidationException(validation_exceptions=errors)
Mar 31 08:10:03 localhost pulp: celery.worker.job:ERROR: (12756-71872) PulpDataException: Pulp exception occurred: PulpDataException
Updated by amacdona@redhat.com almost 8 years ago
- Related to Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException added
Updated by amacdona@redhat.com almost 8 years ago
- Status changed from ASSIGNED to 5
- Target Release - Docker changed from 1.0.1 to 1.0.0
This bug is complicated because it is primarily a pulp_docker bug,
but the bugfix for this exposes a second bug in pulp core. Part of
the confusion is that I did not create an issue for this second
bug, but I have corrected that. https://pulp.plan.io/issues/828
#291 is only for the pulp_docker issue, and it is ON_QA because
the change exists in pulp_docker 1.0.0.
It is best to test it with 2.6.1 because I fixed (at least
partially) #828.
I have also switched this to 1.0.0 since it is already in there.
Updated by igulina@redhat.com almost 8 years ago
Added by Austin Macdonald almost 8 years ago
Added by Austin Macdonald almost 8 years ago
add repo-registry-id validation information to docs
re #291
Added by Austin Macdonald almost 8 years ago
add repo-registry-id validation information to docs
re #291
Added by Austin Macdonald almost 8 years ago
add repo-registry-id validation information to docs
re #291
Updated by dkliban@redhat.com almost 8 years ago
- Related to deleted (Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException)
Updated by dkliban@redhat.com almost 8 years ago
- Blocked by Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException added
Updated by pthomas@redhat.com almost 8 years ago
- Status changed from 5 to ASSIGNED
Fails-qa
Failing it because the message needs a little work. Also its is inconsistent between different repo-id values.
If repo-registry-id is not specified, it will default to the id must contain
only lower case letters, integers, hyphens, periods, and may include a single
slash. Please specify a valid registry id or change the repo id.
[root@mgmt7 ~]# pulp-admin docker repo create --repo-id "Busybox" --feed=https://index.docker.io
A validation error occurred.
If repo-registry-id is not specified, it will default to the id must contain
only lower case letters, integers, hyphens, periods, and may include a single
slash. Please specify a valid registry id or change the repo id.
[root@mgmt7 ~]# pulp-admin docker repo create --repo-id "busybox//" --feed=https://index.docker.io --upstream-name=busybox
Validation failed for argument [--repo-id]: value must contain only letters,
numbers, underscores, periods and hyphens
[root@mgmt7 ~]# pulp-admin docker repo create --repo-id "busybox-1_2.2" --feed=https://index.docker.io --upstream-name=busybox
Repository [busybox-1_2.2] successfully created
[root@mgmt7 ~]#
<\pre>
Updated by amacdona@redhat.com almost 8 years ago
pthomas@redhat.com wrote:
Failing it because the message needs a little work.
Wow, sorry about that Preethi. Fixed here: https://github.com/pulp/pulp_docker/pull/67
Also its is inconsistent between different repo-id values.
The second example is actually the expected behavior. `repo-registry-id` can have slashes, but the repo-id cannot. That is a repo-id validation error.
Updated by amacdona@redhat.com almost 8 years ago
- Target Release - Docker changed from 1.0.0 to 1.0.1
Updated by amacdona@redhat.com almost 8 years ago
- Status changed from ASSIGNED to MODIFIED
Updated by dkliban@redhat.com almost 8 years ago
- Status changed from MODIFIED to 5
Updated by pthomas@redhat.com almost 8 years ago
- Status changed from 5 to 6
Verified
root@ibm-x3550m3-09 ~]# rpm -qa |grep docker
pulp-docker-admin-extensions-1.0.1-0.2.beta.el7.noarch
pulp-docker-plugins-1.0.1-0.2.beta.el7.noarch
python-pulp-docker-common-1.0.1-0.2.beta.el7.noarch
docker-selinux-1.6.0-11.el7.x86_64
docker-1.6.0-11.el7.x86_64
[root@ibm-x3550m3-09 ~]#
<\pre>
<pre>
[root@ibm-x3550m3-09 ~]# pulp-admin docker repo create --repo-id "Busybox" --feed=https://index.docker.io
A validation error occurred.
repo-registry-id may only contain lower case letters, integers, hyphens,
periods, and may include a single slash. When repo-registry-id is not specified,
the repo-id value is used. In that case the repo-id needs to adhere to the same
requirements as repo-registry-id.
[root@ibm-x3550m3-09 ~]#
Updated by rbarlow about 7 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
add repo-registry-id validation information to docs
re #291