Fwd: [Django] [w1@ip-10-28-101-161] Error: Task imagekit.cachefiles.backends._generate_file (da3d0cad-0cfb-416b-ab94-c9344d6e5ee4): 'AttributeError("\'NoneType\' object has no attribute \'startswith\'", )'

已查看 51 次
跳至第一个未读帖子

Rodrigo Gadea

未读,
2014年1月15日 06:23:022014/1/15
收件人 django-...@googlegroups.com、Tim DeGraw
Hi! I have enabled the celery backend, but I got this exception that I think it has to be when the ImageField is None, but it is raised by boto. Without the Celery backend, it works, and the images are uploaded to S3 without problems.

Any hints?

- - - - -

Task imagekit.cachefiles.backends._generate_file with id da3d0cad-0cfb-416b-ab94-c9344d6e5ee4 raised exception:
'AttributeError("\'NoneType\' object has no attribute \'startswith\'",)'


Task was called with args: (<imagekit.cachefiles.backends.Celery object at 0x3e50f90>, <ImageCacheFile: None>) kwargs: {'force': False}.

The contents of the full traceback was:

Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/webcassette/src/celery-webcassette/celery/app/trace.py", line 218, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/ubuntu/.virtualenvs/webcassette/src/celery-webcassette/celery/app/trace.py", line 398, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/imagekit/cachefiles/backends.py", line 116, in _generate_file
    backend.generate_now(file, force=force)
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/imagekit/cachefiles/backends.py", line 94, in generate_now
    if force or self.get_state(file) not in (CacheFileState.GENERATING, CacheFileState.EXISTS):
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/imagekit/cachefiles/backends.py", line 68, in get_state
    exists = self._exists(file)
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/imagekit/cachefiles/backends.py", line 112, in _exists
    or file.storage.exists(file.name))
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/storages/backends/s3boto.py", line 290, in exists
    name = self._normalize_name(self._clean_name(name))
  File "/home/ubuntu/.virtualenvs/webcassette/local/lib/python2.7/site-packages/storages/backends/s3boto.py", line 225, in _clean_name
    return os.path.normpath(name).replace('\\', '/')
  File "/home/ubuntu/.virtualenvs/webcassette/lib/python2.7/posixpath.py", line 327, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'


回复全部
回复作者
转发
0 个新帖子