Initial Sync Fails on 580,000 files with Client app

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

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. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.4
  • Web server and version (e.g, Apache 2.4.25):
    • Apache2
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Caddy
  • PHP version (e.g, 8.3):
    • 8.4
  • Is this the first time you’ve seen this error? (Yes / No):
    • new server
  • When did this problem seem to first start?
    • yesterday
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • bare metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

[…]

I have a new server that has 580,000 files (roughly). The initial sync using the disktop Files app takes a long time, which I can live with (~5-6 hours). The bigger problem is that it fails often. I have 1 PC that I was able to complete it on after 3 tries, but on my home PC I am on my 6th or 7th try.

Should this work? Is there some logs I can look at to see whats going on?

The server is a VM hosted on Proxmox with 8 cores assigned and 12 GB of RAM.

What other info would be helpful in troubleshooting?

Also, off-topic, but is there anyway to get the window that pops up from the tray icon in Windows to stay up? Like a pin feature? I am trying to see when it fails, but the window goes away if I click on any other area of the screen.

Unfortunatelly you skipped the most important part of the Support Template, so we cannot view error messages in the log files.
Same with version of the desktop-app.

Hi muzicman0,

Yes, syncing that many files (around 580,000) in one go can definitely work but it’s known to stress both the desktop client and the server if some limits aren’t adjusted. Nextcloud can handle millions of files, but the initial scan and indexing are usually the toughest part.

Here are a few things to check and tune:

  1. Increase PHP and web server limits on your server, edit the PHP configuration (php.ini or pool config) and set:

    memory_limit = 1024M
    max_execution_time = 3600
    post_max_size = 2G
    upload_max_filesize = 2G
    
    

    Then restart PHP and Apache.

  2. Adjust sync client settings in the desktop client, go to Settings → Advanced, and reduce the number of parallel sync connections to 2 or 3 instead of the default 6. This helps prevent timeouts during large batch operations.

  3. Exclude cache or temporary folders folders like .cache, node_modules, or large logs can easily choke the sync. Use the “Ignored files” settings in the client to skip them.

  4. Monitor the Nextcloud logs on the server, you can check:

    sudo tail -f /var/www/html/data/nextcloud.log
    
    

    Look for timeouts, locking errors, or HTTP 500 responses during sync.

  5. VM optimization since you’re on Proxmox, make sure your VM storage is fast (SSD preferred) and has at least a 4K block size to handle many small files efficiently.

Once the first full sync finishes, subsequent syncs will be much faster and stable. You can also try syncing in smaller chunks, add one large folder at a time and let it complete before adding more.

As for your side note, the Windows tray window can’t be pinned yet that’s just how the current client UI works, though there’s a feature request for it on GitHub.

1 Like

thanks for the help. I made a few changes in the php.ini file.

memory_limit = 1024M
–this was set to 1G, Ichanged it to 1024M, although I assume that will make no difference
max_execution_time = 3600
–this was already set
post_max_size = 2G
–this was set to 0 to disable, but I changed it to 2G
upload_max_filesize = 2G
–this was set to 100G, I changed it to 2G

I should also say that I am using the Virtual File System on Windows clients.

With those changes, will my max file size upload be 2G, or will it allow larger files? We use it to store some demo video content, and I know some of them are over 20 GB in size.

Under settings, I could not find anything on the Windows desktop client (4.0.1) that allowed me to change the parallel sync connections.

I have a copy of the logs, but I am a little leary of uploading them since I don’t know what (if any) sensitive information is in them.

Again, appreciate the help!

I have cut this way back, so that I am syncing just around 25000 files at a time (slowly adding in the shares). It is still failing. It gets past the file count stage, but then it will sync some files and fail. Sometimes it only syncs less than 50 files. But eventually it will complete.

Something is for sure wrong, I just have no clue what it is.

Not getting anything in the logs about the sync at all. But I am on the default logging level. I will increase it to ‘1’ and see if that gives me anything.

EDIT: and this time, I got over 18,000 files in one go.
Edit2: All I am getting in the logs when it fails is a bunch of these:

The requested alias "OCP\AppFramework\IAppContainer" is deprecated. Please request "Psr\Container\ContainerInterface" directly. This alias will be removed in a future Nextcloud version.

I have tried everything I can think of. I am now trying NextCloud AIO, but still can’t get through the initial sync. The error it is getting is

Error updating metadate: Couldn't set pin state.

I am trying on new hardware now as well with no changed. The VM that is running it is not super stressed during the sync either.

Did you check the
C:\Users\username\AppData\Roaming\Nextcloud\Nextcloud_sync.log for errors?

Maybe there is an issue on the client-side, but not with the server.

It very well may be the client side. I am running a sync from a Linux VM that I have at home and it is going well so far. I have a Windows laptop that I will try next to see if it will finish as well.

I looked at the logs you mentioned, and it appears everything is going fine until where it quits. The last few lines are:

||Shared/Test Engineering/Yuan High-Tech Development/RELEASES 1.1.0.179.0/AMESDK/SAMPLES/FUNCTIONS/DEINTERLACER/H264.AAC.DEINTERLACER|8|2|1762988693|6915129c6f593|0|00585358ocxsyqemb6vw|1|Error updating metadata: Couldn't set pin state|0|0|0||
||Shared/Test Engineering/Yuan High-Tech Development/RELEASES 1.1.0.179.0/AMESDK/SAMPLES/FUNCTIONS/ENCODER|8|2|1762988693|6915129c6f593|0|00585135ocxsyqemb6vw|13||0|0|0||
#=#=#=# Syncrun finished 2025-11-13T03:27:59Z (last step: 53275 msec, total: 121465 msec)

So all it is really giving me is what I showed above that it couldn’t set the pin state.

It is for sure something on the Client PC. I have a laptop here that is at over 413,000 files sync’d and the desktop I have has never made it past 5 or 6,000, so I assume it will finish just fine. Laptop is on the same network, only real difference is that it is WiFi vs wired and it is on an older version of the sync client (3.17.1 maybe?). I may try that version on the desktop just to see if it is a problem with the sync client.

So it must be something about my D:\ drive. It is a 2 TB m.2 Nvme drive, but when I sync to the C:\ drive (also a m.2 drive), it appears to sync fine. I will try and replace the D drive and see if that works.