Error deleting file "XX"

Support intro

Hi,
I’m not able to delete some folders, the files were deleted but the error folder, but does not generate any log, I tried to find some information in /var/log/apache2 or any other log folder, even the Nextcloud logging don’t show nothing! A LOCK error appears when I try to create a folder or upload a file to this folder that folder I cannot delete.

I tried to upgrade to Nextcloud 20 but the error continued!

Server configuration detail

Operating system: Linux 4.19.0-11-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.3.23

PHP version: 7.3.19-1~deb10u1

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, sodium, standard, apache2handler, mysqlnd, PDO, xml, apcu, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, intl, json, exif, mysqli, pdo_mysql, apc, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Phar, Zend OPcache

Nextcloud version: 20.0.0 - 20.0.0.9

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array ( )

List of activated apps
Enabled:
 - accessibility: 1.6.0
 - activity: 2.13.1
 - cloud_federation_api: 1.3.0
 - comments: 1.10.0
 - dav: 1.16.0
 - federatedfilesharing: 1.10.1
 - federation: 1.10.1
 - files: 1.15.0
 - files_accesscontrol: 1.10.0
 - files_pdfviewer: 2.0.1
 - files_rightclick: 0.17.0
 - files_sharing: 1.12.0
 - files_trashbin: 1.10.1
 - files_versions: 1.13.0
 - files_videoplayer: 1.9.0
 - firstrunwizard: 2.9.0
 - forms: 2.0.4
 - groupfolders: 8.0.0
 - logreader: 2.5.0
 - lookup_server_connector: 1.8.0
 - nextcloud_announcements: 1.9.0
 - notes: 4.0.0
 - notifications: 2.8.0
 - oauth2: 1.8.0
 - password_policy: 1.10.1
 - photos: 1.2.0
 - privacy: 1.4.0
 - provisioning_api: 1.10.0
 - quota_warning: 1.9.0
 - recommendations: 0.8.0
 - registration: 0.5.1
 - serverinfo: 1.10.0
 - settings: 1.2.0
 - sharebymail: 1.10.0
 - socialsharing_email: 2.1.0
 - support: 1.3.0
 - survey_client: 1.8.0
 - systemtags: 1.10.0
 - text: 3.1.0
 - theming: 1.11.0
 - twofactor_backupcodes: 1.9.0
 - updatenotification: 1.10.0
 - user_status: 1.0.0
 - viewer: 1.4.0
 - weather_status: 1.0.0
 - workflow_pdf_converter: 1.5.0
 - workflowengine: 2.2.0
Disabled:
 - admin_audit
 - camerarawpreviews
 - contactsinteraction
 - dashboard
 - encryption
 - extract
 - files_external
 - files_mindmap
 - files_retention
 - flowupload
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "100.64.66.66",
        "cloud.blue3.com.br",
        "cloud.b3.rs"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "20.0.0.9",
    "overwrite.cli.url": "https:\/\/cloud.blue3.com.br",
    "htaccess.RewriteBase": "\/",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "sort_groups_by_name": true,
    "log_type": "file",
    "logfile": "\/var\/log\/nextcloud.log",
    "syslog_tag": "Nextcloud",
    "logdateformat": "F d, Y H:i:s",
    "logtimezone": "America\/Sao_Paulo",
    "log_query": false,
    "log_rotate_size": false,
    "appstoreenabled": true,
    "mail_smtpmode": "sendmail",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "updater.secret": "***REMOVED SENSITIVE VALUE***",
    "check_for_working_htaccess": true,
    "check_data_directory_permissions": true,
    "session_lifetime": 2592000,
    "session_keepalive": true,
    "auth.bruteforce.protection.enabled": true,
    "skeletondirectory": "\/var\/www\/nextcloud\/core\/skeleton",
    "trashbin_retention_obligation": "180,auto",
    "versions_retention_obligation": "360,auto",
    "enable_previews": true,
    "preview_max_x": 4096,
    "preview_max_y": 4096,
    "preview_max_filesize_image": 50,
    "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
    "enabledPreviewProviders": [
        "OC\\Preview\\PNG",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\GIF",
        "OC\\Preview\\BMP",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\MP3",
        "OC\\Preview\\TXT",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\Illustrator",
        "OC\\Preview\\Movie",
        "OC\\Preview\\MSOffice2003",
        "OC\\Preview\\MSOffice2007",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\PDF",
        "OC\\Preview\\Photoshop",
        "OC\\Preview\\Postcript",
        "OC\\Preview\\SVG",
        "OC\\Preview\\TIFF",
        "OC\\Preview\\Font"
    ],
    "updater.release.channel": "stable"
}

External storages: files_external is disabled

Encryption: no

User-backends:

  • OC\User\Database

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

Unfortunately you’ve forgotten to provide any related error messages from the Nextcloud log file, so that a detailed analysis won’t be possible. My guess is, that some access rights aren’t set correctly which are causing the mentioned error.

The directory was created by Nextcloud, but I was unable to delete it two days later, but it deleted the files.

file
/var/log/apache2/%
(IPv4) - samir [05/Oct/2020:14:10:54 -0300] “PROPFIND /remote.php/dav/files/samir/FOTOS/SAMIR-IPHONE/2016/12 HTTP/1.1” 207 1284 “-” “Mozilla/5.0 (Windows) mirall/3.0.2stable-Win64 (build 20200924) (Nextcloud)”
(IPv4) - - [05/Oct/2020:15:39:15 -0300] “DELETE /remote.php/dav/files/samir/FOTOS/SAMIR-IPHONE HTTP/1.1” 423 911 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36”

That’s not the Nextcloud log but the web server log! You have to check the Nextcloud log for related messages.

lognextcloud20

That’s still not the Nextcloud log, but related to the “423 Locked” message, you should check similar postings on this forum:

https://help.nextcloud.com/search?q=423%20locked

I did it, I just signed up because I didn’t find an adequate answer, there are many without an answer and several with an answer that lead to nothing. I even wasted time reading again and etc.

Several times I have reinstalled Nextcloud for some problem of this type, now that I am thinking about correcting the problem to escape it, but I see that it is not a simple thing for Nextcloud, since many have this problem and there is no clear place to solve it him.

Obviously the solution exists, it is not very simple, but I can force and delete directories and remove them from the database, but I really thought of trying a non-palliative solution and that’s why I signed up here to see if there is a solution to this problem!

Nothing is easy in a complex file and web server environment with many different components involved. The administrator guide contains a paragraph in which file locking is explained and how it could be improved by using Redis:

https://docs.nextcloud.com/server/20/admin_manual/configuration_files/files_locking_transactional.html?highlight=locking#transactional-file-locking

Thank you very much, now this link helped me a lot!

The solution I got was adding these two lines to my config.php file (config / config.php)

‘filelocking.enabled’ => true,
‘memcache.locking’ => ‘\OC\Memcache\APCu’,

Again, thank you very much!

5 Likes

This was the solution!! Thank you!

This may be useful from someone: