nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.46k stars 4.08k forks source link

WebDAV cannot write data from one NC instance to another one #21401

Closed christianlupus closed 3 years ago

christianlupus commented 4 years ago

How to use GitHub

Steps to reproduce

Expected behaviour

The file is created. On machine A you can see the newly created file in the share folder.

Actual behaviour

The file cannot be written, see logs below.

Server configuration detail backend (A)

Operating system: Linux 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.4.13

PHP version: 7.3.18

Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 18.0.4 - 18.0.4.2

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

Where did you install Nextcloud from: Docker official image

Signing status Array ( )
List of activated apps ``` Enabled: - accessibility: 1.4.0 - activity: 2.11.0 - cloud_federation_api: 1.1.0 - comments: 1.8.0 - dav: 1.14.0 - federatedfilesharing: 1.8.0 - federation: 1.8.0 - files: 1.13.1 - files_pdfviewer: 1.7.0 - files_rightclick: 0.15.2 - files_sharing: 1.10.1 - files_trashbin: 1.8.0 - files_versions: 1.11.0 - files_videoplayer: 1.7.0 - firstrunwizard: 2.7.0 - impersonate: 1.5.1 - issuetemplate: 0.6.0 - logreader: 2.3.0 - lookup_server_connector: 1.6.0 - nextcloud_announcements: 1.7.0 - notifications: 2.6.0 - oauth2: 1.6.0 - password_policy: 1.8.0 - photos: 1.0.0 - privacy: 1.2.0 - provisioning_api: 1.8.0 - recommendations: 0.6.0 - serverinfo: 1.8.0 - settings: 1.0.0 - sharebymail: 1.8.0 - support: 1.1.0 - survey_client: 1.6.0 - systemtags: 1.8.0 - text: 2.0.0 - theming: 1.9.0 - twofactor_backupcodes: 1.7.0 - updatenotification: 1.8.0 - viewer: 1.2.0 - workflowengine: 2.0.0 Disabled: - admin_audit - encryption - files_external - user_ldap ```
Configuration (config/config.php) ``` { "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 } ], "overwritehost": "slave.c.slt.wolf-stuttgart.net", "overwriteprotocol": "https", "overwritewebroot": "\/", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "18.0.4.2", "overwrite.cli.url": "https:\/\/localhost\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "sl_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***" } ```

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

Are you using encryption: no

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

Server configuration detail frontend (B)

Operating system: Linux 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.4.13

PHP version: 7.3.18

Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 18.0.4 - 18.0.4.2

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

Where did you install Nextcloud from: Official Docker image

Signing status Array ( )
List of activated apps ``` Enabled: - accessibility: 1.4.0 - activity: 2.11.0 - admin_audit: 1.8.0 - cloud_federation_api: 1.1.0 - comments: 1.8.0 - dav: 1.14.0 - encryption: 2.6.0 - federatedfilesharing: 1.8.0 - federation: 1.8.0 - files: 1.13.1 - files_external: 1.9.0 - files_pdfviewer: 1.7.0 - files_rightclick: 0.15.2 - files_sharing: 1.10.1 - files_trashbin: 1.8.0 - files_versions: 1.11.0 - files_videoplayer: 1.7.0 - firstrunwizard: 2.7.0 - issuetemplate: 0.6.0 - logreader: 2.3.0 - lookup_server_connector: 1.6.0 - nextcloud_announcements: 1.7.0 - notifications: 2.6.0 - oauth2: 1.6.0 - password_policy: 1.8.0 - photos: 1.0.0 - privacy: 1.2.0 - provisioning_api: 1.8.0 - recommendations: 0.6.0 - serverinfo: 1.8.0 - settings: 1.0.0 - sharebymail: 1.8.0 - support: 1.1.0 - survey_client: 1.6.0 - systemtags: 1.8.0 - text: 2.0.0 - theming: 1.9.0 - twofactor_backupcodes: 1.7.0 - updatenotification: 1.8.0 - viewer: 1.2.0 - workflowengine: 2.0.0 Disabled: - user_ldap ```
Configuration (config/config.php) ``` { "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 } ], "overwritehost": "master.c.slt.wolf-stuttgart.net", "overwriteprotocol": "https", "overwritewebroot": "\/", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "18.0.4.2", "overwrite.cli.url": "https:\/\/localhost\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "ma_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***" } ```

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

Are you using encryption: yes

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

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Operating system: Linux

Logs

Web server error log Nothing obvious was logged in the logs of the docker container.
Nextcloud log on backend A ``` [no app in context] Error: GuzzleHttp\Exception\ServerException: Server error: `GET https://slave.c.slt.wolf-stuttgart.net/remote.php/dav/files/storage/webdav/foo/tmp.md.ocTransferId2000822920.part` resulted in a `503 Service Unavailable` response at <> 0. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 66 GuzzleHttp\Exception\RequestException::create(GuzzleHttp\Psr7\Request {}, "*** sensitive parameter replaced ***") 1. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 203 GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***") 2. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 156 GuzzleHttp\Promise\Promise::callHandler(1, "*** sensitive parameter replaced ***", [GuzzleHttp\Prom ... l]) 3. /var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 47 GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***") 4. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 246 GuzzleHttp\Promise\TaskQueue->run(true) 5. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 223 GuzzleHttp\Promise\Promise->invokeWaitFn() 6. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 267 GuzzleHttp\Promise\Promise->waitIfPending() 7. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 225 GuzzleHttp\Promise\Promise->invokeWaitList() 8. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 62 GuzzleHttp\Promise\Promise->waitIfPending() 9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 131 GuzzleHttp\Promise\Promise->wait() 10. /var/www/html/lib/private/Http/Client/Client.php line 149 GuzzleHttp\Client->request("get", "https://slave.c ... t", {proxy: null,ver ... e}) 11. /var/www/html/lib/private/Files/Storage/DAV.php line 354 OC\Http\Client\Client->get("https://slave.c ... t", {auth: ["storage ... e}) 12. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 299 OC\Files\Storage\DAV->fopen("foo/tmp.md.ocTransferId2000822920.part", "r") 13. /var/www/html/lib/private/Files/Storage/Wrapper/PermissionsMask.php line 122 OC\Files\Storage\Wrapper\Wrapper->fopen("foo/tmp.md.ocTransferId2000822920.part", "r") 14. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 299 OC\Files\Storage\Wrapper\PermissionsMask->fopen("foo/tmp.md.ocTransferId2000822920.part", "r") 15. /var/www/html/lib/private/Files/Storage/Wrapper/Availability.php line 314 OC\Files\Storage\Wrapper\Wrapper->fopen("foo/tmp.md.ocTransferId2000822920.part", "r") 16. /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php line 860 OC\Files\Storage\Wrapper\Availability->fopen("foo/tmp.md.ocTransferId2000822920.part", "r") 17. /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php line 929 OC\Files\Storage\Wrapper\Encryption->readFirstBlock("foo/tmp.md.ocTransferId2000822920.part") 18. /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php line 382 OC\Files\Storage\Wrapper\Encryption->getHeader("foo/tmp.md.ocTransferId2000822920.part") 19. /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php line 1037 OC\Files\Storage\Wrapper\Encryption->fopen("foo/tmp.md.ocTransferId2000822920.part", "w") 20. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 630 OC\Files\Storage\Wrapper\Encryption->writeStream("foo/tmp.md.ocTransferId2000822920.part", null, null) 21. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 192 OC\Files\Storage\Wrapper\Wrapper->writeStream("foo/tmp.md.ocTransferId2000822920.part", null) 22. /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php line 156 OCA\DAV\Connector\Sabre\File->put(null) 23. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 1096 OCA\DAV\Connector\Sabre\Directory->createFile("tmp.md", null) 24. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525 Sabre\DAV\Server->createFile("files/admin/slave-WebDAV/foo/tmp.md", null, null) 25. <> Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {}) 26. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105 call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }]) 27. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 479 Sabre\Event\EventEmitter->emit("method:PUT", [Sabre\HTTP\Requ ... }]) 28. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 254 Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {}) 29. /var/www/html/apps/dav/lib/Server.php line 319 Sabre\DAV\Server->exec() 30. /var/www/html/apps/dav/appinfo/v2/remote.php line 35 OCA\DAV\Server->exec() 31. /var/www/html/remote.php line 165 require_once("/var/www/html/a ... p") PUT /remote.php/dav/files/admin/slave-WebDAV/foo/tmp.md from 172.29.0.1 by admin at 2020-06-12T05:55:45+00:00 ```
Nextcloud log on frontend B ``` [webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable: Could not open file at <> 0. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 85 OCA\DAV\Connector\Sabre\File->get() 1. <> Sabre\DAV\CorePlugin->httpGet(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {}) 2. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105 call_user_func_array([Sabre\DAV\CorePlugin {},"httpGet"], [Sabre\HTTP\Requ ... }]) 3. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 479 Sabre\Event\EventEmitter->emit("method:GET", [Sabre\HTTP\Requ ... }]) 4. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 254 Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {}) 5. /var/www/html/apps/dav/lib/Server.php line 319 Sabre\DAV\Server->exec() 6. /var/www/html/apps/dav/appinfo/v2/remote.php line 35 OCA\DAV\Server->exec() 7. /var/www/html/remote.php line 165 require_once("/var/www/html/a ... p") GET /remote.php/dav/files/storage/webdav/foo/tmp.md.ocTransferId2000822920.part from 172.29.0.1 by storage at 2020-06-12T05:55:46+00:00 [PHP] Error: fopen(/var/www/html/data/storage/files/webdav/foo/tmp.md.ocTransferId2000822920.part): failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#302 GET /remote.php/dav/files/storage/webdav/foo/tmp.md.ocTransferId2000822920.part from 172.29.0.1 by storage at 2020-06-12T05:55:46+00:00 [PHP] Error: filesize(): stat failed for /var/www/html/data/storage/files/webdav/foo/tmp.md.ocTransferId2000822920.part at /var/www/html/lib/private/Files/Storage/Local.php#170 GET /remote.php/dav/files/storage/webdav/foo/tmp.md.ocTransferId2000822920.part from 172.29.0.1 by storage at 2020-06-12T05:55:46+00:00 ```
Browser log No browser log was generated because the main issue is between the two instances.

Additional information

The issue happened on a public test instance. Thus, I can provide access for debugging purposes. Send me a PM and I will grant you access.

szaimen commented 3 years ago

Is this Issue still valid? If not, please close this issue. Thanks! :)

christianlupus commented 3 years ago

Honestly, I cannot tell you if the issue is still valid. I have dropped the machines and destroyed the containers. I would have to set up the complete setup from scratch. I solved the problem by other means.

So, if you want to clean the list of open issues, you might be able to close this issue. I do not guess, there is a lot of use to this special case (NC as a WebDAV storage as backend for another NC).

szaimen commented 3 years ago

Thanks for the answer! :) Based on the feedback I am closing this.