Page MenuHomePhabricator

rsvg-convert failure for 2880px-Earth_Impact_Database_world_map.svg.png
Closed, ResolvedPublic

Description

This image fails to convert on metal (where a 429 is triggered, but I strongly suspect this to be obscuring another error) and on k8s, just noticed it due to the more verbose logging on k8s

2023-01-16 11:09:59,302 ???? thumbor:ERROR wikimedia_thumbor.engine.CommandError: (['/usr/bin/rsvg-convert', '/tmp/tmpxl8ee80r', '-u', '-f', 'png', '-w', '2880'], b'', b'', 124)

2023-01-16 11:09:59,303 ???? thumbor:ERROR ERROR: Traceback (most recent call last):
  File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 212, in get_image
    result = await self._fetch(self.context.request.image_url)
  File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 876, in _fetch
    raise fetch_result.exception
  File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 844, in _fetch
    self.context.request.engine.load(fetch_result.buffer, extension)
  File "/srv/service/wikimedia_thumbor/engine/proxy/proxy.py", line 125, in load
    self.lcl[enginename].load(buffer, extension)
  File "/opt/lib/python/site-packages/thumbor/engines/__init__.py", line 195, in load
    image_or_frames = self.create_image(buffer)
  File "/srv/service/wikimedia_thumbor/engine/svg/svg.py", line 61, in create_image
    png = self.command(command, env)
  File "/srv/service/wikimedia_thumbor/engine/__init__.py", line 78, in command
    returncode
wikimedia_thumbor.engine.CommandError: (['/usr/bin/rsvg-convert', '/tmp/tmpxl8ee80r', '-u', '-f', 'png', '-w', '2880'], b'', b'', 124)

Current theory is that this could be OOM or timeout related as it is a fairly complex SVG file and conversion takes a while. However, the container itself does not appear to be killed when this failure occurs and the exit code isn't 137 as we'd expect.

Running against the file itself inside of a dev thumbor container yields a successful image:

runuser@70658a454946:/tmp$ time /usr/bin/rsvg-convert Earth_Impact_Database_world_map.svg -u -f png -w 2880 > /tmp/output.png

real    0m25.011s
user    0m10.577s
sys     0m15.237s
runuser@70658a454946:/tmp$ exiftool output.png
ExifTool Version Number         : 11.16
File Name                       : output.png
Directory                       : .
File Size                       : 3.1 MB
File Modification Date/Time     : 2023:01:25 17:15:32+00:00
File Access Date/Time           : 2023:01:25 17:11:54+00:00
File Inode Change Date/Time     : 2023:01:25 17:15:32+00:00
File Permissions                : rw-r--r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 2880
Image Height                    : 1440
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Background Color                : 255 255 255
Image Size                      : 2880x1440
Megapixels                      : 4.1

Thumbnails in smaller sizes are successful

Event Timeline

hnowlan renamed this task from rsvg-convert failure for 2880px-Earth_Impact_Database_world_map.svg to rsvg-convert failure for 2880px-Earth_Impact_Database_world_map.svg.png.Jan 25 2023, 5:33 PM

This failure is due to the image size and hitting memory limits. There are myriad similar tickets for this issue so closing this one for now. Most sizes of this image can be rendered, it's just the larger sizes.