Project

Profile

Help

Issue #1486

closed

TemplateDoesNotExist exception for '404.html' raised on v3 API endpoint

Added by bmbouter over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.7.1
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

I have not encountered this bug in practice, but I'm confident it exists because of the existence of issue #1485.

To reproduce do the following:

1. Make a url request to a url handled by the Django project handling requests to the /srv/pulp/puppet_forge.wsgi wsgi environment. This URL needs to be invalid such that you expect a 404 to be returned
2. Observe you'll see a TemplateDoesNotExist exception based on 404.html

To fix this we should do something similar to what we did in platform[0]. NOTE It's important to use *args and **kwargs on the handler implemented because newer version of Django change the handler signature in backwards incompatible ways. This was done here[1].

[0]: https://github.com/bmbouter/pulp/commit/996e4366742db143b366c6cccab7231ce0da4904
[1]: https://github.com/bmbouter/pulp/commit/996e4366742db143b366c6cccab7231ce0da4904#diff-0f102dc73ff02451924f2fdaa7df179eR117


Related issues

Related to Puppet Support - Issue #1485: TemplateDoesNotExist exception for '500.html' raised on v3 API endpointCLOSED - WONTFIXActions
Related to Pulp - Issue #1140: API call to URLs that do not exist cause 500s on RHEL 6CLOSED - CURRENTRELEASEbmbouterActions
Actions #1

Updated by bmbouter over 8 years ago

  • Related to Issue #1485: TemplateDoesNotExist exception for '500.html' raised on v3 API endpoint added
Actions #2

Updated by bmbouter over 8 years ago

  • Related to Issue #1140: API call to URLs that do not exist cause 500s on RHEL 6 added
Actions #3

Updated by mhrivnak over 8 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by lastmikoi about 8 years ago

I have been able to reproduce this issue under a recently upgraded Pulp to 2.8.2.

It is not directly debuggable, as of https://pulp.plan.io/issues/1485, but I have been able to extract the following stacktrace out of strace-ing apache's mod_wsgi process.

[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584) Internal Server Error: /v3/modules/puppetlabs-apt\0", 96, 0, NULL, 0) = 96
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584) Traceback (most recent call last):\0", 81, 0, NULL, 0) = 81
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)   File \"/usr/lib/python2.6/site-packages/django/core/handlers/base.py\", line 148, in get_response\0", 144, 0, NULL, 0) = 144
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)     response = callback(request, **param_dict)\0", 93, 0, NULL, 0) = 93
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)   File \"/usr/lib/python2.6/site-packages/django/utils/decorators.py\", line 91, in _wrapped_view\0", 142, 0, NULL, 0) = 142
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)     response = view_func(request, *args, **kwargs)\0", 97, 0, NULL, 0) = 97
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)   File \"/usr/lib/python2.6/site-packages/django/views/defaults.py\", line 20, in page_not_found\0", 141, 0, NULL, 0) = 141
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)     t = loader.get_template(template_name) # You need to create a 404.html template.\0", 131, 0, NULL, 0) = 131
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)   File \"/usr/lib/python2.6/site-packages/django/template/loader.py\", line 145, in get_template\0", 141, 0, NULL, 0) = 141
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)     template, origin = find_template(template_name)\0", 98, 0, NULL, 0) = 98
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)   File \"/usr/lib/python2.6/site-packages/django/template/loader.py\", line 138, in find_template\0", 142, 0, NULL, 0) = 142
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584)     raise TemplateDoesNotExist(name)\0", 83, 0, NULL, 0) = 83
[pid 32546] sendto(14, "<27>pulp: django.request:ERROR: (32423-67584) TemplateDoesNotExist: 404.html\0", 77, 0, NULL, 0) = 77

Upon a request to the `/v3/modules/puppetlabs-apt` (currently missing) endpoint.

Actions #5

Updated by bmbouter about 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

Actions #6

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF