Related
Every now and then I end up with a missing file after deploy a django project, and I find it one of the hardest issues to debug because I get no logging and no error email, its just dead. I have made a custom 500 error page (followed this answer). Is it possible to show the details of which static file is missing on it? With this error Django fails before rendering a 500 page.
Heres a traceback of the error:
Traceback (most recent call last):
File "/usr/lib/python3.8/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
response = self.get_response(request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/base.py", line 75, in get_response
response = self._middleware_chain(request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 129, in handle_uncaught_exception
return callback(request, **param_dict)
File "/home/user/project/src/core/base/views.py", line 236, in error_500_view
response = render(request, "core.base/500.html", context=context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 171, in render
return self._render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/test/utils.py", line 95, in instrumented_test_render
return self.nodelist.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 936, in render
bit = node.render_annotated(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated
return self.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/test/utils.py", line 95, in instrumented_test_render
return self.nodelist.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 936, in render
bit = node.render_annotated(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated
return self.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 106, in render
url = self.url(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 103, in url
return self.handle_simple(path)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 118, in handle_simple
return staticfiles_storage.url(path)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 153, in url
return self._url(self.stored_name, name, force)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 132, in _url
hashed_name = hashed_name_func(*args)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 423, in stored_name
raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)
ValueError: Missing staticfiles manifest entry for 'img/pwa/browserconfig.xml'
I am running Django 1.4.5, Celery 3.0.15, Django Celery 3.0.11, Johnny Cache 1.4.
The calls to ORM in celery tasks sometimes fail with weird errors like invalid literal for int() with base 10: 'a'" or <MaybeEncodingError: Error sending result: ''<ExceptionInfo: ObjectDoesNotExist()>''. Reason: ''PicklingError("Can\'t pickle <class \'scsite.models.DoesNotExist\'>: attribute lookup scsite.models.DoesNotExist failed",)''.>:
Here is a sample stack trace:
Task scsite.tasks.send_signup_email[aecf0561-65af-4d11-a3a0-63d88b7e1a70] raised exception: ValueError("invalid literal for int() with base 10: 'd'",)
Task scsite.tasks.send_signup_email[aecf0561-65af-4d11-a3a0-63d88b7e1a70] raised exception: ValueError("invalid literal for int() with base 10: 'd'",)
Stacktrace (most recent call last):
File "celery/execute/trace.py", line 192, in trace_task
R = I.handle_error_state(task, eager=eager)
File "scsite/tasks.py", line 537, in send_signup_email
email_html = email_template.render(Context(data))
File "django/template/base.py", line 142, in render
context.render_context.pop()
File "django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "django/template/base.py", line 837, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 155, in render
return self.render_template(self.template, context)
File "django/template/loader_tags.py", line 137, in render_template
output = template.render(context)
File "django/template/base.py", line 142, in render
context.render_context.pop()
File "django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 823, in render
bit = self.render_node(node, context)
File "django/template/base.py", line 837, in render_node
return node.render(context)
File "django/template/defaulttags.py", line 192, in render
nodelist.append(node.render(context))
File "django/template/defaulttags.py", line 474, in render
self.extra_context.iteritems()])
File "django/template/base.py", line 584, in resolve
obj = settings.TEMPLATE_STRING_IF_INVALID
File "django/template/base.py", line 721, in resolve
value = self._resolve_lookup(context)
File "django/template/base.py", line 781, in _resolve_lookup
raise
File "django/db/models/manager.py", line 119, in count
return self.get_query_set().count()
File "django/db/models/fields/related.py", line 461, in get_query_set
return super(RelatedManager, self).get_query_set().using(db).filter(**self.core_filters)
File "django/db/models/query.py", line 624, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "django/db/models/query.py", line 642, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "django/db/models/sql/query.py", line 1250, in add_q
can_reuse=used_aliases, force_having=force_having)
File "django/db/models/sql/query.py", line 1185, in add_filter
connector)
File "django/db/models/sql/where.py", line 69, in add
value = obj.prepare(lookup_type, value)
File "django/db/models/sql/where.py", line 320, in prepare
return self.field.get_prep_lookup(lookup_type, value)
File "django/db/models/fields/__init__.py", line 310, in get_prep_lookup
return self.get_prep_value(value)
File "django/db/models/fields/__init__.py", line 537, in get_prep_value
return int(value)
Task scsite.tasks.update_various_denorm_fields[edddb260-041d-4195-83d7-f2e731e5d1a5] raised exception: ValueError("invalid literal for int() with base 10: 'a'",)
Stacktrace (most recent call last):
File "celery/task/trace.py", line 242, in trace_task
R = I.handle_error_state(task, eager=eager)
File "celery/task/trace.py", line 415, in __protected_call__
return self.run(*args, **kwargs)
File "scsite/tasks.py", line 470, in update_various_denorm_fields
Person.objects.update_question_counts()
File "scsite/managers.py", line 715, in update_question_counts
person.update_question_count_denorm()
File "scsite/models.py", line 2712, in update_question_count_denorm
self.question_count_denorm = self.questions.count()
File "django/db/models/manager.py", line 119, in count
return self.get_query_set().count()
File "django/db/models/fields/related.py", line 567, in get_query_set
return super(ManyRelatedManager, self).get_query_set().using(db)._next_is_sticky().filter(**self.core_filters)
File "django/db/models/query.py", line 624, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "django/db/models/query.py", line 642, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "django/db/models/sql/query.py", line 1250, in add_q
can_reuse=used_aliases, force_having=force_having)
File "django/db/models/sql/query.py", line 1185, in add_filter
connector)
File "django/db/models/sql/where.py", line 69, in add
value = obj.prepare(lookup_type, value)
File "django/db/models/sql/where.py", line 320, in prepare
return self.field.get_prep_lookup(lookup_type, value)
File "django/db/models/fields/__init__.py", line 310, in get_prep_lookup
return self.get_prep_value(value)
File "django/db/models/fields/__init__.py", line 537, in get_prep_value
return int(value)
I believe the error is not in my code, it looks like cache becomes corrupt for some reason, and something like the following happens:
CustomModel with pk=123 is retrieved.
It is passed on to Celery to process.
For some reason, the pk of the Custom model becomes a character like 'a', 'd' instead of 123. Another call is made with MyModel.objects.get(pk='a') and it obviously fails.
Actually, revisiting the code for this, it seems I am not passing an object to Celery as I mentioned above, just running the following manager method from a simple celery task.
#task
def mytask():
Person.objects.update_question_count()
class PersonManager(models.Manager):
def update_question_counts(self):
persons = self.all() # 1
for person in persons:
person.update_question_count_denorm() #3
My guess is the following: when Line 1 runs, persons is obtained from cache, but while processing line 3, the cache obtained in Line 1 becomes corrupt.
I am using django-haystack and Whoosh on my Ubuntu server and finding that certain search queries just raise an error page, and I have no idea why this is happening...
I am using the following ones
Whoosh==2.4.0
django-haystack==1.2.7
And I also run python manage.py update_index once every hour
Example traceback
Traceback (most recent call last):
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/hooks/framework_django.py", line 430, in __call__
return self.__wrapped(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/haystack/views.py", line 50, in __call__
return self.create_response()
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/haystack/views.py", line 145, in create_response
return render_to_response(self.template, context, context_instance=self.context_class(self.request))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader.py", line 188, in render_to_string
return t.render(context_instance)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 123, in render
return self._render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/api/function_trace.py", line 82, in __call__
return self._nr_next_object(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
return compiled_parent._render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/api/function_trace.py", line 82, in __call__
return self._nr_next_object(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/newrelic-1.2.0.246/newrelic/hooks/framework_django.py", line 622, in __call__
return self.__wrapped(*args, **kwargs)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 64, in render
result = block.nodelist.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 311, in render
return self.nodelist_true.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
return node.render(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 227, in render
nodelist.append(node.render(context))
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 915, in render
resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 653, in resolve
value = self._resolve_lookup(context)
File "/home/fundedbyme/.virtualenvs/fundedbyme/local/lib/python2.7/site-packages/django/template/base.py", line 692, in _resolve_lookup
raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [object] in u'None'
<WSGIRequest
GET:<QueryDict: {u'q': [u'stockholm']}>,
Could you please put here your view and your template code? If this is happening with just some queries and not all of them, it could be the parameters you are passing to the view.
Here's the code of the view I'm using to make search queries using Haystack 2.0 and Whoosh 2.3.2 in a project of my own:
def search(request):
sqs = SearchQuerySet().filter(content=AutoQuery(request.GET['q']))
return render_to_response('search.html', {'sqs': sqs,})
and this works perfectly fine. I guess you should consider using the latest version of Haystack, because I was experiencing a lot of bugs with the old stable ones. And I recommend you to use the "rebuild_index" once in a while too, just in case.
I've implemented this search feature on a small site I'm working on and I am having problems when I carry out a search query. This is the traceback:
Traceback (most recent call last):
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
return self.application(environ, start_response)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
return self.application(environ, start_response)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 272, in __call__
response = self.get_response(request)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/core/handlers/base.py", line 169, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/core/handlers/base.py", line 203, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Users/glosseyvilly/PycharmProjects/first_django_dev/apps/photos/views.py", line 113, in search_photos
'search_query': search_query
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 44, in render
return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/loader.py", line 188, in render_to_string
return t.render(context_instance)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 123, in render
return self._render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/debug.py", line 73, in render_node
result = node.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/loader_tags.py", line 127, in render
return compiled_parent._render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/debug.py", line 73, in render_node
result = node.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/loader_tags.py", line 64, in render
result = block.nodelist.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/debug.py", line 73, in render_node
result = node.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/defaulttags.py", line 311, in render
return self.nodelist_true.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 744, in render
bits.append(self.render_node(node, context))
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/debug.py", line 73, in render_node
result = node.render(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/defaulttags.py", line 227, in render
nodelist.append(node.render(context))
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 915, in render
resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 653, in resolve
value = self._resolve_lookup(context)
File "/Users/glosseyvilly/Desktop/web_dev/ccdev/lib/python2.6/site-packages/django/template/base.py", line 692, in _resolve_lookup
raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute
TemplateSyntaxError: Caught VariableDoesNotExist while rendering: Failed lookup for key [user] in u"'uploaded_photos/Published/2011/December/21/image_5.jpeg'"
This is my view function:
def search_photos(request):
"""
"""
search_query = ''
results = None
if ('q' in request.GET) and request.GET['q'].strip():
search_query = request.GET['q']
photo_query = get_query(search_query, ['caption',])
results = Photo.objects.filter(photo_query).order_by('-date_added')
return render(request, 'photos/search.html', {
'results': results,
'search_query': search_query
})
NB: The traceback highlights 'search_query': search_query being a possible error and I'm not sure why.
EDIT: Here is a link to my search.html template : gist.github.com/1524911
You need to format the error message as a code block.
The specific error is at the end of the traceback: Failed lookup for key [user] in u"'uploaded_photos/Published/2011/December/21/image_5.jpeg'" which occurred in _resolve_lookup. This is the routine that does the variable value fetching for templates.
I would take a hard look at the template. Pay special attention to any tricky loop references or template tags that might be doing strange lookups (e.g {% expr %} comes to mind). Let us know what you come up with.
Update:
My money is on the line:
{% phileo_widget result.user result %}
Does the result object have an attribute named user?
Shouldn't your method take self as its first parameter?:
def search_photos(self):
So, you access the request object with:
request = self.request
I seem to get this error, and don't know how to debug it.
Any pointers?
Traceback (most recent call last):
File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/www/django_test1/omu2/views.py", line 26, in frontIndex
context_instance=RequestContext(request))
File "/opt/python2.6/lib/python2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader.py", line 108, in render_to_string
return t.render(context_instance)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 97, in render
return compiled_parent.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/loader_tags.py", line 24, in render
result = self.nodelist.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 946, in render
autoescape=context.autoescape))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 243, in render
return self.nodelist_true.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 155, in render
nodelist.append(node.render(context))
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 826, in render
output = self.filter_expression.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 546, in resolve
obj = self.var.resolve(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 687, in resolve
value = self._resolve_lookup(context)
File "/opt/python2.6/lib/python2.6/site-packages/django/template/__init__.py", line 716, in _resolve_lookup
current = getattr(current, bit)
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 94, in url
self._create()
File "/opt/python2.6/lib/python2.6/site-packages/django_imagekit-0.3.3-py2.6.egg/imagekit/specs.py", line 66, in _create
self._obj._storage.save(self.name, content)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/files/storage.py", line 46, in save
name = self.get_available_name(name)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/files/storage.py", line 71, in get_available_name
while self.exists(name):
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 147, in exists
self._get_cloud_obj(name)
File "/opt/python2.6/lib/python2.6/site-packages/cumulus/storage.py", line 99, in _get_cloud_obj
return self.container.get_object(name)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/utils.py", line 43, in decorator
return f(*args, **kwargs)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/container.py", line 316, in get_object
return Object(self, object_name, force_exists=True)
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 89, in __init__
if not self._initialize() and force_exists:
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/storage_object.py", line 462, in _initialize
'HEAD', [self.container.name, self.name]
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 200, in make_request
response = retry_request()
File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 194, in retry_request
return self.connection.getresponse()
File "/opt/python2.6/lib/python2.6/httplib.py", line 974, in getresponse
response.begin()
File "/opt/python2.6/lib/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
File "/opt/python2.6/lib/python2.6/httplib.py", line 349, in _read_status
line = self.fp.readline()
File "/opt/python2.6/lib/python2.6/socket.py", line 397, in readline
data = recv(1)
File "/opt/python2.6/lib/python2.6/ssl.py", line 96, in <lambda>
self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, flags)
File "/opt/python2.6/lib/python2.6/ssl.py", line 222, in recv
raise x
SSLError: The read operation timed out
I'm the author of django-cumulus. Cloud Files is notorious for SSL connection issues. django-cumulus has a setting (added in 0.3.6) called CUMULUS_TIMEOUT that defaults to 5 seconds. You can increase it to 10 or 15 to try and alleviate this.
See https://github.com/richleland/django-cumulus/issues/5 for more info and feel free to post an issue there if you continue to experience problems.
From the look of it I would say that the connection to Rackspace Cloudfiles timed out. Imagekit builds the thumbnails dynamically (which I believe it was doing here in _create()) but there is also an option to create all the thumbnails when the model is saved as opposed to while rendering. That won't really help you if Rackspace goes down but it will help lower the time it takes to render your templates.
EDIT:
To pre-cache your thumbnail you change your ImageSpec definition to include pre_cache = True such as (from the imagekit wiki):
from imagekit.specs import ImageSpec
class Thumbnail(ImageSpec):
access_as = 'thumbnail_image'
pre_cache = True
If you change your specs you can re-build all of the cached thumbnails with the ikflush management command. You should note that while this will create all the thumbnails where pre_cache = True this will also delete all the cached images where pre_cache = False.