[Problem] Issue creating some folders

I upgraded from Nextcloud 18 to 19 and 19 to 20, so far everything is working great, but im having an issue with one of the users in the server, for some reason, that user can create, move, delete, etc, anything from her account, but there are 4 specific folders that wont let her sync with the server, it says its restricted for some reason.

If i remove those folders everything is ok, but if i try to add them again to her account they stay with the yellow mark and wont ever sync with the server

If i change the name of those folders, they sync perfectly, but if i give them their original names problem comes back.

Another test i did was to remove those folders from her account and then create new empty folders from the nextcloud web interface with the exact same name, again i get an error in nextcloud saying i cant create that folder, if i create a new folder or file, it works, if i try to rename that newly created folder to one of those names with the problem, nextcloud wont let me, it gives me an error.

This is wierd and i have no clue how to procede here with this issue, so please if anyone have any ideas ill be monitoring this post to try them out.

No one? :frowning:

I would guess this is an issue with the DB.
Maybe you can try the following:

  1. store those folders outside of your nextcloud data structure.
  2. rescan your data with occ, this will take a long time as you surely know.
  3. add the folders again.

In theory, the rescan might delete corrupted or missing directories and folders while keeping those ones she still has.

Another try would be to move the database away (or dump it) and let your nextcloud rescan the whole datastructure with occ. But this is at your own risk and i guess you will at least loose history of files etc.

Here are commands from occ you might need:


Or look here: https://docs.nextcloud.com/server/9.0/admin_manual/configuration_server/occ_command.html#file-operations-label
Maybe you could find something in there to target the db entries for exactly the directories you are looking for.

Aight, will that tonight, how about scanning only that specific user? should i do files:scan --all USERID or files:scan USERID ?

Any symbols in the “prohibited” names?
Nextcloud is known to “freak out” on file names containing some symbols…

Nope, the name of the folder is NOMINA 2019, thats it hehe

I tried to do a scan of the specific user, at first it started but then power went down and server went off, when it came back on i tried to run it again but now i get that the user files are locked, what can i do now? heres the log:

administrator@ubuntu-troya:~$ sudo -u www-data php /usr/share/nginx/nextcloud/occ files:scan viricortes
Starting scan for user 1 out of 1 (viricortes)
Exception during scan: “files/a8c63558c4d91c9466a7b3f98b0b5f45”(“home::viricortes::scanner::”) is locked
#0 /usr/share/nginx/nextcloud/lib/private/Files/Storage/Common.php(751): OC\Lock\DBLockingProvider->acquireLock(‘files/a8c63558c…’, 2, ‘home::viricorte…’)
#1 /usr/share/nginx/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(594): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#2 /usr/share/nginx/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(594): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#3 /usr/share/nginx/nextcloud/lib/private/Files/Cache/Scanner.php(333): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#4 /usr/share/nginx/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan(’’, true, 3)
#5 /usr/share/nginx/nextcloud/apps/files/lib/Command/Scan.php(152): OC\Files\Utils\Scanner->scan(’/viricortes’, true, NULL)
#6 /usr/share/nginx/nextcloud/apps/files/lib/Command/Scan.php(208): OCA\Files\Command\Scan->scanFiles(‘viricortes’, ‘/viricortes’, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#7 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /usr/share/nginx/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(1000): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /usr/share/nginx/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /usr/share/nginx/nextcloud/console.php(100): OC\Console\Application->run()
#14 /usr/share/nginx/nextcloud/occ(11): require_once(’/usr/share/ngin…’)
#15 {main}
| Folders | Files | Elapsed time |
| 0 | 0 | 00:00:00 |

Uh, that is quite unfortunate.
Maybe look into this:

There is a guide on how to unlock files in this unfortunate state and a few people discussing similar problems in the comments.

I hope you will find an answer :+1: