Opened 6 years ago

Closed 6 years ago

#5543 closed defect (fixed)

mediagoblin/api/host-meta.xml template not found

Reported by: ayleph Owned by:
Priority: major Milestone:
Component: programming Keywords: api, federation
Cc: Parent Tickets:

Description

A user trying to connect to my instance with a third-party client resulted in the following log entries.

Error - <class 'jinja2.exceptions.TemplateNotFound'>: mediagoblin/api/host-meta.xml
File '/path/to/mediagoblin/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/exceptions/errormiddleware.py', line 144 in __call__
  app_iter = self.application(environ, sr_checker)
File '/path/to/mediagoblin/mediagoblin/app.py', line 342 in __call__
  return self.call_backend(environ, start_response)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Werkzeug-0.10.1-py2.7.egg/werkzeug/wsgi.py', line 591 in __call__
  return self.app(environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 276 in call_backend
  return self._finish_call_backend(request, environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 318 in _finish_call_backend
  response = controller(request)
File '/path/to/mediagoblin/mediagoblin/api/views.py', line 772 in host_meta
  mimetype="application/xrd+xml"
File '/path/to/mediagoblin/mediagoblin/tools/response.py', line 36 in render_to_response
  render_template(request, template, context),
File '/path/to/mediagoblin/mediagoblin/tools/template.py', line 125 in render_template
  template_path)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/environment.py', line 791 in get_template
  return self._load_template(name, self.make_globals(globals))
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/environment.py', line 765 in _load_template
  template = self.loader.load(self, name, globals)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/loaders.py', line 398 in load
  raise TemplateNotFound(name)
TemplateNotFound: mediagoblin/api/host-meta.xml

Change History (2)

comment:1 by ayleph, 6 years ago

The file was found at mediagoblin/templates/mediagoblin/federation/host-meta.xml. This location used to be correctly referenced by mediagoblin/federation/views.py.

Commit 4fd520364 changed a lot of code to use the api name instead of the federation name, including renaming mediagoblin/federation/views.py to mediagoblin/api/views.py and changing the route to the host-meta.xml file as shown below.

@@ -721,7 +721,7 @@ def host_meta(request):
     # provide XML+XRD
     return render_to_response(
         request,
-        "mediagoblin/federation/host-meta.xml",
+        "mediagoblin/api/host-meta.xml",
         {"links": links},
         mimetype="application/xrd+xml"
     )

Corresponding with this change, the host-meta.xml file should have been moved from mediagoblin/templates/mediagoblin/federation/host-meta.xml to mediagoblin/templates/mediagoblin/api/host-meta.xml. However, the file was not moved, so the route fails.

comment:2 by ayleph, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in 807f96d.

Note: See TracTickets for help on using tickets.