An error occured while opening a folder Operation canceled (NC20)

Nextcloud version (eg, 18.0.2): Nextcloud 20.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.46
PHP version (eg, 7.1): 7.4.10

The issue you are facing:

When using the Nextcloud Desktop client to sync folders which have a large number of files, I’m running into the error “An error occured while opening a folder Operation canceled”.

If I sync specific individual folders, it will sync through fine.

I’m seeing this with two different folders currently, one contains 26,620 files and the other contains 573,632 files.

I’ve tried syncing on two different computers, both result in the same error.

I can see it’s the same situation for other users, however no solution was identified other than not syncing that many files, e.g. An error occured while opening a folder Operation canceled

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

Steps to replicate it:

  1. Create folder which has 26000+ files in.
  2. Try syncing using the desktop client.
  3. Sync will eventually fail.

The output of your Nextcloud log in Admin > Logging:

No errors are present in the Admin > Logging section when this occurs, I removed the file when testing to be absolutely certain.

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

<?php
$CONFIG = array (
  'instanceid' => 'ocqz3krd2bi6',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' =>
  array (
    0 => 'removed',
    1 => 'removed',
  ),
  'datadirectory' => '/home/valdearg/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '20.0.0.9',
  'overwrite.cli.url' => 'removed',
  'dbname' => 'nextcloud',
  'dbhost' => 'removed',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'removed',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'removed',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.gandi.net',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'removed',
  'mail_smtppassword' => 'removed',
  'updater.release.channel' => 'beta',
  'logfile' => '/var/logs/nextcloud/nextcloud.log',
  'log_rotate_size' => 10485760,
  'app_install_overwrite' =>
  array (
    0 => 'files_reader',
    1 => 'breezedark',
    2 => 'fulltextsearch',
    3 => 'fulltextsearch_elasticsearch',
    4 => 'files_fulltextsearch',
  ),
);