Project

General

Profile

Bug #71046

assets: crash lors de l'accès à /manage/assets/ si une ressource posséde un fichier corrompu

Added by Serghei Mihai 3 months ago. Updated 3 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07 November 2022
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

Lorsque le fichier chargé en ressource est corrompu on perd l'accès à /manage/assets/:

nov. 07 10:37:48 vm1srv-grctest.la-metro.org uwsgi[2497869]: combo ERROR portail-test.iziici.fr 78.198.208.147 24f0c1603eb446c28fb866c93dba31e3 r:7F7A865CA2E0 Internal Server Error: /manage/assets/
                                                             Traceback (most recent call last):
                                                               File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 34, in inner
                                                                 response = get_response(request)
                                                               File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 145, in _get_response
                                                                 response = self.process_exception_by_middleware(e, request)
                                                               File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 143, in _get_response
                                                                 response = response.render()
                                                               File "/usr/lib/python3/dist-packages/django/template/response.py", line 106, in render
                                                                 self.content = self.rendered_content
                                                               File "/usr/lib/python3/dist-packages/django/template/response.py", line 83, in rendered_content
                                                                 content = template.render(context, self._request)
                                                               File "/usr/lib/python3/dist-packages/django/template/backends/django.py", line 61, in render
                                                                 return self.template.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 171, in render
                                                                 return self._render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 163, in _render
                                                                 return self.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 150, in render
                                                                 return compiled_parent._render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 163, in _render
                                                                 return self.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 150, in render
                                                                 return compiled_parent._render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 163, in _render
                                                                 return self.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 150, in render
                                                                 return compiled_parent._render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 163, in _render
                                                                 return self.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 62, in render
                                                                 result = block.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 62, in render
                                                                 result = block.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/defaulttags.py", line 312, in render
                                                                 return nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 188, in render
                                                                 return template.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 173, in render
                                                                 return self._render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 163, in _render
                                                                 return self.nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/defaulttags.py", line 212, in render
                                                                 nodelist.append(node.render_annotated(context))
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/defaulttags.py", line 312, in render
                                                                 return nodelist.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 937, in render
                                                                 bit = node.render_annotated(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 904, in render_annotated
                                                                 return self.render(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 987, in render
                                                                 output = self.filter_expression.resolve(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 671, in resolve
                                                                 obj = self.var.resolve(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 796, in resolve
                                                                 value = self._resolve_lookup(context)
                                                               File "/usr/lib/python3/dist-packages/django/template/base.py", line 858, in _resolve_lookup
                                                                 current = current()
                                                               File "/usr/lib/python3/dist-packages/combo/apps/assets/views.py", line 96, in thumb
                                                                 return get_thumbnail(self.asset.asset, '75x75').url
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/shortcuts.py", line 8, in get_thumbnail
                                                                 return default.backend.get_thumbnail(file_, geometry_string, **options)
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/base.py", line 130, in get_thumbnail
                                                                 self._create_thumbnail(source_image, geometry_string, options,
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/base.py", line 163, in _create_thumbnail
                                                                 image = default.engine.create(source_image, geometry, options)
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/engines/base.py", line 23, in create
                                                                 image = self.scale(image, geometry, options)
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/engines/base.py", line 87, in scale
                                                                 image = self._scale(image, width, height)
                                                               File "/usr/lib/python3/dist-packages/sorl/thumbnail/engines/pil_engine.py", line 208, in _scale
                                                                 return image.resize((width, height), resample=Image.ANTIALIAS)
                                                               File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1912, in resize
                                                                 im = self.convert(self.mode[:-1] + "a")
                                                               File "/usr/lib/python3/dist-packages/PIL/Image.py", line 904, in convert
                                                                 self.load()
                                                               File "/usr/lib/python3/dist-packages/PIL/ImageFile.py", line 247, in load
                                                                 s = read(self.decodermaxblock)
                                                               File "/usr/lib/python3/dist-packages/PIL/PngImagePlugin.py", line 896, in load_read
                                                                 cid, pos, length = self.png.read()
                                                               File "/usr/lib/python3/dist-packages/PIL/PngImagePlugin.py", line 166, in read
                                                                 raise SyntaxError(f"broken PNG file (chunk {repr(cid)})")
                                                             SyntaxError: broken PNG file (chunk b'\x1f\x081\x10')

On devrait signaler les fichiers corrompus lors du chargement de l'image.

Also available in: Atom PDF