Issue #3449
Updated by daviddavis over 6 years ago
In #3448, we agreed to add documentation as a stopgap solution for the distribution basepath distributor overlap problem. However, it looks like if you do proceed to overlap distributors, you get an error: <pre> 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! </pre> 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"