Cant delete files that was created before NextCloud update(19->20)

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:

example

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

longer
example
here

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, 18.0.2): 20.0.4.0
Operating system and version (eg, Ubuntu 20.04): Debian
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38
PHP version (eg, 7.1):7.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

I am using nextcloudpi(on x86-x64). All was fine, till I update from NC 19 to NC 20.
After that I noticed that I cant delete some files. After an investigation I found that I can’t delete files that was created before update.
There is no error in logs. I can create in same folders new files and delete it.
In web interface there is no such button ‘delete’ for that old files.
When I tried to delete them from desktop client syncing, it delete it first(locally on client), then when syncing - just upload it from server back to me and says:
“Not allowed to remove, restoring”
I checked OS permissions: all is fine, ‘www-data’ is owner and permissions for new files that I can delete and for old files are the same.
Was trying to use ‘lslocks’ but there is no third party soft on server that can lock files I want to delete.
Files are not shared.

P.S: I can replace it. Just cant delete.

Can anyone help - where to dig next to find the reason?

Ok, looks like command:
“sudo -u www-data php occ files:scan --all” do some magic and helps in this situation.
Problem is solved.