Page MenuHomePhabricator

Failure to produce an image at specified resolution
Open, Needs TriagePublicBUG REPORT

Description

What happened
Image link for 7000px for https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png/7000px-Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png returns Request from 105.225.158.243 via cp3051 cp3051, Varnish XID 16071450 Upstream caches: cp3051 int Error: 500, Internal Server Error at Thu, 03 Mar 2022 06:01:25 GMT (several attempts at various time with same result)
Same problem with 5000px
It worked fine for 3000px, see: https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png/3000px-Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png
The actual image on Commons is 14040x9930px, which loads fine on desktop but not on most mobiles. Usage is on English Wikivoyage., Working from Firefox on windows 10 desktop. High resolution is necessary to show fine detail by zooming in.

What should have happened instead?:

Should have opened a page with a preview image at specified resolution (width in pixels)

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

Working from Firefox browser on Windows 10 desktop , broadband fibre connection. can download original with no difficulty, link tested from en:Wikivoyage or Commons with same result.

Event Timeline

Testing locally:

2022-03-03 17:52:35 thumbor:DEBUG METRICS: inc: response.count:1
2022-03-03 17:52:35 thumbor:DEBUG Format specified: png
2022-03-03 17:52:35 thumbor:DEBUG METRICS: inc: storage.miss:1
2022-03-03 17:52:35 thumbor:DEBUG Importing: wikimedia_thumbor.loader.https
2022-03-03 17:52:35 thumbor:DEBUG [HTTPS] load_sync: https%3A//upload.wikimedia.org/wikipedia/commons/7/7c/Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png
2022-03-03 17:52:35 thumbor:DEBUG [HTTPS] Loading normalized URL: https://upload.wikimedia.org/wikipedia/commons/7/7c/Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png
2022-03-03 17:52:36 thumbor:DEBUG [HTTPS] return_contents: /tmp/tmpRAu6on
2022-03-03 17:52:36 thumbor:DEBUG METRICS: inc: original_image.status.200:1
2022-03-03 17:52:36 thumbor:DEBUG METRICS: inc: original_image.response_bytes:4096
2022-03-03 17:52:36 thumbor:DEBUG [Proxy] Looking for a png engine
2022-03-03 17:52:36 thumbor:DEBUG [ExiftoolRunner] command: ['/usr/bin/exiftool', '-ImageSize', '-s', '-s', '-s', '/tmp/tmpRAu6on']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '59', '/usr/bin/exiftool', '-ImageSize', '-s', '-s', '-s', '/tmp/tmpRAu6on']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stdout: 14040x9930

2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stderr: 
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Return code: 0
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Duration: 191.842
2022-03-03 17:52:36 thumbor:DEBUG [IM] Grabbing filename from context
2022-03-03 17:52:36 thumbor:DEBUG [ExiftoolRunner] command: ['/usr/bin/exiftool', '-s', '-s', '-ImageSize', '-ProfileDescription', '-ColorType', '-FileType', '-Transparency', '-Artist', '-Copyright', '-ImageDescription', '/tmp/tmpRAu6on']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '59', '/usr/bin/exiftool', '-s', '-s', '-ImageSize', '-ProfileDescription', '-ColorType', '-FileType', '-Transparency', '-Artist', '-Copyright', '-ImageDescription', '/tmp/tmpRAu6on']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stdout: ImageSize: 14040x9930
ColorType: RGB with Alpha
FileType: PNG

2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stderr: 
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Return code: 0
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Duration: 69.085
2022-03-03 17:52:36 thumbor:DEBUG [IM] EXIF: {'FileType': 'PNG', 'ColorType': 'RGB with Alpha', 'ImageSize': '14040x9930'}
2022-03-03 17:52:36 thumbor:DEBUG [IM] File has no ICC profile
2022-03-03 17:52:36 thumbor:DEBUG [IM] reorientate
2022-03-03 17:52:36 thumbor:DEBUG [IM] resize: 7000.0 4951.0
2022-03-03 17:52:36 thumbor:DEBUG [IM] Queued operators: ['-resize', '7000x4951^', '-gravity', 'center', '-extent', '7000x4951', '-background', 'none']
2022-03-03 17:52:36 thumbor:DEBUG Image format specified as .png.
2022-03-03 17:52:36 thumbor:DEBUG Content Type of image/png detected.
2022-03-03 17:52:36 thumbor:DEBUG [BWE] Rendering png
2022-03-03 17:52:36 thumbor:DEBUG [IM] read: png 87
2022-03-03 17:52:36 thumbor:DEBUG [IM] Chroma subsampling: '4:2:0'
2022-03-03 17:52:36 thumbor:DEBUG [IM] Generating image with quality 95
2022-03-03 17:52:36 thumbor:DEBUG [IM] Queued operators: ['-resize', '7000x4951^', '-gravity', 'center', '-extent', '7000x4951', '-background', 'none', '-quality', '95', '-sampling-factor', '4:2:0']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '59', '/usr/bin/convert', '-define', 'tiff:exif-properties=no', '-resize', '7000x4951^', '-gravity', 'center', '-extent', '7000x4951', '-background', 'none', '-quality', '95', '-sampling-factor', '4:2:0', '/tmp/tmpRAu6on[0]', u'png:-']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stdout: 
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stderr: convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.

2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Return code: 1
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Duration: 121.334
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '59', '/usr/bin/convert', '/tmp/tmpyOfwaq', 'info:']
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stdout: 
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Stderr: convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/504.
convert: no images defined `info:' @ error/convert.c/ConvertImageCommand/3258.

2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Return code: 1
2022-03-03 17:52:36 thumbor:DEBUG [ShellRunner] Duration: 16.346
2022-03-03 17:52:36 thumbor:ERROR [ThreadPool] Failed to convert image convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/thumbor/context.py", line 268, in _execute_in_foreground
    returned = operation()
  File "/usr/lib/python2.7/dist-packages/thumbor/handlers/__init__.py", line 334, in _load_results
    results = context.request.engine.read(image_extension, quality)
  File "/usr/lib/python2.7/dist-packages/wikimedia_thumbor/engine/proxy/proxy.py", line 133, in read
    ret = self.__getattr__('read')(extension, quality)
  File "/usr/lib/python2.7/dist-packages/wikimedia_thumbor/engine/__init__.py", line 40, in read
    return super(BaseWikimediaEngine, self).read(extension, quality)
  File "/usr/lib/python2.7/dist-packages/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 332, in read
    raise ImageMagickException('Failed to convert image %s' % stderr)  # pragma: no cover
ImageMagickException: Failed to convert image convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.

2022-03-03 17:52:36 thumbor:ERROR [BaseHander.finish_request] Failed to convert image convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/thumbor/handlers/__init__.py", line 391, in inner
    future_result = future.result()
  File "/usr/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/usr/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 357, in __get_result
    raise type(self._exception), self._exception, self._traceback
ImageMagickException: Failed to convert image convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.

2022-03-03 17:52:36 thumbor:WARNING Error while trying to fetch the image: Failed to convert image convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert: cache resources exhausted `/tmp/tmpRAu6on' @ error/cache.c/OpenPixelCache/3943.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.

2022-03-03 17:52:36 tornado.access:ERROR 500 GET /thumbor/unsafe/7000x/filters:format(png)/https://upload.wikimedia.org/wikipedia/commons/7/7c/Dive_sites_of_the_Whittle_Rock_Reef_high_resolution.png (172.17.0.1) 1208.34ms
2022-03-03 17:52:36 thumbor:DEBUG METRICS: timing: response.time:1207
2022-03-03 17:52:36 thumbor:DEBUG METRICS: timing: response.time.500:1207
2022-03-03 17:52:36 thumbor:DEBUG METRICS: inc: response.status.500:1
2022-03-03 17:52:36 tornado.access:WARNING 404 GET /favicon.ico (172.17.0.1) 0.38ms
2022-03-03 17:52:56 thumbor:DEBUG [HTTPS] cleanup_temp_file: /tmp/tmpRAu6on

ImageMagick refuses to resize it because the output file exceeds the default limits set by the Debian package. I don't know if that matches what is happening in production.

What are the default limits as set?

Thanks for the reference, but I do not know how to identify the relevant limits from that listing. I am trying to work out what maximum size of image I can specify that will return an image, so I can consider work-around options.

Am I correct in assuming that <policy domain="resource" name="width" value="32KP"/> is the one and max width is limited to 3200px? (similar for height), so I will have to manually resize and upload the image under another name if I need a larger image for zoom in details?
Misread that. 32KP =>32000px, so not a clue which default is limiting.

Is anything further likely to happen with this?

Is anything further likely to happen with this?

Might it be related to T200866 a time-out limit for SVGs?