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

[Bug]: I can't see my files in the root of my accounts after NC upgrade (27) #40322

Closed
5 of 8 tasks
vincib opened this issue Sep 7, 2023 · 11 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug dependencies feature: caching Related to our caching system: scssCacher, jsCombiner... feature: filesystem needs review Needs review to determine if still applicable

Comments

@vincib
Copy link

vincib commented Sep 7, 2023

⚠️ 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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.sonntag.fr",
            "cloud.petrichoeur.com",
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.sonntag.fr",
        "dbtype": "mysql",
        "version": "27.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "theme": "",
        "loglevel": 0,
        "maintenance": false,
        "trashbin_retention_obligation": "auto",
        "htaccess.RewriteBase": "\/",
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "calendar",
            "sharelisting",
            "twofactor_totp"
        ],
        "default_language": "fr",
        "simpleSignUpLink.shown": false,
        "mysql.utf8mb4": true,
        "encryption.key_storage_migrated": false,
        "memcached_servers": [
            [
                "\/tmp\/ben.memcached.sock",
                0
            ]
        ],
        "memcache.local": "\\OC\\Memcache\\Memcached",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "default_phone_region": "FR"
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - bbb: 2.5.0
  - calendar: 4.4.4
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - drawio: 2.1.2
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_fulltextsearch: 27.0.1
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - fulltextsearch: 27.0.1
  - impersonate: 1.14.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - notes: 4.8.1
  - notifications: 2.15.0
  - oauth2: 1.15.1
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.1.1
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - webapppassword: 23.6.0
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0 (installed 2.4.0)
  - dashboard: 7.7.0 (installed 7.3.0)
  - encryption: 2.15.0 (installed 2.4.0)
  - fulltextsearch_elasticsearch: 27.0.2 (installed 27.0.2)
  - groupfolders: 15.0.2 (installed 15.0.2)
  - mail: 3.3.1 (installed 3.2.6)
  - nextcloud_announcements: 1.16.0 (installed 1.12.0)
  - onlyoffice: 8.2.0 (installed 8.2.0)
  - sharelisting: 1.1.1 (installed 1.1.1)
  - spreed: 17.0.3 (installed 17.0.3)
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0 (installed 6.4.1)
  - updatenotification: 1.17.0 (installed 1.13.0)
  - user_ldap: 1.17.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"mE8G5p4PEbtzZd94vjoA","level":0,"time":"2023-09-07T08:02:02+00:00","remoteAddr":"91.194.61.238","user":"isabelle","app":"webapppassword","method":"PROPFIND","url":"/remote.php/dav/files/isabelle/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Macintosh) mirall/3.7.3git (build 13809) (Nextcloud, osx-22.2.0 ClientArchitecture: arm64 OsArchitecture: arm64)","version":"27.0.2.1","data":{"app":"webapppassword"}}
{"reqId":"mE8G5p4PEbtzZd94vjoA","level":3,"time":"2023-09-07T08:02:02+00:00","remoteAddr":"91.194.61.238","user":"isabelle","app":"PHP","method":"PROPFIND","url":"/remote.php/dav/files/isabelle/","message":"foreach() argument must be of type array|object, bool given at /var/alternc/html/b/ben/cloud/pub/apps/workflowengine/lib/AppInfo/Application.php#75","userAgent":"Mozilla/5.0 (Macintosh) mirall/3.7.3git (build 13809) (Nextcloud, osx-22.2.0 ClientArchitecture: arm64 OsArchitecture: arm64)","version":"27.0.2.1","data":{"app":"PHP"}}
{"reqId":"p4oQwBaKrAzpSSbz7edr","level":0,"time":"2023-09-07T08:02:04+00:00","remoteAddr":"81.66.210.128","user":"benjamin","app":"webdav","method":"HEAD","url":"/remote.php/dav/files/benjamin/Photos/2023/09/20230906_114455.jpg","message":"File with name //Photos could not be located","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.25.0","version":"27.0.2.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"File with name //Photos could not be located","Code":0,"Trace":[{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Tree.php","line":73,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Tree.php","line":73,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Tree.php","line":73,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":76,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpHead","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/apps/dav/lib/Server.php","line":364,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/alternc/html/b/ben/cloud/pub/remote.php","line":172,"args":["/var/alternc/html/b/ben/cloud/pub/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/alternc/html/b/ben/cloud/pub/apps/dav/lib/Connector/Sabre/Directory.php","Line":227,"message":"File with name //Photos could not be located","exception":{},"CustomMessage":"File with name //Photos could not be located"}}

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

@vincib vincib added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 7, 2023
@vincib
Copy link
Author

vincib commented Sep 7, 2023

More informations :

  • other users are affected as well : as an example, I have a user named "astrid" and she doesn't see her own files on her root folder, but she see a folder of my own data that I shared with her :/
  • I found a way to see this weird behavior by useing occ info:file command. please find below 2 examples :
~/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

@solracsf solracsf changed the title [Bug]: [Bug]: I can't see my files in the root of my accounts after NC upgrade (27) Sep 7, 2023
@vincib
Copy link
Author

vincib commented Sep 7, 2023

Follow-up of my research on this bug:

  • If I disable the File sharing apps, all users now see their own files (but of course they don't see the shared folders anymore).
  • I tried doing some kind of bisect, by running a copy of that NC 27 with the file_sharing APP on version 1.17.0 (from NC25) but the problem stays the same (the oc_mounts table is filled with bad data)

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

@vincib
Copy link
Author

vincib commented Sep 7, 2023

okay, following up :)

  • I understood that oc_mounts is a cache of all mount types (localhome, localshare, external storage, remote share...)
  • I understood that the authoritative data for local shares is in oc_share and that the name of the shared folder in the target user is in the file_target field
  • It looks like my oc_share table is good and that there is a bug in the filling of the oc_mounts table from that oc_share table:
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                     |

@herrmannsdorfer

This comment was marked as off-topic.

@vincib
Copy link
Author

vincib commented Sep 7, 2023

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...

@vincib
Copy link
Author

vincib commented Sep 8, 2023

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? ;)

@joshtrichards
Copy link
Member

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?

@joshtrichards joshtrichards added the feature: caching Related to our caching system: scssCacher, jsCombiner... label Sep 9, 2023
@vincib
Copy link
Author

vincib commented Sep 9, 2023

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.

@herrmannsdorfer

This comment was marked as off-topic.

@joshtrichards
Copy link
Member

So interestingly came across another party where memcached was the culprit on the Forum today:

https://help.nextcloud.com/t/this-is-the-unsupported-community-build-of-nextcloud-message-for-small-install/172263/8

Noting here simply for future reference for now.

@joshtrichards
Copy link
Member

Closing since this got resolved. Still keeping an eye out for other similar scenarios from other memcached (not redis) users. If a pattern arises we can document something, but so far none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug dependencies feature: caching Related to our caching system: scssCacher, jsCombiner... feature: filesystem needs review Needs review to determine if still applicable
Projects
None yet
Development

No branches or pull requests

4 participants