Project

Profile

Help

Issue #4323

closed

/pulp/api/v3/ returns 500 error

Added by amacdona@redhat.com almost 6 years ago. Updated almost 5 years ago.

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

Description

GET request to /pulp/api/v3/ produces the following in the logs:

pulp: django.request:ERROR: Internal Server Error: /pulp/api/v3/
Traceback (most recent call last):
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in in
    response = get_response(request)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
    response = response.render()
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/template/response.py", line 106, in render
    self.content = self.rendered_content
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/response.py", line 72, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/renderers.py", line 732, in render
    context = self.get_context(data, accepted_media_type, renderer_context)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/renderers.py", line 687, in get_context
    'content': self.get_content(renderer, data, accepted_media_type, renderer_context),
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/renderers.py", line 423, in get_content
    content = renderer.render(data, accepted_media_type, renderer_context)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/renderers.py", line 1036, in render
    structure = self.get_structure(data)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/renderers.py", line 1016, in get_structure
    'title': data.title,
AttributeError: 'dict' object has no attribute 'title'

I get a 500, but only when using the browsable API.

When using httpie, I get an unusual result. Since daviddavis couldn't reproduce this, (and the result below) my assumption is that this is a problem with docker-distributions.


~/d/devel ❯ http --auth admin:admin http://pulp3:8000/pulp/api/v3/
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Length: 250
Content-Type: application/vnd.oai.openapi
Date: Mon, 14 Jan 2019 21:33:50 GMT
Server: WSGIServer/0.2 CPython/3.7.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

info:
  description: ''
  title: Pulp API
  version: ''
openapi: 3.0.0
paths:
  /v2/:
    get:
      description: Return a response to the "GET" action.
      operationId: v2_list
      tags:
      - v2
servers:
- url: http://pulp3:8000/pulp/api/v3/

Related issues

Has duplicate Pulp - Issue #4426: JSON serialization of schema fails with internal server errorCLOSED - DUPLICATEActions
Copied to Pulp - Test #4462: /pulp/api/v3/ returns 500 errorCLOSED - WONTFIXActions

Also available in: Atom PDF