Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticated Federated Images not loading with mautrix-discord #17618

Closed
TheNamelessWonderer opened this issue Aug 27, 2024 · 4 comments
Closed

Comments

@TheNamelessWonderer
Copy link

TheNamelessWonderer commented Aug 27, 2024

Description

Images from Mautrix-Discord running in direct media mode is failing to federate images since authenticated media is enabled. It works correctly from a client that doesn't support authenticated media. The error is: Requested file is too large > 435 bytes.

Steps to reproduce

  • Load a channel where the mautrix-discord bot is in and an image was sent from Discord
  • Try to load the image
  • See error

Homeserver

Synapse

Synapse Version

1.114.0rc1

Installation Method

Docker (matrixdotorg/synapse)

Database

Signal PostgreSQL server. Not restored from backup and never used SQLite

Workers

Single process

Platform

Debian 12 running in KVM

Configuration

Presence is enabled but not synapse modules or message retention.

Relevant log output

2024-08-27 21:13:22,190 - synapse.access.http.8008 - 473 - INFO - GET-2352 - 192.168.20.22 - 8008 - {@thenamelesswonderer:redacted.org} Processed request: 0.140sec/0.001sec (0.006sec, 0.000sec) (0.000sec/0.001sec/1) 91B 502 "GET /_matrix/client/v1/media/thumbnail/discord-bridge.redacted.org/8J-QiERJU0NPUkQBAQ-XB6xlBDCMEbsyW3AEAAwRuzJbcwAredacted-Mzy4XzM-jIY?width=400&height=255&method=scale HTTP/1.1" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_8_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.6 Mobile/15E148 Safari/604.1" [0 dbevts]
2024-08-27 21:13:22,205 - synapse.http.client - 428 - INFO - GET-2350 - Received response to GET https://cdn.discordapp.com/attachments/1123375069062770828/12776597redacted/slayerImage.png?ex=66cf4a53&is=66cdf8d3&hm=9c0849276fc75891eb36352a44bredacted&: 200
2024-08-27 21:13:22,206 - synapse.media.media_repository - 902 - WARNING - GET-2350 - Failed to fetch remote media discord-bridge.redacted.org/8J-QiERJU0NPUkQBAQ-XB6xlBDCMEbsouy9CEFwRuyiredacted
2024-08-27 21:13:22,206 - synapse.http.server - 130 - INFO - GET-2350 - <XForwardedForRequest at 0x7f8351597450 method='GET' uri='/_matrix/client/v1/media/thumbnail/discord-bridge.redacted.org/8J-QiERJU0NPUkQBAQ-XB6xlBDCMEbsouy9CEFredacted?width=400&height=255&method=scale' clientproto='HTTP/1.1' site='8008'> SynapseError: 502 - Requested file is too large > 435 bytes

Anything else that would be useful to know?

The setting: max_upload_size is set to 900M.

@anoadragon453
Copy link
Member

Requested file is too large > 435 bytes

From looking at the code, it appears that the "435 bytes" is always derived from the max_upload_size config option. Can you double-check that max_upload_size is actually set to 900M?

You can make a request to /_matrix/client/v1/media/config with an authenticated HTTP client. The max upload size in bytes will be returned under the JSON field m.upload.size.

Click to view an example of making a request
curl -XGET -H "Authorization: Bearer syt_YourUserAccessTokenHere" https://your.server/_matrix/client/v1/media/config

@TheNamelessWonderer
Copy link
Author

Thanks for the reply. I've ran the command and it returned the following: {"m.upload.size":943718400}%

Assuming that this is bytes then this correctly returns 900M.

@anoadragon453
Copy link
Member

#17543 may solve this, and will be included in v1.115, which is expected to go out in a few weeks.

Could you test again when it comes out? (Or test against the develop branch if you're confident enough.)

@TheNamelessWonderer
Copy link
Author

TheNamelessWonderer commented Aug 30, 2024

Hello I've just tried 1.114.0rc3 which includes this patch and the issue is resolved!

Thank you very much!

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

No branches or pull requests

2 participants