Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

"ValueError: min() arg is an empty sequence" when retrieving a thumbnail #6759

Closed
babolivier opened this issue Jan 22, 2020 · 1 comment
Closed
Assignees

Comments

@babolivier
Copy link
Contributor

babolivier commented Jan 22, 2020

Here's what I have in my logs:

2020-01-22 11:06:05,981 - synapse.access.http.8008 - 233 - INFO - GET-3680- 127.0.0.1 - 8008 - Received request: GET /_matrix/media/r0/thumbnail/jki.re/otTuyVvtCxgZNIRPTsBqmqyw?width=32&height=32&method=crop
2020-01-22 11:06:05,994 - synapse.http.server - 110 - ERROR - GET-3680- Failed handle request via 'ThumbnailResource': <SynapseRequest at 0x7ff2d6f72b00 method='GET' uri='/_matrix/media/r0/thumbnail/jki.re/otTuyVvtCxgZNIRPTsBqmqyw?width=32&height=32&method=crop' clientproto='HTTP/1.1' site=8008>
Traceback (most recent call last):
  File "/home/synapse/synapse/env/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: [{'thumbnail_width': 32, 'thumbnail_height': 32, 'thumbnail_method': 'crop', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 1110, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 96, 'thumbnail_height': 96, 'thumbnail_method': 'crop', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 3985, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 320, 'thumbnail_height': 228, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 20631, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 640, 'thumbnail_height': 457, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 62058, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 800, 'thumbnail_height': 571, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 88220, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/synapse/synapse/env/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: [{'thumbnail_width': 32, 'thumbnail_height': 32, 'thumbnail_method': 'crop', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 1110, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 96, 'thumbnail_height': 96, 'thumbnail_method': 'crop', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 3985, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 320, 'thumbnail_height': 228, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 20631, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 640, 'thumbnail_height': 457, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 62058, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}, {'thumbnail_width': 800, 'thumbnail_height': 571, 'thumbnail_method': 'scale', 'thumbnail_type': 'image/jpeg', 'thumbnail_length': 88220, 'filesystem_id': 'fkJoOyHWHUVWZgQDIQLGjWqw'}]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/synapse/synapse/synapse/http/server.py", line 78, in wrapped_request_handler
    await h(self, request)
  File "/home/synapse/synapse/synapse/rest/media/v1/thumbnail_resource.py", line 78, in _async_render_GET
    request, server_name, media_id, width, height, method, m_type
  File "/home/synapse/synapse/env/lib/python3.6/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/home/synapse/synapse/synapse/rest/media/v1/thumbnail_resource.py", line 266, in _respond_remote_thumbnail
    width, height, method, m_type, thumbnail_infos
  File "/home/synapse/synapse/synapse/rest/media/v1/thumbnail_resource.py", line 334, in _select_thumbnail
    return min(crop_info_list2)[-1]
ValueError: min() arg is an empty sequence
2020-01-22 11:06:05,997 - synapse.access.http.8008 - 302 - INFO - GET-3680- 127.0.0.1 - 8008 - {None} Processed request: 0.015sec/0.001sec (0.002sec, 0.001sec) (0.001sec/0.002sec/2) 55B 500 "GET /_matrix/media/r0/thumbnail/jki.re/otTuyVvtCxgZNIRPTsBqmqyw?width=32&height=32&method=crop HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" [0 dbevts]

FWIW I'm running the current develop.

@babolivier
Copy link
Contributor Author

Fixed in #6764

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant