Project

Profile

Help

Issue #291

Pulp allows creation of docker repos that have invalid names

Added by amacdona@redhat.com almost 7 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Docker:
Platform Release:
Target Release - Docker:
1.0.1
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

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

Blocked by Pulp - Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataExceptionCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 6115570f View on GitHub
Added by Austin Macdonald over 6 years ago

add repo-registry-id validation information to docs

re #291

Revision 6115570f View on GitHub
Added by Austin Macdonald over 6 years ago

add repo-registry-id validation information to docs

re #291

Revision 6115570f View on GitHub
Added by Austin Macdonald over 6 years ago

add repo-registry-id validation information to docs

re #291

Revision 6115570f View on GitHub
Added by Austin Macdonald over 6 years ago

add repo-registry-id validation information to docs

re #291

History

#2 Updated by Skullman almost 7 years ago

There is also no information about this strict name limitation in documentation. Please, add the note into documentation.

#3 Updated by bcourt almost 7 years ago

  • Status changed from MODIFIED to 5

#4 Updated by bmbouter over 6 years ago

  • Triaged changed from No to Yes
  • Severity set to Medium

#5 Updated by amacdona@redhat.com over 6 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/

#6 Updated by amacdona@redhat.com over 6 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:

https://github.com/pulp/pulp_docker/blob/50ee5d58f8521eaa83f1bf1088b765d11ffc8b02/common/pulp_docker/common/error_codes.py#L13

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.

https://github.com/pulp/pulp_docker/pull/60

#7 Updated by bmbouter over 6 years ago

  • Severity changed from Medium to 2. Medium

#8 Updated by bmbouter over 6 years ago

  • Platform Release deleted (2.6.1)
  • Target Release - Docker set to 1.0.1

#9 Updated by igulina@redhat.com over 6 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

#10 Updated by amacdona@redhat.com over 6 years ago

  • Related to Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException added

#11 Updated by amacdona@redhat.com over 6 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.

#12 Updated by igulina@redhat.com over 6 years ago

it was agreed to verify #291 after #828 verification

#13 Updated by dkliban@redhat.com over 6 years ago

  • Related to deleted (Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException)

#14 Updated by dkliban@redhat.com over 6 years ago

  • Blocked by Issue #828: pulp eats helpful validation errors from plugins and returns unhelpful PulpDataException added

#15 Updated by pthomas@redhat.com over 6 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>

#16 Updated by amacdona@redhat.com over 6 years ago

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.

#17 Updated by amacdona@redhat.com over 6 years ago

  • Target Release - Docker changed from 1.0.0 to 1.0.1

#18 Updated by amacdona@redhat.com over 6 years ago

  • Status changed from ASSIGNED to MODIFIED

#19 Updated by dkliban@redhat.com over 6 years ago

  • Status changed from MODIFIED to 5

#20 Updated by pthomas@redhat.com over 6 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 ~]# 

#21 Updated by rbarlow almost 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#23 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF