NastuzziSamy / files_external_gdrive

[BETA - UNSTABLE] GDrive external storage for NextCloud
GNU Affero General Public License v3.0
78 stars 24 forks source link

crashes if google drive contains paths with slashes #49

Open violoncelloCH opened 5 years ago

violoncelloCH commented 5 years ago

hi Samy just had a use case for your cool gdrive app, but found an issue: if there is a path (folder) with a (forward) slash / inside of google drive files_external_gdrive crashes once you open the parent directory of the folder/file with the slash in it

log: (inside the external Folder GoogleDrive there is a folder Test which contains itself a folder test/Test)

[webdav] Fatal: League\Flysystem\FileNotFoundException: File not found at path: test/Test at <<closure>>

 0. /var/www/html/nextcloud/lib/private/Files/Storage/Flysystem.php line 81
    OCA\Files_external_gdrive\Storage\Flysystem->buildPath("test/Test/test")
 1. /var/www/html/nextcloud/lib/private/Files/Storage/Common.php line 133
    OC\Files\Storage\Flysystem->file_exists("test/Test/test")
 2. /var/www/html/nextcloud/lib/private/Files/Storage/Common.php line 167
    OC\Files\Storage\Common->isReadable("test/Test/test")
 3. /var/www/html/nextcloud/lib/private/Files/Storage/Common.php line 668
    OC\Files\Storage\Common->getPermissions("test/Test/test")
 4. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Common->getMetaData("test/Test/test")
 5. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php line 145
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("test/Test/test")
 6. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Wrapper\PermissionsMask->getMetaData("test/Test/test")
 7. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php line 463
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("test/Test/test")
 8. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Wrapper\Availability->getMetaData("test/Test/test")
 9. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("test/Test/test")
10. /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php line 112
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("test/Test/test")
11. /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php line 150
    OC\Files\Cache\Scanner->getData("test/Test/test")
12. /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php line 438
    OC\Files\Cache\Scanner->scanFile("test/Test/test", 3, "2326694", null, true)
13. /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php line 406
    OC\Files\Cache\Scanner->handleChildren("test", false, 3, "2326694", true, 0)
14. /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php line 338
    OC\Files\Cache\Scanner->scanChildren("test", false, 3, "2326694", true)
15. /var/www/html/nextcloud/lib/private/Files/View.php line 1332
    OC\Files\Cache\Scanner->scan("test", false)
16. /var/www/html/nextcloud/lib/private/Files/View.php line 1376
    OC\Files\View->getCacheEntry(OCA\RansomwarePr ... l}, "test", "/GoogleDrive/test")
17. /var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 223
    OC\Files\View->getFileInfo("/jonas/files/GoogleDrive/test")
18. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
    OCA\DAV\Connector\Sabre\Directory->getChild("test")
19. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 967
    Sabre\DAV\Tree->getNodeForPath("files/jonas/GoogleDrive/test")
20. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    Sabre\DAV\Server->getPropertiesIteratorForPath("files/jonas/GoogleDrive/test", ["{DAV:}getlastm ... "], 1)
21. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    Sabre\DAV\Server->generateMultiStatus(Generator {}, false)
22. <<closure>>
    Sabre\DAV\CorePlugin->httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
23. /var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
24. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
25. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
26. /var/www/html/nextcloud/apps/dav/lib/Server.php line 316
    Sabre\DAV\Server->exec()
27. /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
28. /var/www/html/nextcloud/remote.php line 163
    undefinedundefinedrequire_once("/var/www/html/n ... p")

PROPFIND /remote.php/dav/files/jonas/GoogleDrive/test
from 85.0.**.** by jonas at 2019-07-08T12:11:06+00:00

might there be an easy fix for this one? otherwise the workaround seems to be to just not use any slashes in google

fdobrovolny commented 4 years ago

Does the same for me:

[webdav] Fatal: League\Flysystem\FileNotFoundException: File not found at path: https:/astrotech.cz at <<closure>>

 0. /var/www/html/lib/private/Files/Storage/Flysystem.php line 81
    OCA\Files_external_gdrive\Storage\Flysystem->buildPath("https:/astrotec ... 0")
 1. /var/www/html/lib/private/Files/Storage/Common.php line 135
    OC\Files\Storage\Flysystem->file_exists("https:/astrotec ... 0")
 2. /var/www/html/lib/private/Files/Storage/Common.php line 169
    OC\Files\Storage\Common->isReadable("https:/astrotec ... 0")
 3. /var/www/html/lib/private/Files/Storage/Common.php line 696
    OC\Files\Storage\Common->getPermissions("https:/astrotec ... 0")
 4. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Common->getMetaData("https:/astrotec ... 0")
 5. /var/www/html/lib/private/Files/Storage/Wrapper/PermissionsMask.php line 145
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("https:/astrotec ... 0")
 6. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Wrapper\PermissionsMask->getMetaData("https:/astrotec ... 0")
 7. /var/www/html/lib/private/Files/Storage/Wrapper/Availability.php line 440
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("https:/astrotec ... 0")
 8. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 582
    OC\Files\Storage\Wrapper\Availability->getMetaData("https:/astrotec ... 0")
 9. /var/www/html/lib/private/Files/Cache/Scanner.php line 112
    OC\Files\Storage\Wrapper\Wrapper->getMetaData("https:/astrotec ... 0")
10. /var/www/html/lib/private/Files/Cache/Scanner.php line 150
    OC\Files\Cache\Scanner->getData("https:/astrotec ... 0")
11. /var/www/html/lib/private/Files/Cache/Scanner.php line 438
    OC\Files\Cache\Scanner->scanFile("https:/astrotec ... 0", 3, 251192, null, true)
12. /var/www/html/lib/private/Files/Cache/Scanner.php line 406
    OC\Files\Cache\Scanner->handleChildren("", false, 3, 251192, true, -1)
13. /var/www/html/lib/private/Files/Cache/Scanner.php line 338
    OC\Files\Cache\Scanner->scanChildren("", false, 3, 251192, true)
14. /var/www/html/lib/private/Files/View.php line 1338
    OC\Files\Cache\Scanner->scan("", false)
15. /var/www/html/lib/private/Files/View.php line 1382
    OC\Files\View->getCacheEntry(OCA\Files_Trashb ... l}, "", "//GoogleDrive")
16. /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php line 223
    OC\Files\View->getFileInfo("/filip/files/Go ... e")
17. /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php line 76
    OCA\DAV\Connector\Sabre\Directory->getChild("GoogleDrive")
18. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 967
    Sabre\DAV\Tree->getNodeForPath("files/filip/Goo ... m")
19. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    Sabre\DAV\Server->getPropertiesIteratorForPath("files/filip/Goo ... e", ["{DAV:}getlastm ... "], 1)
20. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    Sabre\DAV\Server->generateMultiStatus(Generator {}, false)
21. <<closure>>
    Sabre\DAV\CorePlugin->httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
22. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
23. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
24. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
25. /var/www/html/apps/dav/lib/Server.php line 317
    Sabre\DAV\Server->exec()
26. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
27. /var/www/html/remote.php line 163
    undefinedundefinedrequire_once("/var/www/html/a ... p")

PROPFIND /remote.php/dav/files/filip/GoogleDrive
from 172.*.*.* by filip at 2019-12-30T01:19:55+00:00