Project

Profile

Help

Issue #3449

Requesting content from nested distribution path results in 500 error

Added by daviddavis over 1 year ago. Updated 7 months ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

In #3448, we agreed to add documentation as a stopgap solution for the distribution basepath overlap problem. However, it looks like if you do proceed to overlap basepaths, you get an error:

Mar 09 18:04:04 pulp3.dev pulp[19680]: django.request:ERROR: Internal Server Error: /content/foo/bar/test.iso
Traceback (most recent call last):
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/vagrant/devel/pulp/pulpcore/pulpcore/app/views/content.py", line 210, in get
    storage_path = self._match(path)
  File "/home/vagrant/devel/pulp/pulpcore/pulpcore/app/views/content.py", line 97, in _match
    distribution = self._match_distribution(path)
  File "/home/vagrant/devel/pulp/pulpcore/pulpcore/app/views/content.py", line 73, in _match_distribution
    return Distribution.objects.get(base_path__in=base_paths)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/query.py", line 384, in get
    (self.model._meta.object_name, num)
pulpcore.app.models.publication.MultipleObjectsReturned: get() returned more than one Distribution -- it returned 2!

Relevant bit of code:

https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/views/content.py#L73

A few possible solutions:

1. Solve #3051
2. Change get() on line 73 to first()
3. Do nothing except update the documentation with a warning (#3448) and tell users "I told you so"


Related issues

Related to Pulp - Task #3448: Warn users that distributor base paths should not overlap MODIFIED Actions
Related to Pulp - Task #3051: Prevent Distribution base_path overlap in the data model CLOSED - DUPLICATE Actions

History

#1 Updated by daviddavis over 1 year ago

  • Subject changed from Requesting content from nested path results in 500 error to Requesting content from nested distribution path results in 500 error

#2 Updated by daviddavis over 1 year ago

  • Related to Task #3448: Warn users that distributor base paths should not overlap added

#3 Updated by daviddavis over 1 year ago

  • Related to Task #3051: Prevent Distribution base_path overlap in the data model added

#4 Updated by daviddavis over 1 year ago

  • Description updated (diff)

#5 Updated by daviddavis over 1 year ago

  • Description updated (diff)

#6 Updated by jortel@redhat.com over 1 year ago

Let's do all of them. Change get() to first(), document and eventually prevent the overlap.

#7 Updated by amacdona@redhat.com over 1 year ago

+1, all 3.

#8 Updated by dalley over 1 year ago

  • Triaged changed from No to Yes

#9 Updated by bmbouter 7 months ago

  • Status changed from NEW to CLOSED - WONTFIX

#10 Updated by bmbouter 7 months ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF