Server: deleted files reappear over and over

Created on 5 Nov 2018  Â·  27Comments  Â·  Source: nextcloud/server

Steps to reproduce

We have a shared Folder, where we deleted files and directories. Not all clients are online at the same time.
In irregular intervals earlier deleted files and directories reappear over and over. We try to delete them, but don´t get rid of them.

Expected behaviour

Sync the local folder to the server state.
When ready: sync bidirectional.
You can not get rid of files or folders as long as at least one client which collaborate is offline and keep the deleted files. They get pushed back over and over and soon the offline clients get connected.

Actual behaviour

Sync bidirectional, pushing up all locally kept files/folders, which are not on the server back to it.

Server configuration detail

Operating system: Linux 4.15.0-1025-aws #25-Ubuntu SMP Wed Oct 10 14:23:49 UTC 2018 x86_64

Webserver: Apache/2.4.29 (Ubuntu) (apache2handler)

Database: mysql 5.6.10

PHP version:

7.0.32-3+ubuntu18.04.1+deb.sury.org+1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, apc, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 14.0.3 - 14.0.3.0

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.0.1
 - activity: 2.7.0
 - admin_audit: 1.4.0
 - bruteforcesettings: 1.1.0
 - cloud_federation_api: 0.0.1
 - comments: 1.4.0
 - dav: 1.6.0
 - dropit: 0.1.1
 - external: 3.1.0
 - federatedfilesharing: 1.4.0
 - files: 1.9.0
 - files_accesscontrol: 1.4.0
 - files_pdfviewer: 1.3.2
 - files_rightclick: 0.8.4
 - files_sharing: 1.6.2
 - files_texteditor: 2.6.0
 - files_trashbin: 1.4.1
 - files_versions: 1.7.1
 - files_videoplayer: 1.3.0
 - gallery: 18.1.0
 - groupfolders: 1.3.3
 - impersonate: 1.1.0
 - issuetemplate: 0.4.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.2.0
 - metadata: 0.7.0
 - notifications: 2.2.1
 - oauth2: 1.2.1
 - password_policy: 1.4.0
 - previewgenerator: 1.1.0
 - provisioning_api: 1.4.0
 - serverinfo: 1.4.0
 - sharebymail: 1.4.0
 - sharerenamer: 2.2.0
 - socialsharing_email: 1.0.4
 - survey_client: 1.2.0
 - systemtags: 1.4.0
 - theming: 1.5.0
 - twofactor_backupcodes: 1.3.1
 - updatenotification: 1.4.1
 - user_usage_report: 1.1.0
 - w2g2: 2.2.3
 - workflowengine: 1.4.0
Disabled:
 - encryption
 - federation
 - files_downloadactivity
 - files_external
 - files_trackdownloads
 - firstrunwizard
 - nextcloud_announcements
 - support
 - user_external
 - user_ldap

Configuration (config/config.php)

{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "drive.company.com"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "14.0.3.0",
    "overwrite.cli.url": "https:\/\/drive.company.com\/",
    "htaccess.RewriteBase": "\/",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "logtimezone": "America\/New_York",
    "logdateformat": "l, F d, Y h:i:s a",
    "log_rotate_size": 10485760,
    "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
    "loglevel": 3,
    "cron_log": true,
    "syslog_tag": "Nextcloud",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": 587,
    "mail_smtptimeout": 10,
    "mail_smtpsecure": "tls",
    "mail_smtpauth": true,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "debug": false,
    "wnd.logging.enable": false,
    "filelocking.debug": false,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": "true",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379,
        "timeout": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "enable_avatars": true,
    "knowledgebaseenabled": false,
    "remember_login_cookie_lifetime": 1296000,
    "trashbin_retention_obligation": "30, 31",
    "versions_retention_obligation": "30, 31",
    "enable_previews": true,
    "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
    "updater.release.channel": "stable",
    "check_for_working_webdav": true,
    "check_for_working_wellknown_setup": true,
    "has_internet_connection": true,
    "check_for_working_htaccess": true,
    "cipher": "AES-256-CFB",
    "minimum.supported.desktop.version": "1.7.0",
    "singleuser": false,
    "theme": "",
    "appcodechecker": true,
    "activity_expire_days": 365,
    "data-fingerprint": "8b40196ad1c7fb6bc7c6512fb8ae9f79"
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Operating system: Windows 10 Pro

1. to develop bug 💻 desktop

Most helpful comment

I also have this issue in NextCloud v18. It happens in shared folders and in group folders.
One user deletes all files web or client, then after some time another user put the files back to the server (sync client).
The behaviour should be that the offline user client should delete the files once connected instead of restoring the files.

All 27 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/9523 (A file completely disappears after deleting from a group folder), https://github.com/nextcloud/server/issues/1708 (Sharing: Cannot delete files from share ), https://github.com/nextcloud/server/issues/11574 (After deleting image, the preview files remain forever), https://github.com/nextcloud/server/issues/4451 ("Delete Calendar" Issue), and https://github.com/nextcloud/server/issues/9594 (Unable to delete or create files).

This is a really old and annoying problem that people are having since Owncloud. I had this problem and i am having it now again, same thing as you. Looks like is a problem in the Nextcloud client on Mac and Windows, i didn't have the problem with the client on Linux, and i dont have a Windows machine now to check, but years ago in the Mac client, i saw a option that solved the problem...

I found some old notes about the owncloud check if works:

Open the %LOCALAPPDATA%\ownCloud\owncloud.cfg
In general, change the line to:
promptDeleteAllFiles=false

I don't quite see how the promptDeleteAllFiles setting should make a difference. As far as I understand the source code, the client would issue a message box when this is true. When the setting is left out, it doesn't do so, however.

I have this problem with a Nextcloud instance serving about 20 clients. It's extremely annoying and happens with a couple of files, especially folders, but the permissions on the server are ok, and so far I could not determine why these folders are "special".

The client briefly issues a red warning and the log contains "Cannot remove directory". This seems to happen on every affected client.

With one of the affected folders I get the following error for the parent(!) directory, when I delete it: ""disk_free_space(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#299"

With a debug statement I discovered that the path which is passed to @disk_free_space is missing the "files" part. Instead of /var/www/nextcloud/data/username/files/etc I get something like /var/www/nextcloud/data/username/etc which of course does not exist!

I compared the sqlite databases from two clients synchronizing the same folders from the same server, one is reuploading a certain file, the other does not. The affected client's database contains additional files which have been deleted previously and don't exist on the server or the local folders anymore.

I checked the metadata record of one of the affected files, and they are identical except for the "inode" column. The inode in the affected database is significantly higher. I don't know yet what this means, but it is a difference...

the issue still remains even with group folders version 2.0.2

it is NOT client related because we don't use desktop client (only browser based access)

files/folders are not deleted from the file tree /var/www/html/nextcloud/data/__groupfolders/groupname/trash/groupnumber

There may be several causes leading to the same symptoms. In our case it's definitely the client because reinstalling the client helps.

One of the most useful ways to investigate this issue is through watching the activity feed. Either on the web client or directly with the database. Normally some user will be associated with the reuploading. If not, there must be something happening on the server side.

in the web interface it is a bug
when selecting the file on the left side and then selecting delete from the menu does not delete the file
see image:
nodeletion

when deleting the file one at a time on the right side however, the files does get deleted
see image:
deletion

Do you still see this issue? Some issues with selected files and delete and restore operations were fixed recently.

oh ghees.. since then I have upgraded to 17.0.2, but even in that version the issue still exists

oh ghees.. since then I have upgraded to 17.0.2, but even in that version the issue still exists

The issue with the deleted files coming back right? I'm asking because there are two more problems in this thread ;)

  • Files are restored if at least one sync client was offline and missed the delete event.
  • Something with file select and delete
  • disk_free_space(): No such file or directory at

Thanks :+1:

yes correct... same issue still exists like the post I made with the menu pictures.

trying to delete a complete row of deleted files and using the top menu above it to seletec delete doesn't delete any of the files.

there is a trick though.. if you select multiple files manually and then use the same menu to delete it actually works and the files are gone.
Just not when you use the select all butoon and then try to delete at once.

@kesselb any clue?

@skjnldsv No.

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

I seem to be getting this issue, not sure when it started but noticed it last week. I've tried deleting the files using select and delete on the webpage, delete on the single file on the webpage and though the sync client on linux, no errors or warnings on server or client but other users which the file is shared to are re-uploading the file after its deleted.
Did anyone find a solution?

I also have this issue in NextCloud v18. It happens in shared folders and in group folders.
One user deletes all files web or client, then after some time another user put the files back to the server (sync client).
The behaviour should be that the offline user client should delete the files once connected instead of restoring the files.

I found that only certain users were re-uploading the files, no obvious correlations between their clients. I removed the sync connection and added it again for these users and they stopped restoring the files.

We are also experiencing the exact issue @jmartin-oss is describing.
Could this please be re-opened @skjnldsv ?

cc @nextcloud/desktop ring a bell? Should this be in the desktop repo?

At least it doesn't ring any bell to me...

I upgraded NC to v19 and the issue still persists. For now, I detected that the issue is related with one user...
For testing I uninstalled the Windows Sync Client (2.6.5) and installed latest version (3.0.2)
Sync was fine at first, then it was 9 days offline, after get back online it started to reupload a lot of deleted folders (by other users) instead of deleting them in the local copy.

In the audit log, you can see that once connected you can see that the client is polulating folders and pushig all the deleted files.
Then, all other users sync client start to download the reuploading files.

Do you know anything that I can try to debug the problem?

I am having the same issue anything I delete it restores files or folders. Never had this issue before, but I get an error saying error deleting

https://cdn.discordapp.com/attachments/642060061988093953/771774802624905236/unknown.png

Hey there we run on 18.0.9 (client 3.0.1) and having exactly the same problems. One client (was offline for a long time … like 2–4 weeks). Files deleted from other clients, were uploaded again from the "old" client when we startet it again.
I do not see any points why exactly this client is reuping everything and other in our office don not.

Do you need any further information or help to take a deeper look into that?
THX

The issue is still present on v19.0.5.
Observing it, it doesn't seem that need to much time offline to happen. If all the clients are online there's no issue but when a client is offline and other remove files.... then this client back online and restores all the deleted files.
It also happens when there's a conflict uploading files.

These are my assumptions because I didn't fount any trace or error in the logs that can figure out why it's happening.

Was this page helpful?
0 / 5 - 0 ratings