Thumbor throws this error when trying to thumbnail [[ https://upload.wikimedia.org/wikipedia/commons/9/96/Uitlit%C3%A9VsP%C3%A9nibilit%C3%A9-Fran%C3%A7ois-Dominique.png | this image ]]. This bug exists on [[ https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Uitlit%C3%A9VsP%C3%A9nibilit%C3%A9-Fran%C3%A7ois-Dominique.png/300px-Uitlit%C3%A9VsP%C3%A9nibilit%C3%A9-Fran%C3%A7ois-Dominique.png | old (metal) ]] and new (k8s) thumbor and was only caught due to the new logging.
[[ https://upload.wikimedia.org/wikipedia/commons/9/96/Uitlit%C3%A9VsP%C3%A9nibilit%C3%A9-Fran%C3%A7ois-Dominique.png | Source original image here ]]
```
2023-01-16 11:11:32,081 ???? thumbor:ERROR [BaseHander.finish_request] Failed to convert image b"convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.\n"
Traceback (most recent call last):
File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 567, in finish_request
operation=functools.partial(self._load_results, context),
File "/opt/lib/python/site-packages/thumbor/threadpool.py", line 53, in queue
return await self._execute_in_foreground(operation, *args)
File "/opt/lib/python/site-packages/thumbor/threadpool.py", line 45, in _execute_in_foreground
return operation(*args)
File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 486, in _load_results
results = context.request.engine.read(image_extension, quality)
File "/srv/service/wikimedia_thumbor/engine/proxy/proxy.py", line 139, in read
ret = self.__getattr__('read')(extension, quality)
File "/srv/service/wikimedia_thumbor/engine/imagemagick/imagemagick.py", line 330, in read
raise ImageMagickException('Failed to convert image %s' % stderr) # pragma: no cover
wikimedia_thumbor.engine.imagemagick.imagemagick.ImageMagickException: Failed to convert image b"convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.\n"
2023-01-16 11:11:32,090 ???? thumbor:WARNING Error while trying to fetch the image: Failed to convert image b"convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3258.\n"
```
Annoyingly we don't get the same command output here as in T327937, but this is a more complex case. Based on a reading of the code, this is the result of the thumbnail generation failing and [[ https://gerrit.wikimedia.org/r/plugins/gitiles/operations/software/thumbor-plugins/+/refs/heads/master/wikimedia_thumbor/engine/imagemagick/imagemagick.py#327 | then failing completely ]] as opposed to partially. Worryingly we have found a case that this line references `# Haven't been able to find a test file that meets this criteria`.
It appears that this isn't related to our code itself but actually in the behaviour of `convert` as regards the file in question. The error seen above is what happens when insufficient arguments are given to `convert`, and the same can be seen here:
```
runuser@70658a454946:/tmp$ convert -resize 300 Earth_Impact_Database_world_map.svg # note missing argument here
convert-im6.q16: no images defined `Earth_Impact_Database_world_map.svg' @ error/convert.c/ConvertImageCommand/3258.
runuser@70658a454946:/tmp$ convert -resize 300 "UitlitéVsPénibilité-François-Dominique.png" abcd.png # sufficient arguments provided here, weird?
convert-im6.q16: no images defined `abcd.png' @ error/convert.c/ConvertImageCommand/3258.
```
Note the reference to `png:-` is expected - this is us hoping to emit the image via stdout:
```
By default, the image format of `file' is determined by its magic number. To specify a particular image format, precede the filename with an image format
name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). Specify 'file' as '-' for standard input or output.
```