Project

Profile

Help

Test #4462

/pulp/api/v3/ returns 500 error

Added by bherring 8 months ago. Updated 6 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Version:
Platform Release:
Tags:
Sprint:

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

Copied from Pulp - Issue #4323: /pulp/api/v3/ returns 500 error MODIFIED Actions

History

#1 Updated by bherring 8 months ago

  • Copied from Issue #4323: /pulp/api/v3/ returns 500 error added

#2 Updated by bherring 8 months ago

Triage Notes

  • Should be an update of existing tests

#3 Updated by daviddavis 8 months ago

  • Tags deleted (Pulp 3 RC Blocker)

#4 Updated by rochacbruno 6 months ago

When I try it I get:

$ pulp-smash shell
In [1]: api.client.get('/pulp/api/v3/').content                                                                                                                                                    
Out[1]: b"info:\n  description: ''\n  title: Pulp API\n  version: ''\nopenapi: 3.0.0\npaths: {}\nservers:\n- url: http://fedora-29-pulp-3/pulp/api/v3/\n" 

Is that the expected return? should we write a test case to assert it?

#5 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF