The desktop client randomly deletes files

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 10 (31.0.7)
  • Operating system and version (e.g., Ubuntu 24.04):
    • macOS 15.5
  • Web server and version (e.g, Apache 2.4.25):
    • Official Docker image nextcloud:latest
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Nginx Proxy manager official Docker image jc21/nginx-proxy-manager:latest
  • PHP version (e.g, 8.3):
    • Official Docker image nextcloud:latest
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • It has always done this
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker image
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When adding files and folders to a folder that is being synced, the sync starts, but after a while the client starts to delete files and folders randomly.

Steps to replicate it (hint: details matter!):

  1. Set up a brand new server via Docker on a mac.
  2. Install the desktop client
  3. Choose a folder to be synced
  4. Copy a bunch of files and folders to the sync folder from another source
  5. The sync starts and goes for a while
  6. The client hangs
  7. The sync restarts after the client is started again
  8. The client starts randomly deleting files and folders
  9. There is no possible way to get all files/folders synced to the server

I have tried this for five months in all ways possible. Let the sync go until the client seems done and then copy all the deleted files from the source again, but then they or other files gets deleted. I have tried to go via the web client, but it is too many files so it’s not feasable. I have tried to use the webdav mount and rSync to copy them to the server, but it is so incredibly slow that after a couple of weeks of running I gave up and then only a few hundred files had been copied.

The files that gets copied to the server stays there, but the files there is not necessary visible in the web client and not on other sync clients (phone, computer). The files in the “source” sync folder are deleted randomly and the last test I did today where I copied 5 660 files (8.44 GB) resulted in 7.31 GB on the server and after the client did its random delete 6.77 GB in the “source” sync folder.

I have no other clients running but the single one. The files being deleted has NEVER been deleted or even handled by any person.

It seems to me that the client is fundamentally broken and can’t handle the task at hand.

I have tried this so many times from a fresh install of the server and client that I have lost count. I have reduced the number of initial files from approx 300 000 to now just a few thousand and no luck. The client constantly hangs and randomly deletes files suddenly.

It would be a nice feature to have to be able to tell the client that a sync folder is read only (I know you don’t like this since it defeats the ‘sync’ functionality, but right now it’s completely unusable without this feature and the possibility to force upload).

A nice to have would also be a script that restarts the client when it hangs. I have written one myself that runs with LaunchAgent and an AppleScript:

-- ~/Scripts/watchNextcloud.scpt
-- Startar Nextcloud om den inte körs och dödar den bara om den slutat svara

property gracePeriod : 10 -- sekunder att vänta efter "quit"
property pingTimeout : 3 -- sekunder att vänta på svar från appen

-- ▸  Pingar Nextcloud med en enkel Apple-event
on appResponding()
	try
		with timeout of pingTimeout seconds
			tell application "Nextcloud" to get id of it -- billigt "ping"
		end timeout
		return true
	on error errMsg number errNum
		-- -1712 = timeout → appen svarade inte i tid
		-- alla andra fel räknas också som ”inte svarar”
		return false
	end try
end appResponding

on run
	tell application "System Events"
		------------------------------------------------------------
		-- 1. Finns processen?
		------------------------------------------------------------
		if exists application process "Nextcloud" then
			--------------------------------------------------------
			-- 2. Svarar den?
			--------------------------------------------------------
			if not my appResponding() then
				-- Försök vänligt först …
				try
					tell application "Nextcloud" to quit
				end try
				
				repeat with i from 1 to gracePeriod
					delay 1
					if not (exists application process "Nextcloud") then exit repeat
				end repeat
				
				-- … och tvinga ned om den fortfarande lever
				if (exists application process "Nextcloud") then
					do shell script "/usr/bin/killall -9 Nextcloud"
					delay 2
				end if
			end if
		end if
		
		------------------------------------------------------------
		-- 3. Starta om om den inte körs
		------------------------------------------------------------
		if not (exists application process "Nextcloud") then
			tell application "Nextcloud" to activate
		end if
	end tell
end run
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <!-- Unik identifierare -->
    <key>Label</key>
    <string>com.example.watchnextcloud</string>

    <!-- Kör AppleScriptet via osascript -->
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/osascript</string>
        <string>/Users/kalle/Script/watchNextcloud.scpt</string>
    </array>

    <!-- Kör var 600:e sekund = 10 minuter -->
    <key>StartInterval</key>
    <integer>600</integer>

    <!-- Loggar (frivilligt men praktiskt vid felsökning) -->
    <key>StandardOutPath</key>
    <string>/tmp/com.example.watchnextcloud.out</string>
    <key>StandardErrorPath</key>
    <string>/tmp/com.example.watchnextcloud.err</string>
</dict>
</plist>

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

There are no entries in the log of delete. The full nexcloud.log is 112 MB, so I will not paste it here.

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Not applicable

Web server / Reverse Proxy

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

I have no logs in NPM

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

# php occ config:list system
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "upgrade.disable-web": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.tekapo.se"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "https:\/\/cloud.tekapo.se",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "overwritehost": "cloud.tekapo.se",
        "overwriteprotocol": "https",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_sendmailmode": "smtp",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "maintenance": false
    }
}

Apps

# php occ app:list
Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0
# 

The client debug log may have some hints.

Also the server-side audit log (once you enable it - see Configuration->Logging in the Admin Manual).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.