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

Image upload fails with elementX #2389

Closed
fuomag9 opened this issue Aug 8, 2023 · 4 comments · Fixed by #2402
Closed

Image upload fails with elementX #2389

fuomag9 opened this issue Aug 8, 2023 · 4 comments · Fixed by #2402
Assignees
Labels
A-Media bug Something isn't working

Comments

@fuomag9
Copy link

fuomag9 commented Aug 8, 2023

Issue

Hi, uploading images with elementX does not work, while it does with element, so I do not believe this is a server issue. Furthermore the logs report a Request must specify a Content-Length error, which seems a client side misconfiguration to me

I'm using caddy as my reverse proxy, with a fix for TLS1.2 clients due to element-hq/element-x-ios#786

chat.fuo.fi {

import bind-ipv6-public
import bind-ipv4-public

reverse_proxy /_matrix/* http://localmatrix:8008
reverse_proxy /_synapse/client/* http://localmatrix:8008

request_body {
  max_size 100MB
}


import fix-elementx

# HSTS (63072000 seconds)
header / Strict-Transport-Security "max-age=63072000"
}
(fix-elementx) {

@tls12only {
header_regexp User-Agent Element X
}

tls @tls12only {
protocols tls1.2 tls1.2
}


}

Logs

2023-08-08T16:08:23.084759Z  INFO root: elementx: MediaUploadingPreprocessor.swift:259: No GPS metadata found. Returning original image
2023-08-08 18:08:23.943248+0200 ElementX[13991:2406456] [SwiftUI] Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.
2023-08-08T16:08:23.944621Z DEBUG root:send_attachment:send{homeserver="https://chat.fuo.fi/" server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6] config=RequestConfig { timeout: 300s } request_id="REQ-92" request_size="71.3 kiB" path="/_matrix/media/v3/upload"}: matrix_sdk::http_client: crates/matrix-sdk/src/http_client/mod.rs:198: Sending request
2023-08-08T16:08:23.970961Z DEBUG root:send_attachment:send{homeserver="https://chat.fuo.fi/" server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6] config=RequestConfig { timeout: 300s } request_id="REQ-93" request_size="2.4 MiB" path="/_matrix/media/v3/upload"}: matrix_sdk::http_client: crates/matrix-sdk/src/http_client/mod.rs:198: Sending request
2023-08-08 18:08:23.982618+0200 ElementX[13991:2403520] [default] Image analysis failed with error Error Domain=com.apple.VisionKit.ImageAnalyzer Code=-4 "Device Not Supported" UserInfo={NSLocalizedDescription=Device Not Supported} #ImageAnalysis
2023-08-08T16:08:24.100427Z DEBUG root:send_attachment:send{homeserver="https://chat.fuo.fi/" server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6] config=RequestConfig { timeout: 300s } request_id="REQ-92" request_size="71.3 kiB" path="/_matrix/media/v3/upload" status=400 response_size="71 B"}: matrix_sdk::http_client: crates/matrix-sdk/src/http_client/mod.rs:208: Error while sending request: Api(Server(ClientApi(Error { status_code: 400, body: Standard { kind: Unknown, message: "Request must specify a Content-Length" } })))
2023-08-08T16:08:24.101315Z ERROR root: elementx: MediaUploadPreviewScreenViewModel.swift:63: Failed sending attachment with error: failedSendingMedia
2023-08-08 18:08:24.137048+0200 ElementX[13991:2406456] [default] Image analysis failed with error Error Domain=com.apple.VisionKit.ImageAnalyzer Code=-4 "Device Not Supported" UserInfo={NSLocalizedDescription=Device Not Supported} #ImageAnalysis

Screenshot

image
@jplatte
Copy link
Collaborator

jplatte commented Aug 10, 2023

Hey @fuomag9, AFAIK you're the first to report this but it makes sense that some servers expect a content-length and I can see why it wouldn't be set. Would you be willing to register a test account on your servers and give us the credentials such that we can test a possible fix against the real server where this problem occurs?

@fuomag9
Copy link
Author

fuomag9 commented Aug 10, 2023

Hey @fuomag9, AFAIK you're the first to report this but it makes sense that some servers expect a content-lenght and I can see why it wouldn't be set. Would you be willing to register a test account on your servers and give us the credentials such that we can test a possible fix against the real server where this problem occurs?

Sure! Where can I share the credentials securely?

@jplatte
Copy link
Collaborator

jplatte commented Aug 10, 2023

Hm, Matrix DM should be good enough, right? Happy to delete the account after this is fixed. I'm @jplatte:flipdot.org.

@jplatte jplatte added bug Something isn't working A-Media labels Aug 10, 2023
@fuomag9
Copy link
Author

fuomag9 commented Aug 10, 2023

Hm, Matrix DM should be good enough, right? Happy to delete the account after this is fixed. I'm @jplatte:flipdot.org.

Account created and DM sent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Media bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants