Open vincib opened 1 year ago
More informations :
~/cloud/pub$ php8.0 occ info:file benjamin/files/
files
fileid: 569282
mimetype: httpd/unix-directory
modified: 7 septembre 2023 07:27:12 UTC+0
not encrypted
size: 64.7 MB
etag: e8643acaed0fac81fe855364b935cfc5
children: 4 (use --children option to list)
mounted at: /benjamin/files/
The following users have access to the file
jean-pierre:
/jean-pierre/files/Videos: full permissions
home storage
benjamin:
/benjamin/files: full permissions
shared by jean-pierre owned by jean-pierre
~/cloud/pub$ php8.0 occ info:file astrid/files/
files
fileid: 300513
mimetype: httpd/unix-directory
modified: 17 juin 2023 14:16:33 UTC+0
not encrypted
size: 18.7 GB
etag: 648dc0413940c
children: 6 (use --children option to list)
mounted at: /astrid/files/
The following users have access to the file
benjamin:
/benjamin/files/partage/Astrid: full permissions
home storage
astrid:
/astrid/files: full permissions
shared by benjamin owned by benjamin
Follow-up of my research on this bug:
I traced a simple call to "php8.0 occ info:file /benjamin/files/" (on the original NC27 + file_sharing 1.19.0) and it does the following SQL queries:
691511 Query START TRANSACTION
691511 Query INSERT INTO `oc_mounts` (`storage_id`,`root_id`,`user_id`,`mount_point`,`mount_id`,`mount_provider_class`) SELECT '1','1','benjamin','/benjamin/',NULL,'OC\\Files\\Mount\\LocalHome
MountProvider' FROM `oc_mounts` WHERE `root_id` = '1' AND `user_id` = 'benjamin' AND `mount_point` = '/benjamin/' HAVING COUNT(*) = 0
691511 Query INSERT INTO `oc_mounts` (`storage_id`,`root_id`,`user_id`,`mount_point`,`mount_id`,`mount_provider_class`) SELECT '23','569282','benjamin','/benjamin/files/',NULL,'OCA\\Files_Shar
ing\\MountProvider' FROM `oc_mounts` WHERE `root_id` = '569282' AND `user_id` = 'benjamin' AND `mount_point` = '/benjamin/files/' HAVING COUNT(*) = 0
691511 Query DELETE FROM `oc_mounts` WHERE (`user_id` = 'benjamin') AND (`root_id` = 540095) AND (`mount_point` = '/benjamin/files/Geoffrey/')
691511 Query DELETE FROM `oc_mounts` WHERE (`user_id` = 'benjamin') AND (`root_id` = 569282) AND (`mount_point` = '/benjamin/files/Videos/')
691511 Query DELETE FROM `oc_mounts` WHERE (`user_id` = 'benjamin') AND (`root_id` = 659747) AND (`mount_point` = '/benjamin/files/numerisations/')
691511 Query COMMIT
okay, following up :)
MariaDB [ben_oc]> select * from oc_share where uid_owner = 'jean-pierre';
| id | share_type | share_with | uid_owner | parent | item_type | item_source | item_target | file_source | file_target | permissions | stime | accepted | expiration | token | mail_send | uid_initiator | share_name | password | password_by_talk | note | hide_download | label | attributes | password_expiration_time |
| 57 | 0 | anne-marie | jean-pierre | NULL | folder | 187882 | NULL | 187882 | /Photos | 31 | 1551000308 | 1 | NULL | NULL | 0 | jean-pierre | NULL | NULL | 0 | NULL | 0 | NULL | NULL | NULL |
| 214 | 0 | benjamin | jean-pierre | NULL | folder | 569282 | NULL | 569282 | /Videos | 31 | 1674381341 | 1 | NULL | NULL | 0 | jean-pierre | NULL | NULL | 0 | NULL | 0 | NULL | NULL | NULL |
Same symptoms here with a 25.0.10 install happening without major updates. User reports missing "all files" except his shares in "shareoverview" and deleted files in "trashbin" over night. Disabling File Sharing app brings back all files in root. With File Sharing app enabled and trying to list all files in root or via browser refresh of the page there is the following log entry - hope that helps debugging:
[no app in context] Error: OCP\Files\StorageNotAvailableException: File by id 8570 not found at <<closure>>
0. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Jail.php line 234
OC\Files\Storage\FailedStorage->file_exists()
1. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
OC\Files\Storage\Wrapper\Jail->file_exists()
2. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
OC\Files\Storage\Wrapper\Wrapper->file_exists()
3. /var/www/nextcloud/lib/private/Files/View.php line 1350
OC\Files\Storage\Wrapper\Wrapper->file_exists()
4. /var/www/nextcloud/lib/private/Files/View.php line 1394
OC\Files\View->getCacheEntry()
5. /var/www/nextcloud/lib/private/Files/Node/Root.php line 202
OC\Files\View->getFileInfo()
6. <<closure>>
OC\Files\Node\Root->get()
7. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 73
call_user_func_array()
8. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 150
OC\Files\Node\LazyFolder->__call()
9. /var/www/nextcloud/apps/files_accesscontrol/lib/Operation.php line 290
OC\Files\Node\LazyFolder->get()
10. /var/www/nextcloud/apps/files_accesscontrol/lib/Operation.php line 87
OCA\FilesAccessControl\Operation->getNode()
11. /var/www/nextcloud/apps/files_accesscontrol/lib/CacheWrapper.php line 60
OCA\FilesAccessControl\Operation->checkFileAccess()
12. /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php line 87
OCA\FilesAccessControl\CacheWrapper->formatCacheEntry()
13. /var/www/nextcloud/lib/private/Files/Node/Root.php line 464
OC\Files\Cache\Wrapper\CacheWrapper->get()
14. <<closure>>
OC\Files\Node\Root->OC\Files\Node\{closure}("*** sensitive parameters replaced ***")
15. /var/www/nextcloud/lib/private/Files/Node/Root.php line 462
array_map()
16. /var/www/nextcloud/lib/private/Files/Node/LazyUserFolder.php line 67
OC\Files\Node\Root->getByIdInPath()
17. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 209
OC\Files\Node\LazyUserFolder->getById()
18. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 873
OCA\Files_Sharing\Controller\ShareAPIController->formatShare()
19. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 1020
OCA\Files_Sharing\Controller\ShareAPIController->getSharedWithMe()
20. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 992
OCA\Files_Sharing\Controller\ShareAPIController->getFormattedShares()
21. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
OCA\Files_Sharing\Controller\ShareAPIController->getShares()
22. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
OC\AppFramework\Http\Dispatcher->executeController()
23. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
OC\AppFramework\Http\Dispatcher->dispatch()
24. /var/www/nextcloud/lib/private/Route/Router.php line 315
OC\AppFramework\App::main()
25. /var/www/nextcloud/ocs/v1.php line 64
OC\Route\Router->match()
Caused by:
OCP\Files\NotFoundException: File by id 8570 not found at <<closure>>
0. /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php line 532
OCA\Files_Sharing\SharedStorage->init()
1. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Jail.php line 234
OCA\Files_Sharing\SharedStorage->getWrapperStorage()
2. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
OC\Files\Storage\Wrapper\Jail->file_exists()
3. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 224
OC\Files\Storage\Wrapper\Wrapper->file_exists()
4. /var/www/nextcloud/lib/private/Files/View.php line 1350
OC\Files\Storage\Wrapper\Wrapper->file_exists()
5. /var/www/nextcloud/lib/private/Files/View.php line 1394
OC\Files\View->getCacheEntry()
6. /var/www/nextcloud/lib/private/Files/Node/Root.php line 202
OC\Files\View->getFileInfo()
7. <<closure>>
OC\Files\Node\Root->get()
8. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 73
call_user_func_array()
9. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 150
OC\Files\Node\LazyFolder->__call()
10. /var/www/nextcloud/apps/files_accesscontrol/lib/Operation.php line 290
OC\Files\Node\LazyFolder->get()
11. /var/www/nextcloud/apps/files_accesscontrol/lib/Operation.php line 87
OCA\FilesAccessControl\Operation->getNode()
12. /var/www/nextcloud/apps/files_accesscontrol/lib/CacheWrapper.php line 60
OCA\FilesAccessControl\Operation->checkFileAccess()
13. /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php line 87
OCA\FilesAccessControl\CacheWrapper->formatCacheEntry()
14. /var/www/nextcloud/lib/private/Files/Node/Root.php line 464
OC\Files\Cache\Wrapper\CacheWrapper->get()
15. <<closure>>
OC\Files\Node\Root->OC\Files\Node\{closure}("*** sensitive parameters replaced ***")
16. /var/www/nextcloud/lib/private/Files/Node/Root.php line 462
array_map()
17. /var/www/nextcloud/lib/private/Files/Node/LazyUserFolder.php line 67
OC\Files\Node\Root->getByIdInPath()
18. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 209
OC\Files\Node\LazyUserFolder->getById()
19. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 873
OCA\Files_Sharing\Controller\ShareAPIController->formatShare()
20. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 1020
OCA\Files_Sharing\Controller\ShareAPIController->getSharedWithMe()
21. /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php line 992
OCA\Files_Sharing\Controller\ShareAPIController->getFormattedShares()
22. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
OCA\Files_Sharing\Controller\ShareAPIController->getShares()
23. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
OC\AppFramework\Http\Dispatcher->executeController()
24. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
OC\AppFramework\Http\Dispatcher->dispatch()
25. /var/www/nextcloud/lib/private/Route/Router.php line 315
OC\AppFramework\App::main()
26. /var/www/nextcloud/ocs/v1.php line 64
OC\Route\Router->match()
GET /nextcloud/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json&shared_with_me=true&include_tags=true
from 188.103.6.189 by BE084BC3-B4D3-4380-B9B3-07FECC66B9F3 at 2023-09-07T17:36:19+02:00
I found a solution (partially)
commented out line 109-112 of apps/files_sharing/lib/SharedMount.php disabling the cache in verifyMountPoint()
when I do that, the oc_mount is filled properly and the nextcloud files are now all properly visible
ALSO, if I disable my MEMCACHED configuration in config/config.php, it works TOO...
replaced memcached by redis, uncommented the cache in SharedMount.php, and everything is working fine and quick
don't know what was wrong with my config.php, but maybe this deserve a line or two in the documentation if I did something wrong? ;)
In theory Memcached
should have been fine with the way you configured it AFAIK (assuming this is a standalone server). Personally I get the sense Memcached
isn't used very often in new NC installations these days however.
What versions, specifically, of these do you have in this installation?
ii php8.0-memcached 3.2.0++-1+0~20230622.54+debian10~1.gbp8f3995 amd64 memcached extension module for PHP, uses libmemcached
ii memcached 1.5.6-1.1 amd64 high-performance memory object caching system
ii libmemcached11:amd64 1.0.18-4.2 amd64 C and C++ client library to the memcached server
memcached launched with -m 64 -s /tmp/ben.memcached.sock -u ben on a debian 10.13 (buster, I know, quite an oldstable :) ) but with php-sury packages for php.
I found a solution (partially)
commented out line 109-112 of apps/files_sharing/lib/SharedMount.php disabling the cache in verifyMountPoint()
when I do that, the oc_mount is filled properly and the nextcloud files are now all properly visible
ALSO, if I disable my MEMCACHED configuration in config/config.php, it works TOO...
We are not using memcached and disabling the cache in verifyMountPoint() does not help either. Unfortunately we experience the same symptoms but for a different reason as your workaround does not apply to our setup. Disabling file sharing is not an option. I will open a new issue for that. Sorry for the noise.
So interestingly came across another party where memcached
was the culprit on the Forum today:
Noting here simply for future reference for now.
⚠️ This issue respects the following points: ⚠️
Bug description
Quickly: After the upgrade from NC25 to 26, (I later upgraded to NC27 to see if the bug was still there, it still is) I can't see my files in the root of my accounts, I only see the content of a folder another local user shared to me.
Details: my user is benjamin, and local user jean-pierre shared (long ago) 2 folders with me: "numerisation" and "videos" Since NC26 upgrade, I am now seeing "numerisation" folder content at the root of my account instead of my own files. I asked jean-pierre to stop sharing this with me, and now I see "video" folders content from jean-pierre at the root of my account instead of my own files...
I found that in oc_mounts table I had the following entry :
| 113 | 23 | 659747 | benjamin | /benjamin/files/ | NULL | OCA\Files_Sharing\MountProvider |
659747 being the fileid of the "numerisation" folder in jean-pierre files.
after jean-pierre stopped sharing, I now have this entry in oc_mounts :
| 126 | 23 | 569282 | benjamin | /benjamin/files/ | NULL | OCA\Files_Sharing\MountProvider |
569282 being the fileid of jean-pierre "videos" folder ...
of course, in oc_mounts, I also have this entry,
| 1 | 1 | 1 | benjamin | /benjamin/ | NULL | OC\Files\Mount\LocalHomeMountProvider |
(which is normal)
I looked at a MySQL backup from before the upgrade to NC25/26/27, and I found that the entry 113 in oc_mounts had "/benjamin/files/numerisations/" as mount_point, not "/benjamin/files/"
If I change (manually in the DB) it back to the old value, and reload a NC page, it is changed back to "/benjamin/files/"
Steps to reproduce
I am not able to reproduce it on a new NC, sorry
Expected behavior
I expect to find my own files at the root of my account, not the content of a shared folder.
Installation method
Community Manual installation with Archive
Nextcloud Server version
27
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.0
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 22 to 23)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
This is a very old (it was an owncloud 8 and upgraded since to NC 10 to 27 as time goes by) installation. I suspect this could be linked to #37473