2

我似乎得到了这个错误,不知道如何调试它。任何指针?

回溯(最近一次通话最后):

 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
4

2 回答 2

3

我是 django-cumulus 的作者。Cloud Files 因 SSL 连接问题而臭名昭著。django-cumulus 有一个名为 CUMULUS_TIMEOUT 的设置(在 0.3.6 中添加),默认为 5 秒。您可以将其增加到 10 或 15 以尝试缓解这种情况。

有关更多信息,请参阅https://github.com/richleland/django-cumulus/issues/5,如果您继续遇到问题,请随时在此处发布问题。

于 2011-04-27T12:54:07.730 回答
1

从外观上看,我会说与 Rackspace Cloudfiles 的连接超时。Imagekit 动态构建缩略图(我相信它在此处所做的_create()),但还有一个选项可以在保存模型时创建所有缩略图,而不是在渲染时创建。如果 Rackspace 出现故障,那将不会真正帮助您,但它将有助于减少渲染模板所需的时间。

编辑:要预先缓存您的缩略图,您需要更改ImageSpec定义以包括pre_cache = True(来自imagekit wiki):

from imagekit.specs import ImageSpec 

class Thumbnail(ImageSpec): 
    access_as = 'thumbnail_image' 
    pre_cache = True 

ikflush如果您更改规格,您可以使用管理命令重新构建所有缓存的缩略图。您应该注意,虽然这将创建所有缩略图,pre_cache = True但也会删除所有缓存的图像,其中pre_cache = False.

于 2010-10-26T14:08:58.083 回答