Opened 3 years ago

Closed 3 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:


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-', line 144 in __call__
  app_iter = self.application(environ, sr_checker)
File '/path/to/mediagoblin/mediagoblin/', 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/', line 591 in __call__
  return, start_response)
File '/path/to/mediagoblin/mediagoblin/', line 276 in call_backend
  return self._finish_call_backend(request, environ, start_response)
File '/path/to/mediagoblin/mediagoblin/', line 318 in _finish_call_backend
  response = controller(request)
File '/path/to/mediagoblin/mediagoblin/api/', line 772 in host_meta
File '/path/to/mediagoblin/mediagoblin/tools/', line 36 in render_to_response
  render_template(request, template, context),
File '/path/to/mediagoblin/mediagoblin/tools/', line 125 in render_template
File '/path/to/mediagoblin/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg/jinja2/', 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/', 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/', line 398 in load
  raise TemplateNotFound(name)
TemplateNotFound: mediagoblin/api/host-meta.xml


Change History (2)

comment:1 Changed 3 years ago by ayleph

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

Commit 4fd520364 changed a lot of code to use the api name instead of the federation name, including renaming mediagoblin/federation/ to mediagoblin/api/ 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(
-        "mediagoblin/federation/host-meta.xml",
+        "mediagoblin/api/host-meta.xml",
         {"links": links},

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 Changed 3 years ago by ayleph

Resolution: fixed
Status: newclosed

Fixed in 807f96d.

Note: See TracTickets for help on using tickets.