1

実稼働環境でsorl-thumbnailから奇妙なエラーが発生し続けます(Sentryをロガーとして使用)。それらはすべてThumbnail tag failed:(これは非常に便利です)と言うだけで、3つのモジュールのいずれかから来ています。

奇妙なことに、それは実際にはサイトに影響を与えません。ページは正常に読み込まれ、サムネイルも正常に読み込まれます。Sentryダッシュボードのリストにエラーが表示されるのを見るのにうんざりしているので、これは本当に心配なことです。ただし、エラーが発生する理由や修正方法を理解することはできません。私が言ったように、サイトに目立った影響はないので、それらが単なる標準的な動作と過度に冗長なロギングが混在しているのではないかと思い始めています。

おそらくここの誰かがそれにもっと光を当てることができるので、ここにスタックトレースがあります。

更新#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"
4

1 に答える 1

3

ローカルで作業中にこの問題に遭遇しました。管理コマンドを実行した後、停止したように見えました。

python manage.py thumbnail clear

に続く

python manage.py thumbnail cleanup
于 2012-09-12T16:16:32.597 に答える