[Bug]: cannot upload large file to external S3 storage - timeout
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
When uploading to S3 private managed server (I don't know the backend, if it is MinIO, etc.) and S3 public managed server (Scaleway, GCS), the upload is in success for small file (100MB) but not for large file (4GB).
The reason for S3 private server:
"Message":"An exception occurred while uploading parts to a multipart upload.
The following parts had errors:
- Part 6: Error executing \"UploadPart\" on \"https://[REDACTED_BUCKET].[REDACTED_URL]/[REDACTED_LARGE_FILE]?partNumber=6&uploadId=2~apkQo4kby0aJF5GwEYLYtNiGoUdmdQ3\";
AWS HTTP error: cURL error 28: SSL connection timeout (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://[REDACTED_BUCKET].[REDACTED_URL]/[REDACTED_LARGE_FILE]?partNumber=6&uploadId=2~apkQo4kby0aJF5GwEYLYtNiGoUdmdQ3"
at "File":"/var/www/html/lib/private/Files/ObjectStore/S3ObjectTrait.php","Line":130 and previous exception:
"Previous":{"Exception":"Aws\\S3\\Exception\\S3MultipartUploadException"
For S3 public server GCS:
Error while uploading to S3 bucket
at "File":"/var/www/html/3rdparty/aws/aws-sdk-php/src/Multipart/AbstractUploadManager.php","Line":134
Steps to reproduce
1.Deploy Nextcloud
2.Enable External Storage
3.Connect to a bucket at Scaleway
4.Upload small file (100MB): it works
5.Upload large file (4GB): it fails at MOVE operation
Expected behavior
The large file upload works.
Nextcloud Server version
30
Operating system
None
PHP engine version
None
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
"htaccess.RewriteBase": "\/",
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"debug": true,
"check_data_directory_permissions": false,
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"forwarded_for_headers": [
"HTTP_X_FORWARDED_FOR"
],
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"password": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"upgrade.disable-web": true,
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"my-nextcloud.nextcloud",
"REDACTED_URL"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "30.0.6.2",
"overwrite.cli.url": "http:\/\/localhost",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"skeletondirectory": "\/dev\/null",
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
}
}
List of activated Apps
Enabled:
- activity: 3.0.0
- bruteforcesettings: 3.0.0
- cloud_federation_api: 1.13.0
- comments: 1.20.1
- dav: 1.31.1
- federatedfilesharing: 1.20.0
- files: 2.2.0
- files_downloadlimit: 3.0.0
- files_external: 1.22.0
- files_pdfviewer: 3.0.0
- files_sharing: 1.22.0
- files_trashbin: 1.20.1
- logreader: 3.0.0
- lookup_server_connector: 1.18.0
- notifications: 3.0.0
- oauth2: 1.18.1
- password_policy: 2.0.0
- provisioning_api: 1.20.0
- serverinfo: 2.0.0
- settings: 1.13.0
- survey_client: 2.0.0
- text: 4.1.0
- theming: 2.6.0
- twofactor_backupcodes: 1.19.0
- updatenotification: 1.20.0
- user_ldap: 1.21.0
- user_status: 1.10.0
- viewer: 3.0.0
- workflowengine: 2.12.0
Disabled:
- admin_audit: 1.20.0
- app_api: 4.0.6 (installed 4.0.6)
- circles: 30.0.0 (installed 30.0.0)
- contactsinteraction: 1.11.0 (installed 1.11.0)
- dashboard: 7.10.0 (installed 7.10.0)
- encryption: 2.18.0
- federation: 1.20.0 (installed 1.20.0)
- files_antivirus: 5.6.1 (installed 5.6.1)
- files_reminders: 1.3.0 (installed 1.3.0)
- files_versions: 1.23.0 (installed 1.23.0)
- firstrunwizard: 3.0.0 (installed 3.0.0)
- nextcloud_announcements: 2.0.0 (installed 2.0.0)
- photos: 3.0.2 (installed 3.0.2)
- privacy: 2.0.0 (installed 2.0.0)
- recommendations: 3.0.0 (installed 3.0.0)
- related_resources: 1.5.0 (installed 1.5.0)
- sharebymail: 1.20.0 (installed 1.20.0)
- support: 2.0.0 (installed 2.0.0)
- suspicious_login: 8.0.0
- systemtags: 1.20.0 (installed 1.20.0)
- twofactor_nextcloud_notification: 4.0.0
- twofactor_totp: 12.0.0-dev
- user_oidc: 7.1.0 (installed 7.1.0)
- user_saml: 6.5.0 (installed 6.5.0)
- weather_status: 1.10.0 (installed 1.10.0)
- webhook_listeners: 1.1.0-dev (installed 1.1.0-dev)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
Lots lots lots of logs, but I pasted the relevant lines above
Additional info
Nextcloud Helm 6.6.9
OpenShift 4.15
https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html => applied
Upload of large file (4GB) directly at Nextcloud volume, but not at S3 backend works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/private/Files/ObjectStore/S3ObjectTrait.php around line 130 and the AWS SDK path at 3rdparty/aws/aws-sdk-php/src/Multipart/AbstractUploadManager.php around line 134. Reproduce the difference between a 100MB and 4GB upload to external S3 storage, then compare it with the working upload to the local Nextcloud volume; done means the large external upload completes without the reported timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, php
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100