Fail to upload to Cloudflare R2 for files larger than 50MB and/or chunked files

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.5
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • nginx 1.22.1 with FastCGI
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Uploading a 1.2GB file, and setting loglevel to 0
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Server Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Unproxied Cloudflare

Summary of the issue you are facing:

I am trying to upload a 1.2GB (.tar.gpg) file to my nextcloud instance with Cloudflare R2 configured as internal storage, Nexcloud client says “Connection Closed,” in error logs there were errors about an object not existing, but I check Cloudflare Dashboard, and it does exist, but empty. I set log_level => 0 in /var/www/nextcloud/config/config.php and run occ log:file but there are no logs (not even warning or error) except for debug/info logs of several apps and cron.

Log entries

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

"PUT /remote.php/dav/uploads/swee/***/00001 HTTP/1.1" 412 324 "-" "Mozilla/5.0 (Linux) mirall/3.15.2 (Nextcloud, alpine-6.15.0-0-edge ClientArchitecture: x86_64 OsArchitecture: x86_64)"

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

config:list system

{
    "system": {
        "objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "nextcloud",
                "hostname": "***.r2.cloudflarestorage.com",
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "use_path_style": true,
                "region": "auto",
                "use_ssl": true,
                "autocreate": true,
                "verify_bucket_exists": true,
                "sse_c_key": "***REMOVED SENSITIVE VALUE***"
            }
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "n.swee.codes"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.5.1",
        "overwrite.cli.url": "https:\/\/n.swee.codes",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "enforce_theme": "dark",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "maintenance_window_start": 7,
        "default_phone_region": "US",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [],
        "theme": "",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "loglevel": 0
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - announcementcenter: 7.1.2
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.3.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contacts: 7.1.1
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - deck: 1.15.1
  - discoursesso: 1.31.0
  - encryption: 2.19.0
  - end_to_end_encryption: 1.17.0
  - external: 6.0.2
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - forms: 5.1.0
  - integration_discourse: 2.3.0
  - integration_giphy: 2.0.2
  - integration_github: 3.2.1
  - integration_gitlab: 3.2.0
  - integration_google: 3.2.0
  - integration_mastodon: 3.1.1
  - integration_onedrive: 3.4.0
  - integration_openstreetmap: 2.1.0
  - integration_peertube: 1.2.0
  - integration_youtube: 0.3.1
  - keeweb: 0.6.21
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 5.1.1
  - music: 2.1.4
  - news: 26.0.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.12.1
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - onlyoffice: 9.9.0
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.6.5
  - richdocumentscode: 25.4.202
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - socialsharing_diaspora: 3.3.0
  - socialsharing_email: 3.3.0
  - socialsharing_facebook: 3.3.0
  - socialsharing_twitter: 3.3.0
  - spreed: 21.0.4
  - support: 3.0.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - twofactor_webauthn: 2.2.0
  - twothousandandfortyeight: 1.0.2
  - unroundedcorners: 1.1.4
  - updatenotification: 1.21.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - whiteboard: 1.0.5
  - workflowengine: 2.13.0
Disabled:
  - mail_roundcube: 1.2.1 (installed 1.2.1)
1 Like

Update: Logs have appeared again, Client says it gets error 500, I get these errors when uploading:

{"reqId":"JJjRBV6wAha7HJF6ZYmt","level":3,"time":"2025-05-31T23:06:46+00:00","remoteAddr":"2601:600:9480:3b50:2348:f5d4:bf41:3103","user":"swee","app":"no app in context","method":"MKCOL","url":"/remote.php/dav/uploads/swee/web-file-upload-4ec6948d866484b3","message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0","version":"31.0.5.1","exception":{"Exception":"Exception","Message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","Code":404,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","line":441,"function":"writeStream","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","line":349,"function":"writeBack","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->"},{"function":"OC\\Files\\ObjectStore\\{closure}","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php","line":117,"function":"call_user_func"},{"function":"stream_close","class":"Icewind\\Streams\\CallbackWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":876,"function":"fclose","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":215,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":28,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":100,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":117,"function":"getUploadFile","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"afterMkcol","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":482,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":400,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","Line":556,"message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","exception":{},"CustomMessage":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)"}}
{"reqId":"JJjRBV6wAha7HJF6ZYmt","level":3,"time":"2025-05-31T23:06:46+00:00","remoteAddr":"2601:600:9480:3b50:2348:f5d4:bf41:3103","user":"swee","app":"webdav","method":"MKCOL","url":"/remote.php/dav/uploads/swee/web-file-upload-4ec6948d866484b3","message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0","version":"31.0.5.1","exception":{"Exception":"Sabre\\DAV\\Exception","Message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":275,"function":"convertToSabreException","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":28,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":100,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":117,"function":"getUploadFile","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"afterMkcol","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":482,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":400,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":598,"Previous":{"Exception":"Exception","Message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","Code":404,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","line":441,"function":"writeStream","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","line":349,"function":"writeBack","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->"},{"function":"OC\\Files\\ObjectStore\\{closure}","class":"OC\\Files\\ObjectStore\\ObjectStoreStorage","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php","line":117,"function":"call_user_func"},{"function":"stream_close","class":"Icewind\\Streams\\CallbackWrapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":876,"function":"fclose","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":322,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":215,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":28,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":100,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingV2Plugin.php","line":117,"function":"getUploadFile","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"afterMkcol","class":"OCA\\DAV\\Upload\\ChunkingV2Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":482,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":400,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php","Line":556},"message":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)","exception":{},"CustomMessage":"Object not found after writing (urn: urn:oid:22857, path: uploads/web-file-upload-4ec6948d866484b3/.target)"}}

Again, checking the Cloudflare dashboard, the object does exist, but it’s empty

Perhaps needs a delay, or an error with multi-part uploading?

And it seems to only happen when it’s more than around 50MB (found out it was less than 100MB) and/or chunked by the client (I have proxying OFF on my instance in cloudflare DNS), they also said that the S3 api has a larger file size limit

Tried:

  • Setting uploadPartSize to 5242880 (5MB) in config.php
  • Setting concurrency to 1 in config.php
  • Following the guide Uploading big files > 512MB
  • Running occ config:app:set files max_chunk_size --value 5242880
  • Setting the max filesize to 9999G on nginx

But MKCOL still gives a blank HTTP 500 error and the logs have the same error

When making a browser upload:

Uncaught (in promise) 
Object { message: "Request failed with status code 500", name: "AxiosError", code: "ERR_BAD_RESPONSE", config: {…}, request: XMLHttpRequest, response: {…}, status: 500, stack: "", … }
​
code: "ERR_BAD_RESPONSE"
​
config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }
​
message: "Request failed with status code 500"
​
name: "AxiosError"
​
request: XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, … }
​​
mozAnon: false
​​
mozSystem: false
​​
onabort: function onabort()
​​
onerror: function onerror()
​​
onload: null
​​
onloadend: function E()
​​
onloadstart: null
​​
onprogress: null
​​
ontimeout: function ontimeout()
​​
readyState: 4
​​
response: ""
​​
responseText: ""
​​
responseType: ""
​​
responseURL: "https://n.swee.codes/remote.php/dav/uploads/swee/web-file-upload-0c0575ec0c55131f"
​​
responseXML: null
​​
status: 500
​​
statusText: ""
​​
timeout: 0
​​
upload: XMLHttpRequestUpload { onloadstart: null, onprogress: null, onabort: null, … }
​​
withCredentials: false
​​
<prototype>: XMLHttpRequestPrototype { open: open(e, n, i), setRequestHeader: setRequestHeader(), send: send(), … }
​
response: Object { data: "", status: 500, statusText: "", … }
​​
config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }
​​
data: ""
​​
headers: Object { "content-length": "0", "content-security-policy": "default-src 'none';", "content-type": "application/xml; charset=utf-8", … }
​​
request: XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, … }
​​​
mozAnon: false
​​​
mozSystem: false
​​​
onabort: function onabort()
​​​
onerror: function onerror()
​​​
onload: null
​​​
onloadend: function E()
​​​
onloadstart: null
​​​
onprogress: null
​​​
ontimeout: function ontimeout()
​​​
readyState: 4
​​​
response: ""
​​​
responseText: ""
​​​
responseType: ""
​​​
responseURL: "https://n.swee.codes/remote.php/dav/uploads/swee/web-file-upload-0c0575ec0c55131f"
​​​
responseXML: null
​​​
status: 500
​​​
statusText: ""
​​​
timeout: 0
​​​
upload: XMLHttpRequestUpload { onloadstart: null, onprogress: null, onabort: null, … }
​​​
withCredentials: false
​​​
<prototype>: XMLHttpRequestPrototype { open: open(e, n, i), setRequestHeader: setRequestHeader(), send: send(), … }
​​
status: 500
​​
statusText: ""
​​
<prototype>: Object { … }
​
stack: "r@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3668864\nE@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4844689\nEventHandlerNonNull*95167/m</<@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4844822\n95167/m<@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4844135\nm@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:2015652\npromise callback*_request@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:2018721\nrequest@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:2017140\n12125/a/<@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:431227\n4011/upload/</t<@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:318612\n4011/upload/<@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:318772\n@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287276\ni@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287015\nupload@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:317331\n4011/uploadDirectory/<@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:317010\nasync*@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287276\ni@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287015\nuploadDirectory@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:316346\n4011/batchUpload/<@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:315116\nasync*@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287276\ni@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:3287015\nbatchUpload@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:314815\nonPick@https://n.swee.codes/dist/files-main.js?v=ec818334-16:1:326766\npn@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4524290\nn@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4517022\n85471/Rr/i._wrapper@https://n.swee.codes/dist/core-common.js?v=ec818334-16:1:4557089\n"
​
status: 500
​
<prototype>: Object { constructor: r(e, t, n, a, r), toJSON: toJSON(), stack: "", … }
index-Dkr9ebK1.mjs:845:49

Try adding 'validateWrites' = false in the stanza for that object store in your config.php.

Found in allow disabling object store write check by icewind1991 · Pull Request #33458 · nextcloud/server · GitHub

…ah dang, based on Consistency model · Cloudflare R2 docs it seems unlikely to help, unless your R2 is somehow configured for eventual consistency? Maybe there’s just a bug.

Hm, adding it to the stanza did nothing, and also isn’t detected by occ config:list system (neither is uploadPartSize!!)

PHP:

'objectstore' => 
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 'nextcloud',
      'hostname' => '***.r2.cloudflarestorage.com',
      'key' => '***',
      'secret' => '***',
      'use_path_style' => true,
      'region' => 'auto',
      'use_ssl' => true,
      'autocreate' => true,
      'verify_bucket_exists' => true,
      'sse_c_key' => '***',
      'validateWrites' => false,
      'uploadPartSize' => 5242880,
    ),
  ),

occ config:list system:

"objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "nextcloud",
                "hostname": "***.r2.cloudflarestorage.com",
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "use_path_style": true,
                "region": "auto",
                "use_ssl": true,
                "autocreate": true,
                "verify_bucket_exists": true,
                "sse_c_key": "***REMOVED SENSITIVE VALUE***"
            }
        }

Update: I found out I was writing my configuration in the wrong place. I wrote the properties in config.php while Nextcloud was reflecting to s3.config.php

output of occ config:list system

{
    "system": {
        "objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "nextcloud",
                "hostname": "***.r2.cloudflarestorage.com",
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "use_path_style": true,
                "region": "auto",
                "use_ssl": true,
                "autocreate": true,
                "verify_bucket_exists": true,
                "concurrency": 1,
                "validateWrites": false,
                "sse_c_key": "***REMOVED SENSITIVE VALUE***"
            }
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "n.swee.codes"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.5.1",
        "overwrite.cli.url": "https:\/\/n.swee.codes",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "enforce_theme": "dark",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "maintenance_window_start": 7,
        "default_phone_region": "US",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [],
        "theme": "",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "loglevel": 2
    }
}

Thank you so much! This has fixed my issue completely, now I can upload large files :3

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.