AWS - MalformedPOSTRequest
Steps to reproduce
- nano ../config/config.php
- add the configuration 'objectstore' => array ( 'class' => 'OC\Files\ObjectStore\S3', 'arguments' => array ( 'bucket' => '""', 'autocreate' => false, 'key' => '""', 'secret' => '""', 'hostname' => '""', 'port' => 8082, 'use_ssl' => true, 'region' => 'optional', 'use_path_style' => true, ), ),
Expected behaviour
Run Nextcloud with S3
Actual behaviour
Nextcloud response: Internal Server Error
Server configuration
Operating system: Ubuntu 16.04 Web server: Apache 2.4.18 Database: Mariadb PHP version: 7.0.22 Nextcloud version: 12.0.3 Updated from an older Nextcloud/ownCloud or fresh install: fresh install Where did you install Nextcloud from:
Signing status:
Signing status
Nothing
List of activated apps:
App list
Enabled:
- activity: 2.5.2
- bruteforcesettings: 1.0.2
- calendar: 1.5.6
- comments: 1.2.0
- dav: 1.3.0
- federatedfilesharing: 1.2.0
- federation: 1.2.0
- files: 1.7.2
- files_downloadactivity: 1.1.1
- files_external: 1.3.0
- files_pdfviewer: 1.1.1
- files_sharing: 1.4.0
- files_texteditor: 2.4.1
- files_trashbin: 1.2.0
- files_versions: 1.5.0
- files_videoplayer: 1.1.0
- logreader: 2.0.0
- lookup_server_connector: 1.0.0
- notifications: 2.0.0
- oauth2: 1.0.5
- provisioning_api: 1.2.0
- serverinfo: 1.2.0
- sharebymail: 1.2.0
- systemtags: 1.2.0
- tasks: 0.9.5
- testing: 1.2.0
- theming: 1.3.0
- twofactor_backupcodes: 1.1.1
- updatenotification: 1.2.0
- user_ldap: 1.2.1
- workflowengine: 1.2.0
Disabled:
- admin_audit
- contacts
- encryption
- gallery
- notes
Nextcloud configuration:
Config report
{
"system": {
"installed": true,
"default_language": "en",
"knowledgebaseenabled": false,
"auth.bruteforce.protection.enabled": false,
"integrity.check.disabled": true,
"overwrite.cli.url": "http:\/\/192.168.*.*",
"updatechecker": false,
"updater.release.channel": "production",
"upgrade.disable-web": true,
"appstoreenabled": false,
"mysql.utf8mb4": false,
"logfile": "\/storage\/nc\/log\/nc.log",
"loglevel": 0,
"tempdirectory": "\/storage\/tmp",
"datadirectory": "\/storage\/nc",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"memcache.local": "\\OC\\Memcache\\APCu",
"redis": {
"host": "localhost",
"port": 6379
},
"instanceid": "ocb5vvzoxtxo",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"192.168.*.*",
"192.168.*.*"
],
"dbtype": "mysql",
"version": "12.0.3.3",
"dbname": "nc",
"dbhost": "localhost",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"maintenance": false,
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory"
}
}
Are you using external storage, if yes which one: local/smb/sftp/... No Are you using encryption: yes/no No Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No
Client configuration
Browser: Safari Operating system: Mac os X
Logs
Web server error log
Web server error log
Insert your webserver log here
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"clfqq1b0tpjlG55hFcqN","level":3,"time":"2017-12-21T15:18:54+00:00","remoteAddr":"192.168.*.*”,”user":"admin","app":"no app in context","method":"GET","url":"\/favicon.ico","message":"Exception: {\"Exception\":\"Aws\\\\S3\\\\Exception\\\\S3MultipartUploadException\",\"Message\":\"An exception occurred while completing a multipart upload: Error executing \\\"CompleteMultipartUpload\\\" on \\\"https:\\\/\\\/**********:8082\\\/*******\\\/urn%3Aoid%3A310?uploadId=YqZf6ecyq8qQauMMyYbWRKcw3gwI70Cw_9cZvPMK-EAsOGBDOhOqycIYpQA\\\"; AWS HTTP error: Client error response [url] https:\\\/\\\/*********:8082\\\/******\\\/urn%3Aoid%3A310?uploadId=YqZf6ecyq8qQauMMyYbWRKcw3gwI70Cw_9cZvPMK-EAsOGBDOhOqycIYpQA [status code] 400 [reason phrase] Bad Request MalformedPOSTRequest (client): The body of your POST request is not well-formed multipart\\\/form-data. - <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<Error><Code>MalformedPOSTRequest<\\\/Code><Message>The body of your POST request is not well-formed multipart\\\/form-data.<\\\/Message><Resource>\\\/*****\\\/urn%3Aoid%3A310?uploadId=YqZf6ecyq8qQauMMyYbWRKcw3gwI70Cw_9cZvPMK-EAsOGBDOhOqycIYpQA<\\\/Resource><RequestId>3126778019<\\\/RequestId><\\\/Error>\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nc\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(203): Aws\\\\Multipart\\\\AbstractUploadManager->Aws\\\\Multipart\\\\{closure}(Object(Aws\\\\S3\\\\Exception\\\\S3Exception))\\n#1 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(156): GuzzleHttp\\\\Promise\\\\Promise::callHandler(2, Object(Aws\\\\S3\\\\Exception\\\\S3Exception), Array)\\n#2 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/TaskQueue.php(47): GuzzleHttp\\\\Promise\\\\Promise::GuzzleHttp\\\\Promise\\\\{closure}()\\n#3 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(234): GuzzleHttp\\\\Promise\\\\TaskQueue->run()\\n#4 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(267): GuzzleHttp\\\\Promise\\\\Promise->waitIfPending()\\n#5 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(225): GuzzleHttp\\\\Promise\\\\Promise->invokeWaitList()\\n#6 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(267): GuzzleHttp\\\\Promise\\\\Promise->waitIfPending()\\n#7 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(225): GuzzleHttp\\\\Promise\\\\Promise->invokeWaitList()\\n#8 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(62): GuzzleHttp\\\\Promise\\\\Promise->waitIfPending()\\n#9 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Coroutine.php(65): GuzzleHttp\\\\Promise\\\\Promise->wait()\\n#10 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(246): GuzzleHttp\\\\Promise\\\\Coroutine->GuzzleHttp\\\\Promise\\\\{closure}(true)\\n#11 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(223): GuzzleHttp\\\\Promise\\\\Promise->invokeWaitFn()\\n#12 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(267): GuzzleHttp\\\\Promise\\\\Promise->waitIfPending()\\n#13 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(225): GuzzleHttp\\\\Promise\\\\Promise->invokeWaitList()\\n#14 \\\/var\\\/www\\\/***\\\/3rdparty\\\/guzzlehttp\\\/promises\\\/src\\\/Promise.php(62): GuzzleHttp\\\\Promise\\\\Promise->waitIfPending()\\n#15 \\\/var\\\/www\\\/***\\\/3rdparty\\\/aws\\\/aws-sdk-php\\\/src\\\/Multipart\\\/AbstractUploadManager.php(83): GuzzleHttp\\\\Promise\\\\Promise->wait()\\n#16 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/S3ObjectTrait.php(99): Aws\\\\Multipart\\\\AbstractUploadManager->upload()\\n#17 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/S3ObjectTrait.php(75): OC\\\\Files\\\\ObjectStore\\\\S3->multiPartUpload('urn:oid:310', Resource id #112)\\n#18 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/ObjectStoreStorage.php(367): OC\\\\Files\\\\ObjectStore\\\\S3->writeObject('urn:oid:310', Resource id #112)\\n#19 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(349): OC\\\\Files\\\\ObjectStore\\\\ObjectStoreStorage->touch('appdata_ocb5vvz...', 1513869534)\\n#20 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(373): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->touch('appdata_ocb5vvz...', NULL)\\n#21 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(349): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->touch('appdata_ocb5vvz...', NULL)\\n#22 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/View.php(1156): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->touch('appdata_ocb5vvz...')\\n#23 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/View.php(579): OC\\\\Files\\\\View->basicOperation('touch', '\\\/appdata_ocb5vv...', Array, NULL)\\n#24 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/Node\\\/Folder.php(181): OC\\\\Files\\\\View->touch('\\\/appdata_ocb5vv...')\\n#25 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Files\\\/SimpleFS\\\/SimpleFolder.php(83): OC\\\\Files\\\\Node\\\\Folder->newFile('merged-template...')\\n#26 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/JSCombiner.php(157): OC\\\\Files\\\\SimpleFS\\\\SimpleFolder->newFile('merged-template...')\\n#27 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/JSCombiner.php(89): OC\\\\Template\\\\JSCombiner->cache('\\\/var\\\/www\\\/livebo...', 'merged-template...', Object(OC\\\\Files\\\\SimpleFS\\\\SimpleFolder))\\n#28 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/JSResourceLocator.php(105): OC\\\\Template\\\\JSCombiner->process('\\\/var\\\/www\\\/livebo...', 'core\\\/js\\\/merged-...', 'core')\\n#29 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/JSResourceLocator.php(68): OC\\\\Template\\\\JSResourceLocator->cacheAndAppendCombineJsonIfExist('\\\/var\\\/www\\\/livebo...', 'core\\\/js\\\/merged-...')\\n#30 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/ResourceLocator.php(75): OC\\\\Template\\\\JSResourceLocator->doFind('js\\\/merged-templ...')\\n#31 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/TemplateLayout.php(249): OC\\\\Template\\\\ResourceLocator->find(Array)\\n#32 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/TemplateLayout.php(132): OC\\\\TemplateLayout::findJavascriptFiles(Array)\\n#33 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/legacy\\\/template.php(205): OC\\\\TemplateLayout->__construct('guest', '')\\n#34 \\\/var\\\/www\\\/***\\\/lib\\\/private\\\/Template\\\/Base.php(132): OC_Template->fetchPage()\\n#35 \\\/var\\\/www\\\/***\\\/core\\\/templates\\\/404.php(10): OC\\\\Template\\\\Base->printPage()\\n#36 {main}\",\"File\":\"\\\/var\\\/www\\\/***\\\/3rdparty\\\/aws\\\/aws-sdk-php\\\/src\\\/Multipart\\\/AbstractUploadManager.php\",\"Line\":136}","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":"12.0.3.3"}```
</details>
Browser log
a) Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.
refer to this link
Ty @ibr123 , but not work.
to summarize what you have to do:
- install NextCloud
- open, the NextCloud server in the browser but don't do anything, don't even create admin user and keep on that page (and this is the trick)
- open your config.php file and add the same scheme
'objectstore' =>
array(
'class' => 'OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => 'xxxxx',
'autocreate' => true,
'key' => 'XXXXXX',
'secret' => 'xxxxxxxxxxxxxxxxx',
'hostname' => 's3-us-east-1.amazonaws.com',
'use_ssl' => false,
'region' => 'us-east-1',
),
),
notice the region and the host, then go the browser page and refresh and create admin and continue normally
3MultipartUploadException failed to open stream: HTTP request failed AWS HTTP error Client error response https://**********:8082 [status code] 400 : Bad Request MalformedPOSTRequest (client): The body of your POST request is not well-formed multipart
I think it's a s3 problem!!
I don't think so
The body of your POST request is not well-formed multipart
to me it seems that something is wrong in the NextCloud request, and I assume this error occurred when creating a file, have you tried to rename one of the files that already in the synced folder and see if it sync in the client? try to rename one of the files that already downloaded to the synced folder by default when you create a user and log in with that user from desktop client, such as Nextcloud.mp4
also check your S3 bucket using CloudBerry
I have similar problems using S3 as primary storage. I am on NextCloud 13.0
Here are some logs
Sabre\DAV\Exception: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}?uploadId=2~Zooq{reducted}NVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}?uploadId=2~Zooq{reducted}NVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx00000000000000005d8d8-005a7e2a6b-106ed5-nyc3a</RequestId><HostId>106ed5-nyc3a-nyc</HostId></Error>
/var/www/html/apps/dav/lib/Connector/Sabre/File.php - line 186: OCA\DAV\Connector\Sabre\File->convertToSabreException(Object(Aws\S3\Exception\S3MultipartUploadException))
/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #8)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096: OCA\DAV\Connector\Sabre\Directory->createFile('chandleroleary_...', Resource id #8)
/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('files/dnwk/imag...', Resource id #8, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
/var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
/var/www/html/remote.php - line 164: require_once('/var/www/html/a...')
{main}
Could not create object urn:oid:36263 for files/images/chandleroleary_rainier_fog_31.jpg.ocTransferId1913196134.part: {"Exception":"Aws\\S3\\Exception\\S3MultipartUploadException","Message":"An exception occurred while completing a multipart upload: Error executing \"CompleteMultipartUpload\" on \"https:\/\/nyc3.digitaloceanspaces.com\/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK\"; AWS HTTP error: Client error response [url] https:\/\/nyc3.digitaloceanspaces.com\/{reducted}\/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>MalformedXML<\/Code><BucketName>{reducted}<\/BucketName><RequestId>tx00000000000000005d8d8-005a7e2a6b-106ed5-nyc3a<\/RequestId><HostId>106ed5-nyc3a-nyc<\/HostId><\/Error>","Code":0,"Trace":"#0 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(203): Aws\\Multipart\\AbstractUploadManager->Aws\\Multipart\\{closure}(*** sensitive parameters replaced ***)\n#1 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(156): GuzzleHttp\\Promise\\Promise::callHandler(2, Object(Aws\\S3\\Exception\\S3Exception), Array)\n#2 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/TaskQueue.php(47): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}(*** sensitive parameters replaced ***)\n#3 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(234): GuzzleHttp\\Promise\\TaskQueue->run()\n#4 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(267): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#5 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(225): GuzzleHttp\\Promise\\Promise->invokeWaitList()\n#6 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(267): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#7 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(225): GuzzleHttp\\Promise\\Promise->invokeWaitList()\n#8 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(267): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#9 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(225): GuzzleHttp\\Promise\\Promise->invokeWaitList()\n#10 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#11 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Coroutine.php(65): GuzzleHttp\\Promise\\Promise->wait()\n#12 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(246): GuzzleHttp\\Promise\\Coroutine->GuzzleHttp\\Promise\\{closure}(*** sensitive parameters replaced ***)\n#13 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(223): GuzzleHttp\\Promise\\Promise->invokeWaitFn()\n#14 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(267): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#15 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(225): GuzzleHttp\\Promise\\Promise->invokeWaitList()\n#16 \/var\/www\/html\/3rdparty\/guzzlehttp\/promises\/src\/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending()\n#17 \/var\/www\/html\/3rdparty\/aws\/aws-sdk-php\/src\/Multipart\/AbstractUploadManager.php(83): GuzzleHttp\\Promise\\Promise->wait()\n#18 \/var\/www\/html\/lib\/private\/Files\/ObjectStore\/S3ObjectTrait.php(107): Aws\\Multipart\\AbstractUploadManager->upload()\n#19 \/var\/www\/html\/lib\/private\/Files\/ObjectStore\/S3ObjectTrait.php(83): OC\\Files\\ObjectStore\\S3->multiPartUpload('urn:oid:36263', Resource id #14)\n#20 \/var\/www\/html\/lib\/private\/Files\/ObjectStore\/ObjectStoreStorage.php(406): OC\\Files\\ObjectStore\\S3->writeObject('urn:oid:36263', Resource id #14)\n#21 \/var\/www\/html\/lib\/private\/Files\/ObjectStore\/ObjectStoreStorage.php(306): OC\\Files\\ObjectStore\\ObjectStoreStorage->writeBack('\/tmp\/oc_tmp_0Nj...', 'files\/images\/ch...')\n#22 [internal function]: OC\\Files\\ObjectStore\\ObjectStoreStorage->OC\\Files\\ObjectStore\\{closure}(*** sensitive parameters replaced ***)\n#23 \/var\/www\/html\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#24 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#25 \/var\/www\/html\/apps\/dav\/lib\/Connector\/Sabre\/File.php(162): fclose(Resource id #12)\n#26 \/var\/www\/html\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(151): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #8)\n#27 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1096): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('chandleroleary_...', Resource id #8)\n#28 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(525): Sabre\\DAV\\Server->createFile('files\/dnwk\/imag...', Resource id #8, NULL)\n#29 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#30 \/var\/www\/html\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#31 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#32 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#33 \/var\/www\/html\/apps\/dav\/lib\/Server.php(283): Sabre\\DAV\\Server->exec()\n#34 \/var\/www\/html\/apps\/dav\/appinfo\/v2\/remote.php(35): OCA\\DAV\\Server->exec()\n#35 \/var\/www\/html\/remote.php(164): require_once('\/var\/www\/html\/a...')\n#36 {main}","File":"\/var\/www\/html\/3rdparty\/aws\/aws-sdk-php\/src\/Multipart\/AbstractUploadManager.php","Line":136} 2018-02-09T15:10:35-0800
Error no app in context Aws\S3\Exception\S3MultipartUploadException: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx00000000000000005d8d8-005a7e2a6b-106ed5-nyc3a</RequestId><HostId>106ed5-nyc3a-nyc</HostId></Error> 2018-02-09T15:10:35-0800
Error no app in context Aws\S3\Exception\S3MultipartUploadException: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx00000000000000005d8d4-005a7e2a6b-106ed5-nyc3a</RequestId><HostId>106ed5-nyc3a-nyc</HostId></Error> 2018-02-09T15:10:35-0800
Error no app in context Aws\S3\Exception\S3MultipartUploadException: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx000000000000000053ee2-005a7e2a6b-fef35-nyc3a</RequestId><HostId>fef35-nyc3a-nyc</HostId></Error> 2018-02-09T15:10:35-0800
Error no app in context Aws\S3\Exception\S3MultipartUploadException: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx00000000000000005d8d3-005a7e2a6b-106ed5-nyc3a</RequestId><HostId>106ed5-nyc3a-nyc</HostId></Error> 2018-02-09T15:10:35-0800
Error no app in context Aws\S3\Exception\S3MultipartUploadException: An exception occurred while completing a multipart upload: Error executing "CompleteMultipartUpload" on "https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK"; AWS HTTP error: Client error response [url] https://nyc3.digitaloceanspaces.com/{reducted}/urn%3Aoid%3A36263?uploadId=2~ZooqKgEDLfLbvPQHNVYqo6ladIlk3oK [status code] 400 [reason phrase] Bad Request MalformedXML (client): - <?xml version="1.0" encoding="UTF-8"?><Error><Code>MalformedXML</Code><BucketName>{reducted}</BucketName><RequestId>tx000000000000000053edd-005a7e2a6b-fef35-nyc3a</RequestId><HostId>fef35-nyc3a-nyc</HostId></Error>
@dnwk refer to this issue it has some sort of a work around solution for this problem, although there has been saying from the NextCloud developers that this problem was solved in later releases but you can solve it manually from the link above
the releases that supposedly solved this issue is here, but to be honest, I didn't try them yet
@ibr123 thanks. that fixed my issue for now. I'll be waiting for 13.0.1
@dnwk glad to help
After I applied the modification of https://github.com/nextcloud/server/issues/7585#issuecomment-364111573, webdav becomes unreliable. At the first test, it seems like file uploading normally. But file was uploaded with 0 bytes. And worse, there is nothing showing up in my log.
@dnwk to understand you correctly, now you can create files inside the Synced folder without any exception, but this file which you already created is Zero size file? if yes, well, I think that's how it should be since you already created a file without any contents.
try to create a text file, after that write something inside that file, preferably a long text so the size is going to be noticeable, then save the file, after that the client (I assume you are using NextCloud desktop client) should sync the new modification.
now "log in" in the browser with the username which you have used to created the text file and search for the text file that you have created, then open that text file"in the browser" and see if the text you have added is correct.......if all worked fine I don't see any problem with that
@ibr123 no, my issue is when I use mountainduck to connect to nextcloud via WebDAV and I copy a file to the mounted drive. The file itself is not 0 bytes. But file itself did not actually get uploaded and show up as an empty file via Web.
@dnwk sorry I don't know mountainduck, I don't know how it works, It would be easier using NextCloud client since it gives you the status of syncing, your case is a bit weird but in my opinion (since I know already your primary storage is AWS S3 bucket) It might be a good idea to check the bucket using an app called "Cloudberry" also a very good idea most of the activities can be observed by the log at the path nextcloud/data/nextcloud.log all what you need to do, to enable an app, already exists in NextCloud apps, its called admin_audit then go to the nextcloud/config/config.php and add inside the $CONFIG = array ( the following:
'debug' => true, to set the server to debugging mode, and then add
'loglevel' => 0, level 0 will log all activities
I'll give it a try and see if I could find anything in the log. Mountainduck is a WebDav client. I have no problem uploading via browser. I think Nextcloud client doesn't use standard WebDav. As I don't usually have problems with it while I have trouble with WebDav. The advantage for WebDav is that I don't have to use my local storage space to duplicate what's in my cloud.
cc @icewind1991
Maybe retry with 12.0.4 because the AWS SDK was updated: #6737
For the problem of 0 bytes files with WebDav, I realized the problem is with my client (MountainDuck). They have a document on how to deal with it. the problem is with the client not with nextcloud.