Parent folder not in filecache for files

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.0
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian trixie
  • Web server and version (e.g, Apache 2.4.25):
    • apache 2.4.65-2
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • 2:8.4+96
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • after upgrade
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • by hand
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

Se $subject. The PHP error when the client tries to do anything is “Parent folder not in filecache for files”.

Steps to replicate it (hint: details matter!):

  1. I installed the nextcloud instance, created the group folders from the web, then in the command line moved the content under nextcloud/__groupfolders/[n]/files/, and did an occ files:scan.

  2. After install the nextcloud clients synchronized ok, but when I tried to move or delete a file in the client side, an error occured. The log revealed the php error “Parent folder not in filecache for files”.

  3. Then I ran occ files:repair-tree. On the web all files in the group folder disappeared, and the clients started to cry about missing files.

  4. Then I ran occ files:scan –all, which restored the files, but goto 2

Log entries

ct  5 19:05:53 server Nextcloud[128358]: {"reqId":"6lqXCGsAzaXX5EIGnsgr","level":3,"time":"2025-10-05T17:05:53+00:00","remoteAddr":"192.168.1.1","user":"marianna","app":"webdav","method":"P
UT","url":"/remote.php/dav/files/marianna/Arpi-maganugyei/ingatlan/ingatlan%20kiad%C3%A1s/Kimen%C5%91%20sz%C3%A1ml%C3%A1k/2025/E-MA-2025-77-Szeg%C5%91.pdf","message":"{\"Exception\":\"Except
ion\",\"Message\":\"Parent folder not in filecache for files\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php\",\"line\":123,\"function\":
\"insert\",\"class\":\"OC\\\\Files\\\\Cache\\\\Cache\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php\",\"line\":132,\"function\":\"insert\"
,\"class\":\"OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheJail\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/groupfolders/lib/Mount/RootEntryCache.php\",\"line\":46,\"function\":\"insert
\",\"class\":\"OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheWrapper\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php\",\"line\":132,\"function\":
\"insert\",\"class\":\"OCA\\\\GroupFolders\\\\Mount\\\\RootEntryCache\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php\",\"line\":276,\"function\":\"inse
rt\",\"class\":\"OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheWrapper\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php\",\"line\":227,\"function\":\"addToCach
e\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php\",\"line\":170,\"function\":\"scanFile\",\"class\":\"OC\
\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php\",\"line\":320,\"function\":\"scanFile\",\"class\":\"OC\\\\Files\\\\Cache\\
\\Scanner\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Files/View.php\",\"line\":1388,\"function\":\"scan\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\"},{\
"file\":\"/var/www/nextcloud/lib/private/Files/View.php\",\"line\":1424,\"function\":\"getCacheEntry\",\"class\":\"OC\\\\Files\\\\View\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/
dav/lib/Connector/Sabre/Directory.php\",\"line\":199,\"function\":\"getFileInfo\",\"class\":\"OC\\\\Files\\\\View\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV
/Tree.php\",\"line\":95,\"function\":\"getChild\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Loc
kPlugin.php\",\"line\":49,\"function\":\"getNodeForPath\",\"class\":\"Sabre\\\\DAV\\\\Tree\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php
\",\"line\":89,\"function\":\"getLock\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\LockPlugin\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\
"line\":456,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php\",\"line\":211,\"function\":\"i
nvokeMethod\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/dav/lib/Server.php\",\"line\":424,\"function\":\"start\",\"class\":\"OCA\\\\DAV\\\\Con
nector\\\\Sabre\\\\Server\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php\",\"line\":22,\"function\":\"exec\",\"class\":\"OCA\\\\DAV\\\\Server\",\"type\":\"-
>\"},{\"file\":\"/var/www/nextcloud/remote.php\",\"line\":151,\"args\":[\"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/nextcloud/l
ib/private/Files/Cache/Cache.php\",\"Line\":276,\"message\":\"Parent folder not in filecache for files\",\"exception\":{},\"CustomMessage\":\"Parent folder not in filecache for files\"}","us
erAgent":"Mozilla/5.0 (Windows) mirall/3.17.2 (build 20250916) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"32.0.0.13","clientReqId":"262bf49
c-3e46-463a-b309-4a5400070993"}

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "fs.kodekonveyor.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "32.0.0.13",
        "overwrite.cli.url": "https:\/\/fs.kodekonveyor.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "app_install_overwrite": [
            "organization_folders"
        ],
        "maintenance": false,
        "maintenance_window_start": 1,
        "mail_smtpmode": "sendmail",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "pipe",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ],
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "mail_smtpport": "25",
        "log_type": "syslog",
        "syslog_tag": "Nextcloud",
        "logfile": "",
        "loglevel": 1
    }
}

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Can you clarify the context a bit more? This sounds like more than an upgrade, but that you’re also manually moving files around?

Yes, in intention it was an upgrade. The original instance was 28.x.x and used mysql. After the OS upgrade it did not work at all, because wanted older php than what I have. So I installed the nextcloud instance freshly (32.0.0, using postgresql), created the same users and groups, created empty group folders in the same names, and then copied the contents of the old group folders and user folders over into the new data directory.

I figured occ:scan will recreate whatever indices are needed. Apaprently there are some problems with that.

Besides the fact that this does not sound like a good idea to do an upgrade like this, please note that groupfolders have their own Scan command GitHub - nextcloud/groupfolders: 📁👩‍👩‍👧‍👦 Admin-configured folders shared by everyone in a group or team. https://github.com/nextcloud-releases/groupfolders

I disabled the “Deleted files” app. Now there are no errors when I hit “force sync now”, I see no error.

But the contents of the directory in the website and in the local copy are different.

I did an occ groupfolders:scan –all

It did not seemed to help with anything.

After an occ files:repair-tree I did not see anything in the group folders again.

Tried to remediate with occ groupfoders:scan –all

It resulted a lot of error messages like the following:

Oct 7 16:58:06 server postgres[187695]: [1675-1] 2025-10-07 16:58:06.416 CEST [187695] nextcloud@nextcloud ERROR: duplicate key value violates unique constraint “fs_storage_path_hash”
Oct 7 16:58:06 server postgres[187695]: [1675-2] 2025-10-07 16:58:06.416 CEST [187695] nextcloud@nextcloud DETAIL: Key (storage, path_hash)=(13, dfda780a07897da912e6278ba02e2aa2) already exists.
Oct 7 16:58:06 server postgres[187695]: [1675-3] 2025-10-07 16:58:06.416 CEST [187695] nextcloud@nextcloud STATEMENT: INSERT INTO “oc_filecache” (“mimepart”, “mimetype”, “mtime”, “size”, “etag”, “storage_mtime”, “permissions”, “name”, “parent”, “checksum”, “path_hash”, “path”, “storage”) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)

But the files at least reappeared.
There is still a difference between the local FS and what I see through the web.

It seems there is still no synchronisation in either direction between the server and the local fs, though the client acts as if everything would be all right.

I made some experiments.

I created a folder in my own (non-group) folder. I could create files both from the filesystem and the web. I could delete them as well. I deleted the file which was created on the filesystem on the web, and vice versa. Synchronisation worked flawlessly.

I tried to create a test folder in the group folder on the web. I got the “Parent folder not in filecache for files” error.

I guess this script might have worth to run, but I was not yet able to rewrite it for postgresql backend.