`408 Request timeout` error on file upload
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [X] This is a **bug**, not a question or an enhancement.
- [X] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [X] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
The error occurs while uploading a file via the Nextcloud app. I do not know how to reproduce it, as it was just reported to me by one of the users of my Nextcloud server.
### Expected behaviour
The file upload should succeed, and the `PUT` request to the `/remote.php/dav/files/` endpoint return with status code `201`.
### Actual behaviour
After 30s-60s, the upload fails with the following error message:

Restarting the upload yields the same error most of the time, until it randomly succeeds after 10-20 retries.
Uploading the file via the Nextcloud webinterface works flawlessly.
The Nginx reverse proxy log is attached.
### Android version
13 (lineage_pdx214-userdebug 13 TQ3A.230901.001 eng.root.20231212.172335 dev-keys)
### Device brand and model
Sony Xperia 5 III
### Stock or custom OS?
Custom (explain in "additional information")
### Nextcloud android app version
3.26.0
### Nextcloud server version
27.1.5
### Using a reverse proxy?
Yes
### Android logs
_No response_
### Server error logs
```bash
Nginx:
220.135.71.106 - Alexander [05/Jan/2024:22:05:10 +0000] "HEAD /remote.php/dav/files/Alexander/Alexander/02%20Bilder/01%20Bilder/202x/2024_01%20Taipeh%20und%20Bangkok/01.%20-%2002.%20PVG/20240101_132708.JPG HTTP/1.1" 404 0 "-" "Mozilla/5.0
(Android) Nextcloud-android/3.26.0"
220.135.71.106 - Alexander [05/Jan/2024:22:06:24 +0000] "PUT /remote.php/dav/files/Alexander/Alexander/02%20Bilder/01%20Bilder/202x/2024_01%20Taipeh%20und%20Bangkok/01.%20-%2002.%20PVG/20240101_132708.JPG HTTP/1.1" 408 0 "-" "Mozilla/5.0
(Android) Nextcloud-android/3.26.0"
```
### Additional information
The Android app is running on LineageOS, and the Nextcloud server on NixOS unstable.
Nginx config:
```
location ~ \.php(?:$|/) {
# legacy support (i.e. static files and directories in cfg.package)
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[s]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
include /nix/store/4595gizbhh4grdynsb4pv8d0zhi09dqw-nginx-1.24.0/conf/fastcgi.conf;
fastcgi_split_path_info ^(.+?\.php)(\\/.*)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name =404;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass unix:/run/phpfpm/nextcloud.sock;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
fastcgi_read_timeout 120s;
}
```
I am unable to post logcat logs because the person experiencing the bug is on the other side of the planet, without a computer that can run `adb`.
Contributor guide
Assessment
This issue has not been assessed yet.