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

Cannot delete/unshare shared file with me when remote server is down #14797

Closed
tobiasKaminsky opened this issue Mar 22, 2019 · 37 comments · Fixed by #25332
Closed

Cannot delete/unshare shared file with me when remote server is down #14797

tobiasKaminsky opened this issue Mar 22, 2019 · 37 comments · Fixed by #25332

Comments

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Mar 22, 2019

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Share & accept a file from server A to server B
  2. shut down server A
  3. see error in sync client, no delete/unshare possible in webUI

Expected behaviour

Unshare should work

Actual behaviour

Error message on top "error deleting file $file"

Server configuration

Nextcloud version: (see Nextcloud admin page) master

@tobiasKaminsky tobiasKaminsky added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 22, 2019
@MorrisJobke MorrisJobke added 1. to develop Accepted and waiting to be taken care of high feature: sharing and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 25, 2019
@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Mar 25, 2019
@MorrisJobke
Copy link
Member

cc @nextcloud/sharing

@kevinkk525
Copy link

Was about to post this issue again.
WOuld be nice if that got fixed anytime soon or at least provide a step-by-step workaround as even the client synchronization is completely broken by this.
I provided the nextcloud log error below.

Actual behaviour

  1. Error removing share
  2. Sync client crashes synchronization every time it comes across that file, making sync of that directory impossible.

Server configuration detail

Operating system: Linux 4.8.8-040808-generic #201611150231 SMP Tue Nov 15 07:33:21 UTC 2016 x86_64

Webserver: Apache (fpm-fcgi)

Database: mysql 5.7.27

PHP version:

7.2.21
Modules loaded: Core, date, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, Reflection, session, standard, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, mysqlnd, bcmath, curl, dba, dom, enchant, fileinfo, gd, imagick, imap, intl, json, ldap, exif, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, soap, sodium, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, xmlreader, xmlrpc, xmlwriter, xsl, zip, ionCube Loader, Zend OPcache

Nextcloud version: 16.0.4 - 16.0.4.1

Updated from an older Nextcloud/ownCloud or fresh install: owncloud 8?

Where did you install Nextcloud from: unknown

Signing status

Array
(
[files_rightclick] => Array
(
[EXTRA_FILE] => Array
(
[README.md] => Array
(
[expected] =>
[current] => cf73849388838de5037624e53303618579b164ec69fd55834ce4c5332ae33f778839e36298cbcc8ede90620927e076dbb8883479754e4c09b0491b15bf7653f3
)

            )

    )

[news] => Array
    (
        [EXTRA_FILE] => Array
            (
                [vendor/arthurhoaro/favicon/resources/cache/url7236a1e68f88c4feb47d240608d79789] => Array
                    (
                        [expected] => 
                        [current] => 25c15af1b2a3d7455a98616c2a1ecb9079f4a7ad23236a2c3dbd1e59aa8b42719b749d25b81c96a8f30f2e2e651cde23e141de61e5687b56e1f85bb2faae0694
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url85c38b15ae98edd5a0a2e37e372f0af6] => Array
                    (
                        [expected] => 
                        [current] => 2e2aeafc500a314bd7704efeaaf0f349865f9a73ccac47c50adc91d3f46d6c02bbd03f42ef03b17aad03fba3dd02b5fe5d10723b846fb469a15f55704610ef0d
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url62f3ff5e77de86cbd502d3c35d3321c3] => Array
                    (
                        [expected] => 
                        [current] => 88707a9b415d47801789a07bc1a1fed8d9aeb54f476ec2cb354b258a281ed2464d9afe0ce29d8714a8a4eb07c478cd2bc672bc9d3cfd1e1db7121f64c1c12f6d
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url61ca3172cb0f5d4a2a48399a4ed45929] => Array
                    (
                        [expected] => 
                        [current] => dfb18c96dc5c98dbe8930b2b33d442376ca722a56cc0cfbadde32177be8824d3403a262e69d8eb1434be93217036a354c520f6327519d6c0bb4b788f1e58f9eb
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url01073e8379431bdadf18bc3833eec3a7] => Array
                    (
                        [expected] => 
                        [current] => 88c4ef27116b578157ccaa64dd2ae0cd63c9b4cb2030b9ed293a6efb647ff85bff40c3dfb00d069dd74a10402bcfe4269e21b5ade8786eeb9765bbbe0d115e54
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url04526c77eefdb19db3f2f07f4c7d0647] => Array
                    (
                        [expected] => 
                        [current] => 4efb35b188a071f611b4af1fb10cb2217cd605fb9fe52b066bee13d0176ab9667029bd3131793ec86c4f10880b57b38ad8a9f0cc78764aca4e5589f40cd2d1fd
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url8603daba2d3b95c494fcd842964c2efc] => Array
                    (
                        [expected] => 
                        [current] => cbb4a87f141a930e0a24f723e9c026fda2a40cc0c719db29e23f046a80ac2aaefc568f8bbef1bcdd7d08cc1527f4e424f9e6a81ed43a7b807c4aba84ea2fcec1
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url28fe4f9e63c9ff672bb973101be761c4] => Array
                    (
                        [expected] => 
                        [current] => e45fcf3e25484e334f280928cf9495d6c211c21a3a0969355d1fa4e1f860f45ebe38ccf59118589923f8650419d903dbad38547106cdbbf064cdbd0a4416323e
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url54e93a40963a951e1d78f5598986ef29] => Array
                    (
                        [expected] => 
                        [current] => 504196d4cdd29d1036312d658465ca5ca935218c7a2a07d9ea23239781954311802c304e6a59a01673c4d2c604bd0cd6f155d60b646c59d14a750ec17b930ad9
                    )

                [vendor/arthurhoaro/favicon/resources/cache/url296199af2382f6a4d91c6082b1369cfa] => Array
                    (
                        [expected] => 
                        [current] => 3fa02bd8f2c07bb7781c3b036230821cff4772bf15c3562502190d2536341b3fad28338000e2a333fd4dfae9cabd43bebf465ec7e5471b0134b0bdde510b288b
                    )

            )

    )

)

List of activated apps
Enabled:
 - accessibility: 1.2.0
 - activity: 2.9.1
 - admin_audit: 1.6.0
 - announcementcenter: 3.5.1
 - apporder: 0.7.1
 - bookmarks: 2.0.3
 - bruteforcesettings: 1.4.0
 - calendar: 1.7.0
 - camerarawpreviews: 0.7.0
 - checksum: 0.4.3
 - circles: 0.17.7
 - cloud_federation_api: 0.2.0
 - comments: 1.6.0
 - contacts: 3.1.3
 - data_request: 1.3.0
 - dav: 1.9.2
 - deck: 0.6.6
 - drawio: 0.9.3
 - external: 3.3.0
 - federatedfilesharing: 1.6.0
 - federation: 1.6.0
 - files: 1.11.0
 - files_accesscontrol: 1.6.0
 - files_automatedtagging: 1.6.0
 - files_downloadactivity: 1.5.0
 - files_external: 1.7.0
 - files_frommail: 0.3.0
 - files_fulltextsearch: 1.3.6
 - files_markdown: 2.0.6
 - files_pdfviewer: 1.5.0
 - files_retention: 1.5.1
 - files_rightclick: 0.15.1
 - files_sharing: 1.8.0
 - files_texteditor: 2.8.0
 - files_trashbin: 1.6.0
 - files_versions: 1.9.0
 - files_videoplayer: 1.5.0
 - firstrunwizard: 2.5.0
 - forms: 1.0.3
 - fulltextsearch_elasticsearch: 1.3.6
 - gallery: 18.3.0
 - groupfolders: 4.1.0
 - impersonate: 1.3.0
 - issuetemplate: 0.5.0
 - logreader: 2.1.0
 - lookup_server_connector: 1.4.0
 - mail: 0.16.0
 - metadata: 0.9.0
 - news: 13.1.6
 - nextcloud_announcements: 1.5.0
 - notes: 3.0.2
 - notifications: 2.4.1
 - oauth2: 1.4.2
 - password_policy: 1.6.0
 - passwords: 2019.8.1
 - polls: 0.10.2
 - privacy: 1.0.0
 - provisioning_api: 1.6.0
 - quota_warning: 1.5.0
 - ransomware_detection: 0.5.2
 - ransomware_protection: 1.4.0
 - recommendations: 0.4.0
 - richdocuments: 3.3.15
 - serverinfo: 1.6.0
 - sharebymail: 1.6.0
 - spreed: 6.0.4
 - support: 1.0.0
 - survey_client: 1.4.0
 - systemtags: 1.6.0
 - tasks: 0.11.1
 - theming: 1.7.0
 - twofactor_admin: 0.4.1
 - twofactor_backupcodes: 1.5.0
 - twofactor_gateway: 0.14.1
 - twofactor_nextcloud_notification: 1.1.2
 - twofactor_totp: 3.0.1
 - updatenotification: 1.6.0
 - user_usage_report: 1.1.2
 - viewer: 1.1.0
 - workflow_script: 1.1.0
 - workflowengine: 1.6.0
Disabled:
 - encryption
 - end_to_end_encryption
 - fulltextsearch
 - mindmaps
 - terms_of_service
 - user_ldap
 - workflow_pdf_converter

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "files.freiebaptisten.de"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "https:\/\/files.freiebaptisten.de",
    "dbtype": "mysql",
    "version": "16.0.4.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "Europe\/Berlin",
    "installed": true,
    "filelocking.enabled": "true",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379,
        "timeout": 0
    },
    "appstore.experimental.enabled": true,
    "maintenance": false,
    "theme": "",
    "loglevel": 0,
    "log_rotation_size": 10485760,
    "ldapIgnoreNamingRules": false,
    "default_language": "de",
    "defaultapp": "files",
    "remember_login_cookie_lifetime": 1296000,
    "trashbin_retention_obligation": "auto",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpsecure": "tls",
    "mysql.utf8mb4": true
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Operating system:

Logs

Web server error log

Nextcloud log
[webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable:  at <<closure>>

0. /var/www/vhosts/example.com/example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
   OCA\DAV\Connector\Sabre\Directory->getChild("filename.ods")
1. /var/www/vhosts/example.com/example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 178
   Sabre\DAV\Tree->getNodeForPath("files/username ... s")
2. /var/www/vhosts/example.com/example.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 287
   Sabre\DAV\Tree->delete("files/username ... s")
3. <<closure>>
   Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
4. /var/www/vhosts/example.com/example.com/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
   undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpDelete"], [Sabre\HTTP\Requ ... }])
5. /var/www/vhosts/example.com/example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 479
   Sabre\Event\EventEmitter->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
6. /var/www/vhosts/example.com/example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 254
   Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
7. /var/www/vhosts/example.com/example.com/apps/dav/lib/Server.php line 316
   Sabre\DAV\Server->exec()
8. /var/www/vhosts/example.com/example.com/apps/dav/appinfo/v2/remote.php line 35
   OCA\DAV\Server->exec()
9. /var/www/vhosts/example.com/example.com/remote.php line 163
   undefinedundefinedrequire_once("/var/www/vhosts ... p")

DELETE /remote.php/dav/files/username/filename.ods
from <ip> by username at 2019-09-02T18:52:51+02:00
Browser log

@tobiasKaminsky
Copy link
Member Author

2. ync client crashes synchronization every time it comes across that file

For me it is not crashing, it just ignores it and shows a big error/warning in tray.

@kevinkk525
Copy link

I have one of those share in / and the client stops the synchronization every time it gets to that file so it never finishes syncing the rest of the files. Client version is 2.5.3 on windows 10

@kesselb
Copy link
Contributor

kesselb commented Sep 2, 2019

@kevinkk525

Index: apps/dav/lib/Connector/Sabre/Directory.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- apps/dav/lib/Connector/Sabre/Directory.php	(revision 62ded4ad5003e8e87f6fd89a6eac2e742cf1ad12)
+++ apps/dav/lib/Connector/Sabre/Directory.php	(date 1567447815056)
@@ -222,6 +222,7 @@
 				$this->fileView->verifyPath($this->path, $name);
 				$info = $this->fileView->getFileInfo($path);
 			} catch (\OCP\Files\StorageNotAvailableException $e) {
+				\OC::$server->getLogger()->logException($e, ['app' => 'storage_not_available']);
 				throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
 			} catch (InvalidPathException $ex) {
 				throw new InvalidPath($ex->getMessage());

Could you modify the code like above? I hope we gain more information from the stack trace. Check the logs for storage_not_available. Thanks 👍

@kevinkk525
Copy link

kevinkk525 commented Sep 2, 2019

[storage_not_available] Error: OCP\Files\StorageNotAvailableException:  at <<closure>>

 0. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Availability.php line 396
    OC\Files\Storage\Wrapper\Availability->checkAvailability()
 1. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Availability->hasUpdated("", 1507796164)
 2. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 3. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 4. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 5. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Cache/Watcher.php line 126
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 6. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1340
    OC\Files\Cache\Watcher->needsUpdate("", OC\Files\Cache\CacheEntry {})
 7. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1382
    OC\Files\View->getCacheEntry(OCA\RansomwarePr ... l}, "", "//filename.ods")
 8. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Connector/Sabre/Directory.php line 223
    OC\Files\View->getFileInfo("/Username ... s")
 9. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
    OCA\DAV\Connector\Sabre\Directory->getChild("filename.ods")
10. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 81
    Sabre\DAV\Tree->getNodeForPath("files/Username ... s")
11. <<closure>>
    Sabre\DAV\CorePlugin->httpGet(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
12. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpGet"], [Sabre\HTTP\Requ ... }])
13. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:GET", [Sabre\HTTP\Requ ... }])
14. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
15. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Server.php line 316
    Sabre\DAV\Server->exec()
16. /var/www/vhosts/example.com/files.example.com/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
17. /var/www/vhosts/example.com/files.example.com/remote.php line 163
    undefinedundefinedrequire_once("/var/www/vhosts ... p")

GET /remote.php/dav/files/Username/filename.ods
from <ip> by Username at 2019-09-02T21:14:35+02:00

@kesselb
Copy link
Contributor

kesselb commented Sep 2, 2019

  1. Is there another stack trace for delete? The one you posted is from a get request 🤔
  2. Are you able to delete the share if the ransomeware_protection app is disabled?

cc @nickvergessen

@kevinkk525
Copy link

[storage_not_available] Error: OCP\Files\StorageNotAvailableException:  at <<closure>>

 0. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Availability.php line 396
    OC\Files\Storage\Wrapper\Availability->checkAvailability()
 1. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Availability->hasUpdated("", 1507796164)
 2. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 3. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 4. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 5. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Cache/Watcher.php line 126
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 6. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1340
    OC\Files\Cache\Watcher->needsUpdate("", OC\Files\Cache\CacheEntry {})
 7. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1382
    OC\Files\View->getCacheEntry(OCA\RansomwarePr ... l}, "", "//filename.ods")
 8. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Connector/Sabre/Directory.php line 223
    OC\Files\View->getFileInfo("/Username ... s")
 9. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
    OCA\DAV\Connector\Sabre\Directory->getChild("filename.ods")
10. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 178
    Sabre\DAV\Tree->getNodeForPath("files/Username ... s")
11. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 287
    Sabre\DAV\Tree->delete("files/Username ... s")
12. <<closure>>
    Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
13. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpDelete"], [Sabre\HTTP\Requ ... }])
14. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
15. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
16. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Server.php line 316
    Sabre\DAV\Server->exec()
17. /var/www/vhosts/example.com/files.example.com/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
18. /var/www/vhosts/example.com/files.example.com/remote.php line 163
    undefinedundefinedrequire_once("/var/www/vhosts ... p")

DELETE /remote.php/dav/files/Username/filename.ods
from <ip> by Username at 2019-09-02T23:22:25+02:00

Disabling Ransomware_protection does not work either:

[storage_not_available] Error: OCP\Files\StorageNotAvailableException:  at <<closure>>

 0. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Availability.php line 396
    OC\Files\Storage\Wrapper\Availability->checkAvailability()
 1. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Availability->hasUpdated("", 1507796164)
 2. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Storage/Wrapper/Wrapper.php line 379
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 3. /var/www/vhosts/example.com/files.example.com/lib/private/Files/Cache/Watcher.php line 126
    OC\Files\Storage\Wrapper\Wrapper->hasUpdated("", 1507796164)
 4. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1340
    OC\Files\Cache\Watcher->needsUpdate("", OC\Files\Cache\CacheEntry {})
 5. /var/www/vhosts/example.com/files.example.com/lib/private/Files/View.php line 1382
    OC\Files\View->getCacheEntry(OCA\FilesAccessC ... l}, "", "//filename.ods")
 6. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Connector/Sabre/Directory.php line 223
    OC\Files\View->getFileInfo("/Username ... s")
 7. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
    OCA\DAV\Connector\Sabre\Directory->getChild("filename.ods")
 8. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Tree.php line 178
    Sabre\DAV\Tree->getNodeForPath("files/Username ... s")
 9. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 287
    Sabre\DAV\Tree->delete("files/Username ... s")
10. <<closure>>
    Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
11. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpDelete"], [Sabre\HTTP\Requ ... }])
12. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:DELETE", [Sabre\HTTP\Requ ... }])
13. /var/www/vhosts/example.com/files.example.com/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
14. /var/www/vhosts/example.com/files.example.com/apps/dav/lib/Server.php line 316
    Sabre\DAV\Server->exec()
15. /var/www/vhosts/example.com/files.example.com/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
16. /var/www/vhosts/example.com/files.example.com/remote.php line 163
    undefinedundefinedrequire_once("/var/www/vhosts ... p")

DELETE /remote.php/dav/files/Username/filename.ods
from <ip> by Username at 2019-09-02T23:26:01+02:00

@tobiasKaminsky
Copy link
Member Author

@kesselb for me it is a file I got shared via federated share, but now the remote server is offline.
Therefore the metadata is still there, but client cannot download/sync it.

image

I also cannot unshare it:

{"reqId":"Bulj018MplaxEahA7g3J","level":4,"time":"2019-09-03T06:29:04+00:00","remoteAddr":"95.222.214.34","user":"test","app":"webdav","method":"DELETE","url":"\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","message":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"","Code":0,"Trace":[{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php","line":76,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["2018-06-29-152024.png"]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php","line":178,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["files\/test\/2018-06-29-152024.png"]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":287,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->","args":["files\/test\/2018-06-29-152024.png"]},{"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpDelete"],[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:DELETE",[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/srv\/nextcloud\/apps\/dav\/lib\/Server.php","line":317,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/srv\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/srv\/nextcloud\/remote.php","line":163,"args":["\/srv\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/srv\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php","Line":225,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/76.0.3809.100 Safari\/537.36","version":"17.0.0.4"}

@kesselb
Copy link
Contributor

kesselb commented Sep 3, 2019

@tobiasKaminsky
Copy link
Member Author

@kesselb does this help:

{"reqId":"ZpBshWYkiGwQPOAHKv0W","level":3,"time":"2019-09-03T15:05:44+00:00","remoteAddr":"95.222.212.249","user":"test","app":"storage_not_available","method":"GET","url":"\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","message":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"","Code":1,"Trace":[{"file":"\/srv\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Availability.php","line":396,"function":"checkAvailability","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->","args":[]},{"file":"\/srv\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php","line":379,"function":"hasUpdated","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->","args":["",1530518486]},{"file":"\/srv\/nextcloud\/lib\/private\/Files\/Cache\/Watcher.php","line":126,"function":"hasUpdated","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["",1530518486]},{"file":"\/srv\/nextcloud\/lib\/private\/Files\/View.php","line":1340,"function":"needsUpdate","class":"OC\\Files\\Cache\\Watcher","type":"->","args":["",{"__class__":"OC\\Files\\Cache\\CacheEntry"}]},{"file":"\/srv\/nextcloud\/lib\/private\/Files\/View.php","line":1382,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->","args":[{"cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"","\/\/2018-06-29-152024.png"]},{"file":"\/srv\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php","line":223,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["\/test\/files\/2018-06-29-152024.png"]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php","line":76,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["2018-06-29-152024.png"]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":81,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["files\/test\/2018-06-29-152024.png"]},{"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpGet"],[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:GET",[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/srv\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https:\/\/nextcloud.kaminsky.me\/remote.php\/dav\/files\/test\/2018-06-29-152024.png","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/srv\/nextcloud\/apps\/dav\/lib\/Server.php","line":317,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/srv\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/srv\/nextcloud\/remote.php","line":163,"args":["\/srv\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/srv\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Availability.php","Line":79,"Hint":"Storage is temporarily not available","CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Linux) mirall\/2.5.3git (Nextcloud)","version":"17.0.0.5"}

@kesselb
Copy link
Contributor

kesselb commented Sep 3, 2019

@kesselb does this help:

I hope ;) It's not possible to delete the share because of the ServiceUnavailable exception. With the additional logging we know the reason for the ServiceUnavailable exception. Now someone with storage super powers can look into.

@tobiasKaminsky
Copy link
Member Author

So I do see two problems here:

  • file cannot be unshared due to ServiceUnavailable: @rullzer
  • files in this folder do not get synced properly: @misch7

@tobiasKaminsky
Copy link
Member Author

Any update here?
cc @nextcloud/sharing

@nickvergessen
Copy link
Member

#14797 (comment) also didn't do a thing for me.

The main issue is:

$info = $this->fileView->getFileInfo($path);

still returns false. So it throws in:

throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located');

therefor later on in:
https://github.com/nextcloud/3rdparty/blob/085494c2ad5c3757f9f1c11945f786d63fb2d40f/sabre/dav/lib/DAV/Tree.php#L178

we dont have an object which we could delete.

But I found another bug on the way, which would not allow to load any remote shares if one was offline.

@tinloaf
Copy link

tinloaf commented May 16, 2020

One more detail: I'm hit by the same bug, but for me, the Linux client does not have a problem with the "stale" share, it still syncs everything else normally.

However, the Android client completely breaks, and does not show any folders anymore. I see a request for /files/the-missing-share/Readme.md in the logs every time the Android client tries a sync, so I guess that's the problem?

@StCyr
Copy link
Contributor

StCyr commented Jul 14, 2020

I'm experiencing the same issue.

Note that I think it may also be the cause of my iOS nextcloud client not showing me any folders... See nextcloud/ios#1348

Eventualy, this solved my issues:

MariaDB [nextcloud]> select * from oc_share_external;
+----+--------+------------+---------------------------+-----------+-----------------+----------+-----------+-------+---------+------------+----------------------------------+----------+
| id | parent | share_type | remote                    | remote_id | share_token     | password | name      | owner | user    | mountpoint | mountpoint_hash                  | accepted |
+----+--------+------------+---------------------------+-----------+-----------------+----------+-----------+-------+---------+------------+----------------------------------+----------+
|  3 |     -1 |          0 | https://private.bollu.be/ |         3 | GL8M76GbVHk0nkv |          | /external | admin | cyrille | /external  | 48d7eb60b23e97e7d76b33e669c372da |        1 |
+----+--------+------------+---------------------------+-----------+-----------------+----------+-----------+-------+---------+------------+----------------------------------+----------+
1 row in set (0.000 sec)

MariaDB [nextcloud]> delete from oc_share_external where id=3;
Query OK, 1 row affected (0.019 sec)

@tobiasKaminsky tobiasKaminsky changed the title Cannot deleted shared file with me when remote server is down Cannot delete/unshare shared file with me when remote server is down Sep 1, 2020
@mhellmeier
Copy link

mhellmeier commented Jan 1, 2021

Same problem here with Nextcloud 20. Can't delete a shared folder from an old, currently not existing server. The fix from @AMDG2 works.

Hope to see a fix soon instead of the dirty manual database change.

@t-winter
Copy link

t-winter commented Mar 4, 2021

I had the same problem in Nextcloud 20.0.8 and tried to apply the fix from @AMDG2 detailed above but it seems the schema of the database changed since then.

Here's what worked for me:

  1. enable maintenance mode
  2. remove the entry for the problematic share from the share_external table
  3. disable maintenance mode
  4. run the php occ sharing:cleanup-remote-storages command (it would probably be better to run it with maintenance mode active but it wasn't available to me as long as my instance was in maintenance mode, also I'm not sure if this is even required)

One notable difference could be that the broken share in my case was a directory instead of a file.

@tobiasKaminsky
Copy link
Member Author

Discussed with @blizzz, our "new" idea is that server should

  • retry a given time (e.g. 3x)
  • if it still fails
    • move share to "deleted" shares
    • add an entry to activity.

@PVince81
Copy link
Member

seems the patch from @kesselb here #14797 (comment) cannot work, because once the exception is caught, $data is still null, so it goes into the block that returns false:

 			if (!$data instanceof ICacheEntry) {
 				return false;

the way I see it we should only do this if $internalPath is empty, which means we're trying to access the mount point itself / the root of the mount point.

and deleting the root of the mount point is the same as deleting the share

maybe for some file operations we should not throw StorageNotAvailableException when done on the root.

on the DAV layer I found this: https://github.com/nextcloud/server/blob/v21.0.5/apps/dav/lib/Connector/Sabre/ObjectTree.php#L158
in theory we could add a check if the internal path is empty there.

however, the challenge is that we already have a FailedStorage there, so we're still missing the mount point info.

need to find where the mount point itself is being adressed

@PVince81
Copy link
Member

to make it read from the cache and not attempt to read metadata from the storage, we'd need to make hasUpdated return false in case of "not available", this way https://github.com/nextcloud/server/blob/v21.0.5/lib/private/Files/View.php#L1352 will have needsUpdate return false and it won't bother trying to scan the remote

this should then make getFileInfo return the cached data

I'll test my theory on #25332 which has acceptance tests that can confirm if it works or not (given that it's tricky to reproduce the issue consistently across environments)

@PVince81
Copy link
Member

seems my last theory works, at least for the acceptance test.
it will need more extensive testing, also considering that it would affect all storages: #25332 (comment)

@Bubu
Copy link

Bubu commented Aug 3, 2022

As part of another problem I just went through the process in #14797 (comment) :-/

Seems this is not fully fixed/back in NC 24.0.3.

Sorry, I don't have any details here, I was actually trying to solve a different problem and didn't gather any logs. Maybe someone else ends up here again though, so I wanted to leave a note. 🤷

@mhellmeier
Copy link

Since this bug is still persistent but the issue is closed, I created a new one some time ago: #29515

Would be great to get some support there to further escalate the topic to a higher priority.

@mhellmeier
Copy link

Is someone currently unable to delete/unshare a file or folder in Nextcloud in the latest version? Since I used the manual workaround, I cannot test it with the latest Nextcloud version.

It would be great if someone could test the following to provide more info to the team:
#29515 (comment)

@Practicalbutterfly5
Copy link

Practicalbutterfly5 commented Mar 23, 2023

The same thing happens if you accept a share from a localhost url, that is not on same machine. Can this be looked into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.