# Nextcloud 19.0.1 Problem with deleting files/folders

**URL:** <https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041>\
**Category:** ℹ️ Support\
**Tags:** nc19\
**Created:** [August 5, 2020, 12:22pm UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041 "2020-08-05T12:22:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![triver](https://help.nextcloud.com/letter_avatar/triver/32/5_5575768a8748004e209b776fc1b2916d.png) [@triver](https://help.nextcloud.com/u/triver)\
**Post date:** [August 5, 2020, 12:22pm UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/1 "2020-08-05T12:22:56Z")

</div>

> **Support intro**
>
> Sorry to hear you’re facing problems 🙁
> 
> _**[help.nextcloud.com](http://help.nextcloud.com) is for home/non-enterprise users. If you’re running a business, paid support can be accessed via [portal.nextcloud.com](http://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:
> 
> ```auto
> 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 ❤

Nextcloud version: 19.0.1 - 19.0.1.1  
Operating system and version: Linux 5.4.51-v7l+ #1327 SMP Thu Jul 23 11:04:39 BST 2020 armv7l  
Apache or nginx version : nginx/1.18.0 (fpm-fcgi)  
PHP version: 7.4.8

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, json, ldap, exif, mysqli, pdo\_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache

The issue you are facing:

Problem with deleting files and folders

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

Steps to replicate it:

1. delete file in groupfolder or in normal folder
2. get status error deleting “file/folder”

The output of your Nextcloud log in **Admin \> Logging** :

```auto
{"reqId":"G4OZXksiR6VUA2mSqsCO","level":4,"time":"2020-08-05T13:50:46+02:00","remoteAddr":"1 **.***. ***.***","user":" ***Username***","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/ ***Username*** / **folderstructure** /*filename*","message":{"Exception":"Exception","Message":"Failed to move groupfolder item to trash","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":103,"function":"moveToTrash","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":192,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":99,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_accesscontrol/lib/StorageWrapper.php","line":287,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1161,"function":"unlink","class":"OCA\\FilesAccessControl\\StorageWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":718,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":455,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":183,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":295,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":320,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","Line":183,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.1.1","id":"5f2a9d35d8e6c"}

```

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
{
    "instanceid": " ***REMOVED SENSITIVE VALUE***",
    "passwordsalt": " ***REMOVED SENSITIVE VALUE***",
    "secret": " ***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        " ***REMOVED SENSITIVE VALUE***",
        " ***REMOVED SENSITIVE VALUE***",
        "localhost",
        " ***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": " ***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "19.0.1.1",
    "overwritehost": " ***REMOVED SENSITIVE VALUE***",
    "overwriteprotocol": "https",
    "overwritewebroot": "\/",
    "overwrite.cli.url": " ***REMOVED SENSITIVE VALUE***",
    "dbname": " ***REMOVED SENSITIVE VALUE***",
    "dbhost": " ***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": " ***REMOVED SENSITIVE VALUE***",
    "dbpassword": " ***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "activity_expire_days": 14,
    "auth.bruteforce.protection.enabled": true,
    "blacklisted_files": [
        ".htaccess",
        "Thumbs.db",
        "thumbs.db"
    ],
    "cron_log": true,
    "enable_previews": true,
    "enabledPreviewProviders": [
        "OC\\Preview\\PNG",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\GIF",
        "OC\\Preview\\BMP",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\Movie",
        "OC\\Preview\\PDF",
        "OC\\Preview\\MP3",
        "OC\\Preview\\TXT",
        "OC\\Preview\\MarkDown"
    ],
    "filesystem_check_changes": 0,
    "filelocking.enabled": "true",
    "htaccess.RewriteBase": "\/",
    "integrity.check.disabled": false,
    "knowledgebaseenabled": false,
    "logfile": " ***REMOVED SENSITIVE VALUE***",
    "loglevel": 2,
    "logtimezone": " ***REMOVED SENSITIVE VALUE***",
    "log_rotate_size": 104857600,
    "maintenance": false,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "preview_max_x": 1024,
    "preview_max_y": 768,
    "preview_max_scale_factor": 1,
    "redis": {
        "host": " ***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0
    },
    "quota_include_external_storage": false,
    "share_folder": "\/Shares",
    "skeletondirectory": "",
    "theme": "",
    "trashbin_retention_obligation": "auto, 7",
    "updater.release.channel": "stable",
    "trusted_proxies": " ***REMOVED SENSITIVE VALUE***",
    "app_install_overwrite": [
        "joplin"
    ],
    "twofactor_enforced": "true",
    "twofactor_enforced_groups": [],
    "twofactor_enforced_excluded_groups": []
}

```

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

```auto
PASTE HERE

```

---

<div class="post-metadata">

**Author:** ![triver](https://help.nextcloud.com/letter_avatar/triver/32/5_5575768a8748004e209b776fc1b2916d.png) [@triver](https://help.nextcloud.com/u/triver)\
**Post date:** [October 18, 2020, 1:17am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/2 "2020-10-18T01:17:21Z")

</div>

This is still a problem in 19.0.4  
Anyone has a solution?

---

<div class="post-metadata">

**Author:** ![rhua](https://help.nextcloud.com/letter_avatar/rhua/32/5_5575768a8748004e209b776fc1b2916d.png) [@rhua](https://help.nextcloud.com/u/rhua)\
**Post date:** [October 21, 2020, 2:18am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/3 "2020-10-21T02:18:03Z")

</div>

Please consider moving your question to these existing topics to keep the forum organized:

[File stuck - can’t move or delete it](https://help.nextcloud.com/t/file-stuck-cant-move-or-delete-it/80386)  
[Issues with deleting, moving, and renaming files - External storage](https://help.nextcloud.com/t/issues-with-deleting-moving-and-renaming-files-external-storage/88500)

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [October 21, 2020, 9:58am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/4 "2020-10-21T09:58:04Z")

</div>

apart from what @rhua just said…

have you checked the links? if one of it is fitting pls let us know and we would do the move for you (if you cant’t do it yourself)

---

<div class="post-metadata">

**Author:** ![triver](https://help.nextcloud.com/letter_avatar/triver/32/5_5575768a8748004e209b776fc1b2916d.png) [@triver](https://help.nextcloud.com/u/triver)\
**Post date:** [October 22, 2020, 10:07am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/5 "2020-10-22T10:07:30Z")

</div>

I first tried following the next instruction:

> [@File is locked - how to unlock](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883/29):
>
> Hi amo13 I had the same Problems a few times. But I could always fix it with this procedure (retain the order!): occ ‘files:scan --all’ occ ‘files:cleanup’ occ ‘maintenance:mode --on’ mysql -u root -p’inheregoesyourpassword’ -D ocdb -e ‘delete from oc\_file\_locks where 1’ occ ‘maintenance:mode --off’ restart your Nextcloud webserver and try again -\> the files in your web-ui should be gone. Good Luck, Cheers zisuu

Which at step one resulted in mayor errors and the process being killed:

```
Starting scan for user 1 out of 3 (Some_user_without_groupfolder_access)
Starting scan for user 2 out of 3 (Some_user_with_Groupfolder_access)
    Exception during scan: An exception occurred while executing 'SELECT `fileid` FROM `oc_filecache` WHERE (`storage` = ?) AND (`path_hash` = ?)' with params [1, "1e6013faa7e8570d55f5164261dc1b4d"]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(169): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(145): Doctrine\DBAL\DBALException::wrapException()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(911): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
#3 /var/www/nextcloud/lib/private/DB/Connection.php(194): Doctrine\DBAL\Connection->executeQuery()
#4 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(200): OC\DB\Connection->executeQuery()
#5 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(216): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/Files/Cache/Cache.php(472): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php(144): OC\Files\Cache\Cache->getId()
#8 /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php(151): OC\Files\Cache\Wrapper\CacheJail->getId()
#9 /var/www/nextcloud/apps/groupfolders/lib/Mount/RootEntryCache.php(47): OC\Files\Cache\Wrapper\CacheWrapper->getId()
#10 /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php(151): OCA\GroupFolders\Mount\RootEntryCache->getId()
#11 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(386): OC\Files\Cache\Wrapper\CacheWrapper->getId()
#12 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#13 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#14 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#15 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren()
#16 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#17 /var/www/nextcloud/apps/files/lib/Command/Scan.php(151): OC\Files\Utils\Scanner->scan()
#18 /var/www/nextcloud/apps/files/lib/Command/Scan.php(207): OCA\Files\Command\Scan->scanFiles()
#19 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#20 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#21 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1012): OC\Core\Command\Base->run()
#22 /var/www/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand()
#23 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun()
#24 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#25 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#26 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#27 {main}
Starting scan for user 3 out of 3 (Some_other_user)
Killed

```

After this i tried the next proposed solution which actually solved some problems (but not all).

> [@File is locked - how to unlock](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883/47):
>
> solved the issue for me, thanks. sudo -u www-data php occ maintenance:mode --on (in Nextcloud folder) sudo redis-cli -s /var/run/redis/redis.sock flushall (OK was response) exit sudo -u www-data php occ maintenance:mode --off (in Nextcloud folder) sudo -u www-data php occ files:scan --all (in Nextcloud folder) But there was no password in redis? Is this right?

Then I went back to the first procedure, which this time didn’t cause any errors.  
But still didn’t solve the problem.

So to be clear:

The newer problem in my log file named (and occured after my initial post):

`OCP\Files\NotPermittedException: Could not create path`

Is **SOLVED** with the instructions.

But the one in my log file that is named:

`Exception: Failed to move groupfolder item to trash`

**Still occurs** …

I do **not** wish to move this question to another topic, as i’m quite sure it is **a problem on it’s own** that has not been solved yet… (or that i’m aware of after frantically searching for a solution on the forum.)

Is there any more information that can help search for a solution?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![R0Wi](https://help.nextcloud.com/user_avatar/help.nextcloud.com/r0wi/32/18933_2.png) [@R0Wi](https://help.nextcloud.com/u/R0Wi)\
**Post date:** [September 24, 2021, 10:36am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/6 "2021-09-24T10:36:03Z")

</div>

Hi @triver , i also noticed the mentioned problem in NC22. I did some research and i found that decreasing the [serverside loglevel](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html) to `2` or less gave me some more informational log messages like this one:

> unable to rename, destination directory is not writable : \_\_groupfolders/trash/2

So then i inspected my NC data directory (usually something like `/var/www/nextcloud/data`) and i found the the `data/__groupfolders/trash` directory was missing completely. So what i did was basically:

```bash
cd /var/www/nextcloud/data/__groupfolders
mkdir trash
cd trash
mkdir 1 10 2 3 4 5 6 7 8 9
cd ..
chown -R www-data:www-data trash

```

Creating the `trash` folder with all subfolders fixed the error for me but to be honest i don’t know how it happened that the `trash` folder was removed. Also i don’t know if it’s enough to create the subfolders numbered from 1 to 10 or if this is something which depends on your installation.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:58am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/7 "2024-12-12T07:58:33Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:58am UTC](https://help.nextcloud.com/t/nextcloud-19-0-1-problem-with-deleting-files-folders/89041/8 "2024-12-12T07:58:34Z")

</div>


