Project

Profile

Help

Issue #8156

HTTP 500 when listing distributions using browseable API

Added by ttereshc 6 months ago. Updated 6 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

On the RBAC branch, try to list all distributions using your browser and being logged in as admin.

http://localhost:24817/pulp/api/v3/distributions/container/container/

I get HTTP 500 and the traceback:

Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]: 127.0.0.1 - - [25/Jan/2021:18:40:18 +0000] "POST /auth/login/ HTTP/1.1" 302 0 "http://localhost:24817/auth/login/?next=/pulp/api/v3/distributions/container/container/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]: pulp [7034c773c5ca4fc9a7cfd07b57b7a49e]: django.request:ERROR: Internal Server Error: /pulp/api/v3/distributions/container/container/
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]: Traceback (most recent call last):
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     response = get_response(request)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/handlers/base.py", line 145, in _get_response
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     response = self.process_exception_by_middleware(e, request)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/handlers/base.py", line 143, in _get_response
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     response = response.render()
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/django/template/response.py", line 106, in render
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     self.content = self.rendered_content
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/response.py", line 70, in rendered_content
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     ret = renderer.render(self.data, accepted_media_type, context)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/renderers.py", line 724, in render
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     context = self.get_context(data, accepted_media_type, renderer_context)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/renderers.py", line 655, in get_context
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     raw_data_post_form = self.get_raw_data_form(data, view, 'POST', request)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/renderers.py", line 541, in get_raw_data_form
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     if not self.show_form_for_method(view, method, request, instance):
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/renderers.py", line 431, in show_form_for_method
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     view.check_permissions(request)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/views.py", line 332, in check_permissions
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     if not permission.has_permission(request, self):
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_access_policy/access_policy.py", line 23, in has_permission
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     return self._evaluate_statements(statements, request, view, action)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_access_policy/access_policy.py", line 59, in _evaluate_statements
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     matched = self._get_statements_matching_context_conditions(
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_access_policy/access_policy.py", line 160, in _get_statements_matching_context_conditions
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     passed = self._check_condition(condition, request, view, action)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_access_policy/access_policy.py", line 184, in _check_condition
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     result = method(request, view, action, arg)
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:   File "/home/vagrant/devel/pulp_container/pulp_container/app/access_policy.py", line 40, in has_manage_namespace_dist_perms
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]:     namespace = request.data["base_path"].split("/")[0]
Jan 25 18:40:18 pulp3-source-fedora32.rhgoose.example.com gunicorn[23104]: KeyError: 'base_path'

Accessing it with httpie works fine.

History

#1 Updated by ipanova@redhat.com 6 months ago

  • Triaged changed from No to Yes

Please register to edit this issue

Also available in: Atom PDF