Random files are missing in data folder

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


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:

Nextcloud version (eg, 14.0.4):
Operating system and version (Ubuntu 16.04):
Apache or nginx version (Apache 2.4.25):
PHP version (7.0):

hello community
in December we have successfully migrated our project with 90 users and 6TB data from Owncloud 9.0 to Nextcloud 14. that were the good news :slight_smile:

but now we have an issue with Nextcloud, that some files in random folders can not not found on server. Users can not download or open them, but the file is visible in web interface. I checked these files on the server, but they are missing. The data folder is not encrypted. The size of data folder is pretty big(so i suppose, that we can have more of such missing files). I can’t reproduce how it happened. Log file has nothing about these missing files. Collaboration in a project can be the reason, why it happened (90 users with plenty of shared folders).
Some of these missed files i have found with normal linux find command in trash or in versions folder of other users or the owner.

I suppose, that database has records about these files, but physically files are not there anymore. In this way i can’t use file:scan to repair, because it does just the opposite (if i understood correctly):

  • adds a new record to database, if new file is found in folder on server;
  • deletes record from database, if no file is found for existing record in database,
  • what i need - list records from database, if no file is found for existing record.

So scan is not usable for me, because i still want to recover the files and not to lose database records.

the Question is how can i scan and find all these inconsistences in my data folder on server? is there any ready solution (script) or maybe someone have just other good ideas?

thank you very much in advance!