Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to external swift storage fails #13448

Closed
jfeldmaier opened this issue Dec 28, 2018 · 10 comments
Closed

Upload to external swift storage fails #13448

jfeldmaier opened this issue Dec 28, 2018 · 10 comments

Comments

@jfeldmaier
Copy link

Hi,

Actual behaviour
Uploading a file using the desktop client for Mac OSX (Version 2.5.1final (build 20181204)) fails with the following message:
The key provided "" has the wrong value type. You provided 1543265922 (integer) but was expecting string

After a while, the client retries the upload and succeeds. The file is then also visible at the Nextcloud web Application.

A similar behaviour occurs while uploading a file with the Android App (Version 3.4.1). The upload fails with the message Server not found. But looking at the web application shows the file correctly uploaded to the external swift storage.

Uploading to the main (internal) storage, which is just a folder in the webserver does work in both cases without any errors.

Android version: 8.0

Device model: Galaxy S7

Stock or customized system: Stock

Nextcloud app version: 3.4.1

Nextcloud server version: 15.0.0

Php version: 7.0.30-0+deb9u1

External Storage: OpenStack Swift hosted at OVH.net

Logs
[webdav] Fatal: Exception: The key provided "" has the wrong value type. You provided 1543265922 (integer) but was expecting string at <>

  1. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php line 196
    validateType(1543265922)
  2. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php line 242
    validate(1543265922)
  3. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php line 201
    validateObject({timestamp: 1543265922})
  4. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/Operation.php line 127
    validate({timestamp: 1543265922})
  5. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php line 112
    validate({containerName: ... }})
  6. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php line 126
    sendRequest(OpenStack\Common\Api\Operation {}, {containerName: ... }})
  7. /var/www/html/cloud/3rdparty/php-opencloud/openstack/src/ObjectStore/v1/Models/StorageObject.php line 186
    execute({method: "POST", ... }}, {containerName: ... }})
  8. /var/www/html/cloud/apps/files_external/lib/Lib/Storage/Swift.php line 461
    mergeMetadata({timestamp: 1543265922})
  9. /var/www/html/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 354
    touch("Upload/pdf.pdf", 1543265922)
  10. /var/www/html/cloud/lib/private/Files/Storage/Wrapper/Availability.php line 376
    touch("Upload/pdf.pdf", 1543265922)
  11. /var/www/html/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 354
    touch("Upload/pdf.pdf", 1543265922)
  12. /var/www/html/cloud/lib/private/Files/View.php line 1144
    touch("Upload/pdf.pdf", 1543265922)
  13. /var/www/html/cloud/lib/private/Files/View.php line 567
    basicOperation("touch", "/cloud_storage/Upload/pdf.pdf", ["touch"], 1543265922)
  14. /var/www/html/cloud/apps/dav/lib/Connector/Sabre/File.php line 255
    touch("/cloud_storage/Upload/pdf.pdf", 1543265922)
  15. /var/www/html/cloud/apps/dav/lib/Connector/Sabre/Directory.php line 156
    put(null)
  16. /var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
    createFile("pdf.pdf", null)
  17. /var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
    createFile("files/jos/cloud_storage/Upload/pdf.pdf", null, null)
  18. <>
    httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  19. /var/www/html/cloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
  20. /var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PUT", [Sabre\HTTP\Requ ... }])
  21. /var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  22. /var/www/html/cloud/apps/dav/lib/Server.php line 298
    exec()
  23. /var/www/html/cloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
  24. /var/www/html/cloud/remote.php line 163
    require_once("/var/www/html/c ... p")

PUT /remote.php/dav/files/x/cloud_storage/Upload/pdf.pdf
from x.x.x.x by x at 2018-12-28T21:42:57+00:00

@nextcloud-android-bot
Copy link

GitMate.io thinks possibly related issues are nextcloud/android#2199 (Visualise external storages), nextcloud/android#537 (Cannot change storage path from default to external.), nextcloud/android#2198 (Duplicated images on external storage), nextcloud/android#2232 (External Storage Folder not Visible), and nextcloud/android#2840 (Upload fails with SSL error).

@jfeldmaier
Copy link
Author

On the android app, the error is reported as "Ordnerfehler". Nevertheless, the uploaded file is stored on the server and accessible after a page refresh.

screenshot_20190109-102013_nextcloud

@tobiasKaminsky
Copy link
Member

@nextcloud/server-triage is this something for the server repo?

@MorrisJobke MorrisJobke transferred this issue from nextcloud/android Jan 9, 2019
@MorrisJobke MorrisJobke added feature: external storage bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 9, 2019
@MorrisJobke
Copy link
Member

cc @icewind1991

@MorrisJobke
Copy link
Member

cc @rullzer

@jfeldmaier
Copy link
Author

Thank you for transferring the topic to the right place. If you need any additional information or log data - just let me know!

Thank you!

@KrzysztofHajdamowicz
Copy link

Hello,
I'm also affected by this bug. I'm using OpenStack Swift hosted by OVH. Looks like reuploading by Linux client allows to upload a file.
I'm using Nextcloud 14.0.6 on Ubuntu 16.04 + nginx + php7.2-fpm

My logs are:

Exception: The key provided "" has the wrong value type. You provided 1538553398 (integer) but was expecting string
/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php - line 196:

OpenStack\Common\Api\Parameter->validateType(1538553398)

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php - line 242:

OpenStack\Common\Api\Parameter->validate(1538553398)

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/Parameter.php - line 201:

OpenStack\Common\Api\Parameter->validateObject({ timestamp: 1538553398})

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/Operation.php - line 127:

OpenStack\Common\Api\Parameter->validate({ timestamp: 1538553398})

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php - line 112:

OpenStack\Common\Api\Operation->validate({ containerN ... }})

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php - line 126:

OpenStack\Common\Resource\OperatorResource->sendRequest(OpenStack\Co ... {}, { containerN ... }})

/var/www/nextcloud/3rdparty/php-opencloud/openstack/src/ObjectStore/v1/Models/StorageObject.php - line 186:

OpenStack\Common\Resource\OperatorResource->execute({ method: "P ... }}, { containerN ... }})

/var/www/nextcloud/apps/files_external/lib/Lib/Storage/Swift.php - line 461:

OpenStack\ObjectStore\v1\Models\StorageObject->mergeMetadata({ timestamp: 1538553398})

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 353:

OCA\Files_External\Lib\Storage\Swift->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php - line 100:

OC\Files\Storage\Wrapper\Wrapper->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 353:

OC\Files\Storage\Wrapper\PermissionsMask->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 376:

OC\Files\Storage\Wrapper\Wrapper->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 353:

OC\Files\Storage\Wrapper\Availability->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/View.php - line 1144:

OC\Files\Storage\Wrapper\Wrapper->touch("Pierdy/Audi ... r", 1538553398)

/var/www/nextcloud/lib/private/Files/View.php - line 567:

OC\Files\View->basicOperation("touch", "/OVH2/Pierd ... r", [ "touch"], 1538553398)

/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 246:

OC\Files\View->touch("/OVH2/Pierd ... r", 1538553398)

/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:

OCA\DAV\Connector\Sabre\File->put(null)

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:

OCA\DAV\Connector\Sabre\Directory->createFile("_a4_install_v3_2.rar", null)

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 529:

Sabre\DAV\Server->createFile("files/uosiu ... r", null, null)


Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/nextcloud/apps/dav/lib/Server.php - line 293:

Sabre\DAV\Server->exec()

/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/nextcloud/remote.php - line 163:

require_once("/var/www/ne ... p")

I can provide more data, simply let me know! :)

@jfeldmaier
Copy link
Author

Hi, are there any news concerning this topic? The problem still exists and the external storage is not useable.

@mzamot
Copy link
Contributor

mzamot commented Feb 28, 2019

I notice this same issue using 15.0.4, using Swift as external volume.

"The key provided "" has the wrong value type. You provided 1550707987 (integer) but was expecting string"

This doesn't happen when using Swift as principal storage. When using principal storage another issue happens, but it is fixed by #14424 .

This issue and #14424 seems to be related though, as the issue mentioned here only happens with files bigger than 10MB. Bigger files are uploaded but not completely, it corrupts the file.

@mzamot
Copy link
Contributor

mzamot commented Feb 28, 2019

I was able to fix this issue modifying the file: /var/www/apps/files_external/lib/Lib/Storage/Swift.php line 454

$metadata = ['timestamp' => $mtime];

To

$metadata = ['timestamp' => strval($mtime)];

@ChristophWurst ChristophWurst added 3. to review Waiting for reviews and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 1, 2019
@ChristophWurst ChristophWurst added this to the Nextcloud 16 milestone Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants