Page MenuHomePhabricator

Thumbnail generation errors
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Import a new file on Commons
  • Try to display its thumbnail

What happens?:
Many errors, for example:
https://commons.wikimedia.org/wiki/File:Paralvinella_grasslei_(Ifremer_00568-67996).jpg

> https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Paralvinella_grasslei_%28Ifremer_00568-67996%29.jpg/1920px-Paralvinella_grasslei_%28Ifremer_00568-67996%29.jpg?20241225160344

Request from 2a01:cb01:3073:a424:1d03:1839:d140:b3fe via cp6001 cp6001, Varnish XID 236889413
Upstream caches: cp6001 int
Error: 429, Too Many Requests at Wed, 25 Dec 2024 16:15:13 GMT

What should have happened instead?:
Thumbnail should be generated and displayed.

Event Timeline

Don-vip renamed this task from Thumbail generation errors to Thumbnail generation errors.Dec 25 2024, 4:17 PM

The error is not always the same, for example with this one I get a different one:

https://commons.wikimedia.org/wiki/File:Chemin%C3%A9es_hydrothermales_du_site_Lucky_Strike_(Ifremer_00577-68898).jpg

https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Chemin%C3%A9es_hydrothermales_du_site_Lucky_Strike_%28Ifremer_00577-68898%29.jpg/1920px-Chemin%C3%A9es_hydrothermales_du_site_Lucky_Strike_%28Ifremer_00577-68898%29.jpg?20241227194208

Request from 2a01:cb01:3073:a424:ecf6:ed38:1a46:8d74 via cp6007 cp6007, Varnish XID 616726868
Upstream caches: cp6007 int
Error: 500, Internal Server Error at Fri, 27 Dec 2024 19:43:10 GMT

Testing locally:

thumbor-1  | 2024-12-28 18:53:07 thumbor:DEBUG [Proxy] load: '.jpg'
thumbor-1  | 2024-12-28 18:53:07 thumbor:DEBUG [Proxy] Looking for a jpg engine
thumbor-1  | 2024-12-28 18:53:07 thumbor:DEBUG [IM] Dumping buffer into temp file
thumbor-1  | 2024-12-28 18:53:07 thumbor:ERROR ERROR: Traceback (most recent call last):
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 212, in get_image
thumbor-1  |     result = await self._fetch(self.context.request.image_url)
thumbor-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 885, in _fetch
thumbor-1  |     raise fetch_result.exception
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 853, in _fetch
thumbor-1  |     self.context.request.engine.load(fetch_result.buffer, extension)
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/proxy/proxy.py", line 125, in load
thumbor-1  |     self.lcl[enginename].load(buffer, extension)
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/engines/__init__.py", line 199, in load
thumbor-1  |     image_or_frames = self.create_image(buffer)
thumbor-1  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 77, in create_image
thumbor-1  |     self.read_exif(temp_file)
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 139, in read_exif
thumbor-1  |     metadata.read()
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/pyexiv2/metadata.py", line 117, in read
thumbor-1  |     self.__image._readMetadata()
thumbor-1  | ValueError: Not a valid ICC Profile
thumbor-1  | 
thumbor-1  | 2024-12-28 18:53:07 thumbor:ERROR [BaseHandler] get_image failed for url `https%3A//upload.wikimedia.org/wikipedia/commons/c/c0/Paralvinella_grasslei_%28Ifremer_00568-67996%29.jpg`. error: `Not a valid ICC Profile`
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG [Proxy] load: '.jpg'
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG [Proxy] Looking for a jpg engine
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG [IM] Dumping buffer into temp file
thumbor-1  | 2024-12-28 18:54:05 thumbor:ERROR ERROR: Traceback (most recent call last):
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 212, in get_image
thumbor-1  |     result = await self._fetch(self.context.request.image_url)
thumbor-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 885, in _fetch
thumbor-1  |     raise fetch_result.exception
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 853, in _fetch
thumbor-1  |     self.context.request.engine.load(fetch_result.buffer, extension)
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/proxy/proxy.py", line 125, in load
thumbor-1  |     self.lcl[enginename].load(buffer, extension)
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/thumbor/engines/__init__.py", line 199, in load
thumbor-1  |     image_or_frames = self.create_image(buffer)
thumbor-1  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 77, in create_image
thumbor-1  |     self.read_exif(temp_file)
thumbor-1  |   File "/srv/service/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 139, in read_exif
thumbor-1  |     metadata.read()
thumbor-1  |   File "/opt/lib/venv/lib/python3.11/site-packages/pyexiv2/metadata.py", line 117, in read
thumbor-1  |     self.__image._readMetadata()
thumbor-1  | ValueError: Not a valid ICC Profile
thumbor-1  | 
thumbor-1  | 2024-12-28 18:54:05 thumbor:ERROR [BaseHandler] get_image failed for url `https%3A//upload.wikimedia.org/wikipedia/commons/4/47/Chemin%C3%A9es_hydrothermales_du_site_Lucky_Strike_%28Ifremer_00577-68898%29.jpg`. error: `Not a valid ICC Profile`
thumbor-1  | 2024-12-28 18:54:05 root:DEBUG [MEMCACHED] No config defined, not using memcache
thumbor-1  | 2024-12-28 18:54:05 tornado.access:ERROR 500 GET /thumbor/unsafe/800x/https://upload.wikimedia.org/wikipedia/commons/4/47/Chemin%C3%A9es_hydrothermales_du_site_Lucky_Strike_%28Ifremer_00577-68898%29.jpg (172.18.0.1) 1583.96ms
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG METRICS: timing: response.time:1583
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG METRICS: timing: response.time.500:1583
thumbor-1  | 2024-12-28 18:54:05 thumbor:DEBUG METRICS: inc: response.status.500:1