Rageshake sometimes fails with mystery 400 error
Steps to reproduce
Rageshakes were taking a very long time to upload on roaming data, and eventually failed with a 400.
Part of this was that it was trying to reupload the logs twice: https://github.com/vector-im/element-ios/issues/6595
However, we need to have logging on the response body to see what the 400 actually was.
Outcome
What did you expect?
Rageshakes should work.
Your phone model
No response
Operating system version
No response
Application version
1.8.25-debug
Homeserver
matrix.org
Will you send logs?
Yes
Log of a failed req:
2022-08-19 12:07:06.101 Element[454:38024] [MXBugReport] sendBugReport: report failed. Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={NSLocalizedDescription=Request failed: bad request (400), NSUnderlyingError=0x29d9ef
480 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/html, NSErrorFailingURLKey=https://riot.im/bugreports/submit, com.alamofire.serializ
ation.response.error.data={length = 155, bytes = 0x3c68746d 6c3e0d0a 3c686561 643e3c74 ... 2f68746d 6c3e0d0a }, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x2952d7b40> { URL: https://riot.im/bugreports/submit } { Status Code: 400, Headers {
"Content-Length" = (
155
);
"Content-Type" = (
"text/html"
);
Date = (
"Fri, 19 Aug 2022 09:07:05 GMT"
);
Server = (
cloudflare
);
"cf-ray" = (
"73d1b9a9f87c7761-LHR"
);
} }}}, NSErrorFailingURLKey=https://riot.im/bugreports/submit, com.alamofire.serialization.response.error.data={length = 155, bytes = 0x3c68746d 6c3e0d0a 3c686561 643e3c74 ... 2f68746d 6c3e0d0a }, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x2952d7b40> { URL: htt
ps://riot.im/bugreports/submit } { Status Code: 400, Headers {
"Content-Length" = (
155
);
"Content-Type" = (
"text/html"
);
Date = (
"Fri, 19 Aug 2022 09:07:05 GMT"
);
Server = (
cloudflare
);
"cf-ray" = (
"73d1b9a9f87c7761-LHR"
);
} }}
Rather than complaining about unacceptable content type of html, we should log the html somewhere.
(given these reqs seem to fail after around 190 or 167 seconds, it might just be a timeout somewhere along the chain?)
Separately, we should switch to the modern bug submission endpoint.