This is now fixed. Was caused by some instances being spun up by /
mapreduce requests, which are initially handled by a non-main.py
handler, which meant that our django settings (specifically the
template loader) were not being configured correctly.

On Apr 30, 9:09 am, kamens <kam...@gmail.com> wrote:
> We've started seeing bursts of TemplateNotFound errors when invoking
> fairly standard template rendering code:
> __________________
>
>     from django.template.loader import render_to_string
>     ....
>     path = os.path.join(os.path.dirname(__file__),
> 'video_comments_content.html')
>     html = render_to_string(path, {})
> __________________
>
> and the error that is seen somewhat randomly:
> __________________
>
> /base/data/home/apps/khanexercises/de514da0ee02.350078430120358844/
> discussion/video_comments_content.html
> Traceback (most recent call last):
>   File "/base/python_runtime/python_lib/versions/1/google/appengine/
> ext/webapp/__init__.py", line 634, in __call__
>     handler.get(*groups)
>   File "/base/data/home/apps/khanexercises/
> de514da0ee02.350078430120358844/discussion/comments.py", line 39, in
> get
>     html = render_to_string(path, template_values)
>   File "/base/python_runtime/python_lib/versions/third_party/
> django-0.96/django/template/loader.py", line 101, in render_to_string
>     t = get_template(template_name)
>   File "/base/python_runtime/python_lib/versions/third_party/
> django-0.96/django/template/loader.py", line 79, in get_template
>     source, origin = find_template_source(template_name)
>   File "/base/python_runtime/python_lib/versions/third_party/
> django-0.96/django/template/loader.py", line 72, in
> find_template_source
>     raise TemplateDoesNotExist, name
> TemplateDoesNotExist: /base/data/home/apps/khanexercises/
> de514da0ee02.350078430120358844/discussion/video_comments_content.html
> __________________
>
> For some reason these errors only show up on specific instances. We've
> tried redeploying, but after a few hours I come back to check the
> console and see tons of these errors. When I look at the "Instances"
> panel, I can see that all instances are fine (0 or 1 errors) and one
> or two are disastrous (100+ errors). It's extremely hard to reproduce
> the crash because sometimes we have 100 instances running, so
> reloading the page over and over almost always works (I was only able
> to see the crash once, presumably when my request was routed to a
> problematic instance, but I did verify that it's happening).
>
> It's almost as if some of the instances are brought up either without
> that specific template file or with a different template loading
> environment. Note that the path in that error report ".../discussion/
> video_comments_content.html" looks correct to me.
>
> Thanks in advance. appid: khanexercises

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to