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

Media download error in Element-Desktop 1.11.86: “! error downloading image matrix” #2003

Open
Dunduk99 opened this issue Nov 22, 2024 · 0 comments
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@Dunduk99
Copy link

Dunduk99 commented Nov 22, 2024

Steps to reproduce

1.	Install Element-Desktop version 1.11.84, 1.11.85, or 1.11.86 on a Linux system Debian 12.
2.	Log in to a self-hosted Matrix server configured with Nginx as a reverse proxy.
3.	Join a room or start a direct message.
4.	Send or receive an image file.
5.	Try to download or view the image.

Outcome: The image does not load, and the client displays the error:
! error downloading image matrix.
Logs from Element-Desktop console:

Access to fetch at https://example.com/_matrix/client/v1/media/download/room22/iRuxgrAfspaiDcWBllvLKKlo?allow_redirect=true 
from origin  vector://vector' has been blocked by CORS policy: No  Access-Control-Allow-Origin  header is present on the requested resource.

Unable to download attachment to decrypt it: DownloadError: Failed to fetch
    at a.downloadSource (Media.ts:144:27)
    at d (DecryptFile.ts:49:38)
    at r.getFn (MediaEventHelper.ts:88:24)
    at get value (LazyValue.ts:40:26)
    at r.getFn (MediaEventHelper.ts:66:51)
    at get value (LazyValue.ts:40:26)
    at O.downloadImage (MImageBody.tsx:255:62)
    at O.componentDidMount (MImageBody.tsx:266:18)
    at yI (react-dom.production.min.js:260:217)
    at bI (react-dom.production.min.js:259:46)

GET https://example.com/_matrix/client/v1/media/download/room22/iRuxgrAfspaiDcWBllvLKKlo?allow_redirect=true net::ERR_FAILED

Access to fetch at https://example.com/_matrix/media/v3/download/room22/ZGZwEudLGsfsefOeeaMpuKVW?allow_redirect=true
from origin vector://vector has been blocked by CORS policy: No Access-Control-Allow-Origin header is present on the requested resource.

My Matrix server is hosted on Debian 12 with Nginx as a reverse proxy.
The server is non-federated and used for private purposes only.
My Nginx configuration is slightly different from the standard setup. Here’s the configuration:

    location /custompath/ {
        proxy_pass http://localhost:8008/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass_request_headers on;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

The issue started with Element-Desktop 1.11.84. Everything worked flawlessly in version 1.11.83 with the same server configuration.
It seems that something changed in how media URLs or paths are handled in Element-Desktop. Could stricter path handling or enforced absolute links have been introduced?

Outcome

What did you expect?

  • Media files (e.g., photos or images) should download and display correctly in the Element-Desktop client, as they did in version 1.11.83.
  • Users should be able to receive, decrypt, and view images in rooms or direct messages without errors.

What happened instead?

  • The client displays the error ! error downloading image matrix.
  • Media files (only photos or images) fail to download or decrypt.
  • The browser console logs show CORS-related issues, specifically the absence of Access-Control-Allow-Origin headers.
  • The issue only occurs on Element-Desktop versions 1.11.84, 1.11.85, and 1.11.86. Earlier versions work without issues.
  • iOS clients using the same server configuration can download and view media files (photos/images) without errors.

Operating system

Linux Debian Bookworm

Application version

1.11.86

How did you install the app?

apt get install element-desktop

Homeserver

matrix-synapse 1.119.0

Will you send logs?

Yes

@dosubot dosubot bot added O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Nov 22, 2024
@Dunduk99 Dunduk99 changed the title Media download error in Element-Desktop 11.1.86: “! error downloading image matrix” Media download error in Element-Desktop 1.11.86: “! error downloading image matrix” Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

1 participant