server icon indicating copy to clipboard operation
server copied to clipboard

Upload to ObjectStorage (S3) fails on 15.0.2

Open weirdion opened this issue 7 years ago • 3 comments

Steps to reproduce

  1. Upload a video file of greater than 20 MB

Expected behaviour

The video should get uploaded

Actual behaviour

Upload fails with two exceptions

Server configuration

Operating system: Ubuntu 18.04.2

Web server: Apache

Database: MYSQL 5.7.22

PHP version: 7.2.14

Nextcloud version: (see Nextcloud admin page)

Updated from an older Nextcloud/ownCloud or fresh install: 14.06

Where did you install Nextcloud from: SNAP

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

`No errors have been found.`

List of activated apps:

App list ``` - accessibility: 1.1.0 - activity: 2.8.2 - admin_audit: 1.5.0 - announcementcenter: 3.4.1 - bruteforcesettings: 1.3.0 - calendar: 1.6.4 - cloud_federation_api: 0.1.0 - comments: 1.5.0 - contacts: 3.0.3 - dav: 1.8.1 - deck: 0.5.2 - federatedfilesharing: 1.5.0 - files: 1.10.0 - files_markdown: 2.0.5 - files_pdfviewer: 1.4.0 - files_sharing: 1.7.0 - files_texteditor: 2.7.0 - files_trashbin: 1.5.0 - files_versions: 1.8.0 - files_videoplayer: 1.4.0 - firstrunwizard: 2.4.0 - gallery: 18.2.0 - groupfolders: 2.0.2 - logreader: 2.0.0 - lookup_server_connector: 1.3.0 - metadata: 0.9.0 - nextcloud_announcements: 1.4.0 - notifications: 2.3.0 - oauth2: 1.3.0 - onlyoffice: 2.1.2 - password_policy: 1.5.0 - provisioning_api: 1.5.0 - serverinfo: 1.5.0 - sharebymail: 1.5.0 - spreed: 5.0.2 - survey_client: 1.3.0 - systemtags: 1.5.0 - theming: 1.6.0 - twofactor_backupcodes: 1.4.1 - twofactor_totp: 2.1.1 - workflowengine: 1.5.0 Disabled: - checksum - drawio - encryption - external - federation - files_accesscontrol - files_automatedtagging - files_external - files_retention - mail - polls - support - tasks - user_ldap - user_saml ``` ``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your Nextcloud installation folder ```

Nextcloud configuration:

Config report
$ sudo nextcloud.occ config:list system
{
    "system": {
        "apps_paths": [
            {
                "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "supportedDatabases": [
            "mysql"
        ],
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "objectstore": {
            "class": "OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "XXXXXX",
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "hostname": "s3-us-west-2.amazonaws.com",
                "use_ssl": true,
                "region": "us-west-2"
            }
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "15.0.2.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "logtimezone": "America\/Indianapolis",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "token_auth_enforced": true,
        "skeletondirectory": "",
        "maintenance": false,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2
    }
}

Are you using external storage, if yes which one: ObjectStorage

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Firefox 65, Chrome 72

Operating system: Linux (Ubuntu/Fedora), Windows 10

Logs

[objectstore] Error: Aws\Exception\CouldNotCreateChecksumException: A sha256 checksum could not be calculated for the provided upload body, because it was not seekable. To prevent this error you can either 1) include the ContentMD5 or ContentSHA256 parameters with your request, 2) use a seekable stream for the body, or 3) wrap the non-seekable stream in a GuzzleHttp\Psr7\CachingStream object. You should be careful though and remember that the CachingStream utilizes PHP temp streams. This means that the stream will be temporarily stored on the local disk. at <<closure>>

 0. /snap/nextcloud/11336/htdocs/3rdparty/aws/aws-sdk-php/src/Signature/S3SignatureV4.php line 22
    getPayload(GuzzleHttp\Psr7\Request {})
 1. /snap/nextcloud/11336/htdocs/3rdparty/aws/aws-sdk-php/src/Middleware.php line 126
    signRequest(GuzzleHttp\Psr7\Request {}, "*** sensitive parameter replaced ***")
 2. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php line 39
    Aws\{closure}("*** sensitive parameters replaced ***")
 3. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 47
    GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
 4. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 246
    run(true)
 5. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 223
    invokeWaitFn()
 6. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 267
    waitIfPending()
 7. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 225
    invokeWaitList()
 8. /snap/nextcloud/11336/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    waitIfPending()
 9. /snap/nextcloud/11336/htdocs/3rdparty/aws/aws-sdk-php/src/S3/S3ClientTrait.php line 33
    wait()
10. /snap/nextcloud/11336/htdocs/lib/private/Files/ObjectStore/S3ObjectTrait.php line 77
    upload("peakey-cloud", "urn:oid:33312", null, "private", {mup_threshold:  ... 0})
11. /snap/nextcloud/11336/htdocs/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 449
    writeObject("urn:oid:33312", null)
12. /snap/nextcloud/11336/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php line 630
    writeStream("/files/temp/ankit/ANR_close.MOV", null, null)
13. /snap/nextcloud/11336/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php line 630
    writeStream("/files/temp/ankit/ANR_close.MOV", null, null)
14. /snap/nextcloud/11336/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php line 630
    writeStream("/files/temp/ankit/ANR_close.MOV", null, null)
15. /snap/nextcloud/11336/htdocs/lib/private/Files/Storage/Wrapper/Jail.php line 524
    writeStream("/files/temp/ankit/ANR_close.MOV", null, null)
16. /snap/nextcloud/11336/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php line 630
    writeStream("ankit/ANR_close.MOV", null, null)
17. /snap/nextcloud/11336/htdocs/apps/dav/lib/Connector/Sabre/File.php line 169
    writeStream("ankit/ANR_close.MOV", null)
18. /snap/nextcloud/11336/htdocs/apps/dav/lib/Connector/Sabre/Directory.php line 156
    put(null)
19. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 316
    createFile("ANR_close.MOV", null)
20. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 130
    copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Connector\Sabre\Directory {}, "ANR_close.MOV")
21. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 161
    copy("uploads/asadana ... e", "files/asadana@p ... V")
22. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 642
    move("uploads/asadana ... e", "files/asadana@p ... V")
23. <<closure>>
    httpMove(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
24. /snap/nextcloud/11336/htdocs/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpMove"], [Sabre\HTTP\Requ ... }])
25. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:MOVE", [Sabre\HTTP\Requ ... }])
26. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
27. /snap/nextcloud/11336/htdocs/apps/dav/lib/Server.php line 301
    exec()
28. /snap/nextcloud/11336/htdocs/apps/dav/appinfo/v2/remote.php line 35
    exec()
29. /snap/nextcloud/11336/htdocs/remote.php line 163
    require_once("/snap/nextcloud ... p")

MOVE /remote.php/dav/uploads/asadana%40peakey.com/web-file-upload-81a362ce5d256969a4ff952e1941634e-1550504033855/.file
from 208.38.253.218 by [email protected] at 2019-02-18T10:34:04-05:00
[webdav] Fatal: Sabre\DAV\Exception: A sha256 checksum could not be calculated for the provided upload body, because it was not seekable. To prevent this error you can either 1) include the ContentMD5 or ContentSHA256 parameters with your request, 2) use a seekable stream for the body, or 3) wrap the non-seekable stream in a GuzzleHttp\Psr7\CachingStream object. You should be careful though and remember that the CachingStream utilizes PHP temp streams. This means that the stream will be temporarily stored on the local disk. at <<closure>>

 0. /snap/nextcloud/11336/htdocs/apps/dav/lib/Connector/Sabre/File.php line 209
    convertToSabreException(Aws\Exception\Co ... {})
 1. /snap/nextcloud/11336/htdocs/apps/dav/lib/Connector/Sabre/Directory.php line 156
    put(null)
 2. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 316
    createFile("Pivot recording Least Squares algo.mp4", null)
 3. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 130
    copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Connector\Sabre\Directory {}, "Pivot recording Least Squares algo.mp4")
 4. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Tree.php line 161
    copy("uploads/asadana ... e", "files/asadana@p ... 4")
 5. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 642
    move("uploads/asadana ... e", "files/asadana@p ... 4")
 6. <<closure>>
    httpMove(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 7. /snap/nextcloud/11336/htdocs/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpMove"], [Sabre\HTTP\Requ ... }])
 8. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:MOVE", [Sabre\HTTP\Requ ... }])
 9. /snap/nextcloud/11336/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
10. /snap/nextcloud/11336/htdocs/apps/dav/lib/Server.php line 301
    exec()
11. /snap/nextcloud/11336/htdocs/apps/dav/appinfo/v2/remote.php line 35
    exec()
12. /snap/nextcloud/11336/htdocs/remote.php line 163
    require_once("/snap/nextcloud ... p")

MOVE /remote.php/dav/uploads/asadana%40peakey.com/web-file-upload-c8c08c7e13df322dfe2ebbb18969ccb1-1550504443182/.file
from 208.38.253.218 by [email protected] at 2019-02-18T10:40:57-05:00

weirdion avatar Feb 18 '19 17:02 weirdion

Thank you for reporting this issue :+1:

Duplicate of https://github.com/nextcloud/server/issues/13062 (update to 15.0.4 should fix the issue for you)

kesselb avatar Feb 18 '19 17:02 kesselb

I didn't see #13062. Thanks for the quick feedback, glad to see it's already fixed

weirdion avatar Feb 18 '19 18:02 weirdion

Tested 15.0.4 snap this morning. I can confirm this issue is resolved.

weirdion avatar Feb 21 '19 12:02 weirdion