Project

Profile

Help

Issue #1485

closed

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

Added by lastmikoi almost 9 years ago. Updated over 5 years ago.

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

Description

I'm trying to set up my project's librarian-puppet to make use the of v3 API, however it seems to be unable to fetch any module because of the fact that pulp_puppet returns a 500 error on the /v3/modules/{module_name} endpoint.

More strangely, it would seems that I'm not able to access the original exception, as a TemplateDoesNotExist exception is raised when django tries to find a template for the 500 error:

curl "repository:repo1@localhost/v3/modules/puppetlabs-apt"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at localhost Port 80</address>
</body></html>
==> /var/log/httpd/error_log <==
[Thu Jan 07 09:10:12 2016] [error] [client ::1] mod_wsgi (pid=20343): Exception occurred processing WSGI script '/srv/pulp/puppet_forge.wsgi'.
[Thu Jan 07 09:10:12 2016] [error] [client ::1] Traceback (most recent call last):
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     response = self.get_response(request)
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 151, in get_response
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 226, in handle_uncaught_exception
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     return callback(request, **param_dict)
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     response = view_func(request, *args, **kwargs)
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/views/defaults.py", line 32, in server_error
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     t = loader.get_template(template_name) # You need to create a 500.html template.
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/template/loader.py", line 145, in get_template
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     template, origin = find_template(template_name)
[Thu Jan 07 09:10:12 2016] [error] [client ::1]   File "/usr/lib/python2.6/site-packages/django/template/loader.py", line 138, in find_template
[Thu Jan 07 09:10:12 2016] [error] [client ::1]     raise TemplateDoesNotExist(name)
[Thu Jan 07 09:10:12 2016] [error] [client ::1] TemplateDoesNotExist: 500.html

==> /var/log/httpd/access_log <==
::1 - - [07/Jan/2016:09:10:12 +0000] "GET /v3/modules/puppetlabs-apt HTTP/1.1" 500 609 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2"

I'm using pulp 2.7.1 under CentOS 6.7, while my librarian-puppet is v2.2.1.

Initial troubleshooting with bmbouter on IRC hinted that pulp_puppet is not using the same middleware as pulp, as the latter serializes 500 errors (https://pulp.plan.io/issues/1140#note-4).


Related issues

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

Also available in: Atom PDF