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

Traceback when fetching remote media #10318

@moritzdietz

Description

@moritzdietz

Description

When I was watching the homeserver.log file I noticed the following lines going by.

2021-07-05 22:56:01,678 - synapse.http.server - 93 - ERROR - GET-114720 - Failed handle request via 'ThumbnailResource': <XForwardedForRequest at 0x7f74e7313400 method='GET' uri='/_matrix/media/r0/thumbnail/matrix.org/dOhWUOiqfTEPQASnYCLKLINu?width=800&height=600&method=scale' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 286, in _async_render
    callback_return = await raw_callback_return
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/media/v1/thumbnail_resource.py", line 83, in _async_render_GET
    await self._respond_remote_thumbnail(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/media/v1/thumbnail_resource.py", line 265, in _respond_remote_thumbnail
    await self._select_and_respond_with_thumbnail(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/media/v1/thumbnail_resource.py", line 306, in _select_and_respond_with_thumbnail
    file_info = self._select_thumbnail(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/media/v1/thumbnail_resource.py", line 481, in _select_thumbnail
    thumbnail_info = min(info_list)[-1]
TypeError: '<' not supported between instances of 'dict' and 'dict'

I couldn't find an open or closed issue regarding this error so I thought I'd open an issue for it.

Steps to reproduce

I can reproduce it with curl

curl "https://matrix.moritzdietz.com/_matrix/media/r0/thumbnail/matrix.org/dOhWUOiqfTEPQASnYCLKLINu?width=800&height=600&method=scale"

which results in the error above.
I can fetch the media just fine via matrix.org:

curl -L "https://matrix-federation.matrix.org/_matrix/media/r0/thumbnail/matrix.org/dOhWUOiqfTEPQASnYCLKLINu?width=800&height=600&method=scale" -o somemedia.png

Version information

  • Homeserver: matrix.moritzdietz.com

If not matrix.org:

  • Version: 1.37.1

  • Install method: package manager

  • Platform: Ubuntu 20.04 Server

I have dynamic_thumbnails set to false (as it's the default).

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions