缩略图标签不合格:(SORL-缩略图11.12)(Thumbnail tag failed: (so

2019-09-17 21:41发布

我不断收到来自SORL-缩略图奇怪的错误,在我的生产环境(使用哨兵作为记录器)。 他们都只是说Thumbnail tag failed: (这是哦,所以,尤伯杯有用),他们都来自三个模块之一。

奇怪的是,它实际上并不影响该网站。 网页加载罚款,甚至缩略图加载的罚款。 这真的只是一个问题,因为我已经厌倦了看到的错误,我在我的哨兵仪表板列表中显示出来的。 不过,我不能作出正面或反面出为什么会产生错误,或如何解决这些问题。 我开始怀疑,如果他们不只是标准的行为与过于详细日志记录混合,因为就像我说的,有在网站上没有明显的影响。

也许这里有人能摆脱它更多的光线,所以这里的踪迹。

更新#1

对于从一个sorl.thumbnail.engines.pil_engine._orientation ,我发现了以下可能的候选人: http://blog.yawd.eu/2012/fix-sorlthumbnail-engines-pil-orientation-error/

sorl.thumbnail.images.deserialize_image_file

Thumbnail tag failed:

Stacktrace (most recent call last):

  File "sorl/thumbnail/templatetags/thumbnail.py", line 49, in render
    logger.error('Thumbnail tag failed:', exc_info=sys.exc_info())

  File "sorl/thumbnail/templatetags/thumbnail.py", line 97, in _render
    file_, geometry, **options

  File "sorl/thumbnail/base.py", line 65, in get_thumbnail
    default.kvstore.get_or_set(source)

  File "sorl/thumbnail/kvstores/base.py", line 46, in get_or_set
    cached = self.get(image_file)

  File "sorl/thumbnail/kvstores/base.py", line 25, in get
    return self._get(image_file.key)

  File "sorl/thumbnail/kvstores/base.py", line 127, in _get
    return deserialize_image_file(value)

  File "sorl/thumbnail/images.py", line 31, in deserialize_image_file
    data = simplejson.loads(s)

  File "simplejson/__init__.py", line 428, in loads
    return _default_decoder.decode(s)

  File "simplejson/decoder.py", line 402, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "simplejson/decoder.py", line 420, in raw_decode
    raise JSONDecodeError("No JSON object could be decoded", s, idx)

sorl.thumbnail.images.read

Thumbnail tag failed:

Stacktrace (most recent call last):

  File "sorl/thumbnail/templatetags/thumbnail.py", line 49, in render
    logger.error('Thumbnail tag failed:', exc_info=sys.exc_info())

  File "sorl/thumbnail/templatetags/thumbnail.py", line 97, in _render
    file_, geometry, **options

  File "sorl/thumbnail/base.py", line 56, in get_thumbnail
    source_image = default.engine.get_image(source)

  File "sorl/thumbnail/engines/pil_engine.py", line 12, in get_image
    buf = StringIO(source.read())

  File "sorl/thumbnail/images.py", line 121, in read
    return self.storage.open(self.name).read()

  File "django/core/files/storage.py", line 33, in open
    file = self._open(name, mode)

  File "django/core/files/storage.py", line 159, in _open
    return File(open(self.path(name), mode))

sorl.thumbnail.engines.pil_engine._orientation

Thumbnail tag failed:

Stacktrace (most recent call last):

  File "sorl/thumbnail/templatetags/thumbnail.py", line 49, in render
    logger.error('Thumbnail tag failed:', exc_info=sys.exc_info())

  File "sorl/thumbnail/templatetags/thumbnail.py", line 97, in _render
    file_, geometry, **options

  File "sorl/thumbnail/base.py", line 61, in get_thumbnail
    thumbnail)

  File "sorl/thumbnail/base.py", line 86, in _create_thumbnail
    image = default.engine.create(source_image, geometry, options)

  File "sorl/thumbnail/engines/base.py", line 15, in create
    image = self.orientation(image, geometry, options)

  File "sorl/thumbnail/engines/base.py", line 26, in orientation
    return self._orientation(image)

  File "sorl/thumbnail/engines/pil_engine.py", line 31, in _orientation
    exif = None

  File "PIL/JpegImagePlugin.py", line 381, in _getexif
    info.load(file)

  File "PIL/TiffImagePlugin.py", line 382, in load
    raise IOError, "not enough data"

Answer 1:

我就遇到了这个问题,同时在本地工作。 它似乎停止后,我跑了管理命令:

python manage.py thumbnail clear

其次是

python manage.py thumbnail cleanup


文章来源: Thumbnail tag failed: (sorl-thumbnail 11.12)