element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
Apache License 2.0
1.13k stars 257 forks source link

Video Upload always fails in Element when run through Tor #1691

Open Sazu-bit opened 3 months ago

Sazu-bit commented 3 months ago

Steps to reproduce

Steps to reproduce

How to Replicate

  1. Have TOR daemon running.

  2. run: a. nohup sh -c 'element-desktop --proxy-server=socks5://127.0.0.1:9050 --profile DebugProfile' > ~/nohup-DebugProfile.out &

  3. Attempt to send video to another person.

What I expect to happen Video uploads

What actually happens Video bar progresses quickly then error declaring that the upload has failed appears.

Network Tab shows:

Upload status: Cancelled after 30.23s

It seems quite obvious what's happening, but how do I fix it?

Outcome

What did you expect?

File to upload

What happened instead?

File cancelled itself

Operating system

Linux

Application version

1.11.67

How did you install the app?

Built from source

Homeserver

No response

Will you send logs?

No - The networking output shows clearly what element is doing and why it won't upload the video. Timeout is reached.

Sazu-bit commented 3 months ago

https://github.com/element-hq/element-desktop/issues/1690 related.

t3chguy commented 3 months ago

Will you send logs? Yes

Not seeing any logs linking to this issue

Sazu-bit commented 3 months ago

vector.txt

This is the network output after using ctrl+I and attempting to upload. It's exactly as I said in the post.

It starts the upload, it reaches 30s (timeout=30000) and then cancels itself. All statuses are 200 until that point where it turns to (canceled) type: xhr.

t3chguy commented 3 months ago

Please use the required log upload mechanism so that it is parsed by our rageshake tooling accordingly as per the issue template you agreed to:

image

Sazu-bit commented 3 months ago

Should see them shortly.

t3chguy commented 3 months ago

Looks like a duplicate of https://github.com/element-hq/element-web/issues/25756

Sazu-bit commented 3 months ago

That one might be cloudflare, can confirm my Homeserver doesn't use cloudflare, nor am I attempting to send multiple files, just the one. Also I'm using the desktop version not the web version, just to confirm.

Perhaps, related instead of duplicate?

The fix I would believe would be to extend the timeout locally but I have no idea how to go about this.

t3chguy commented 3 months ago

The fix I would believe would be to extend the timeout locally but I have no idea how to go about this.

https://github.com/matrix-org/matrix-js-sdk/blob/7c876251575ebe0b17b97cd25ef7fe6308bca5de/src/http-api/index.ts#L72

dbkr commented 2 months ago

I'm going to call this 'platform specific' to reflect the fact that it only happens through Tor. Is this still a bug? If so, we could accept a PR for this but realistically it's unlikely to make it onto our roadmap.

Sazu-bit commented 2 months ago

Yes this is still a bug as I haven't been able to get Element to compile properly since (something changed in the software stack and my system won't work well with it -_-).

Given how important Tor is to maintaining Anonymity and Security and given Matrix's unique selling point (secure, decentralized communication), I've been constantly surprised that there hasn't been more testing done with Tor, which would allow a better reach to those that need the ability to communicate securely the most (see China, Iran or Russia for examples).

I'm aware that Element/Matrix are largely focused on other things right now, but this is a relatively (compared to some of the things I've seen being discussed) quick win.

Expose the timeout variable so that it can be configured in the settings, default it to 30s. It's confused me for a while, why this isn't already a thing, but again, I do understand that there has been bigger fish to fry.