Client synchronization fails

I’m using nextcloud for one year now without problem but I recently installed nextcloud on a fresh server running ubuntu focal fossa and it’s a mess.
I have a desktop and I laptop, both under linux, and I try to sync several folders.
I started with a single nextcloud directory, then I added other directories using “add folder synchronization” button on nextcloud client.
I have many errors with client synchronization:
When I clic on a folder sync icon, to retrieve the list of subfolders it’s very slow and usually it ends with error “error while loading the list of the folders from the server, operation cancelled”. Stoping and starting client sometimes help but not always.
I changed the log level to 1. On the log I have a lot of this errors:

{"reqId":"aP1d7JOLGyk5TolZS0cd","level":1,"time":"February 08, 2021 19:28:46","remoteAddr":"82.YYY.XXX.ZZZ","user":"Antonio","app":"no app in context","met
hod":"PROPFIND","url":"/remote.php/webdav/Administratif/Foz%20do%20Arelho/Travaux/Vieux/","message":"Deprecated event type for {\"[object] (OCP\\SabrePlug
inEvent)\":{\"*statusCode\":200,\"*message\":\"\",\"*server\":{\"[object] (OCA\\DAV\\Connector\\Sabre\\Server)\":{\"tree\":\"[object] (OCA\\DAV\\Connector
\\Sabre\\ObjectTree)\",\"*baseUri\":\"/remote.php/webdav/\",\"httpResponse\":\"[object] (Sabre\\HTTP\\Response)\",\"httpRequest\":\"[object] (Sabre\\HTTP\
\Request)\",\"sapi\":\"[object] (Sabre\\HTTP\\Sapi)\",\"*plugins\":[],\"transactionType\":null,\"protectedProperties\":{\"...\":\"Over 20 items, aborting
normalization\"},\"debugExceptions\":false,\"resourceTypeMapping\":[],\"enablePropfindDepthInfinity\":true,\"xml\":\"[object] (Sabre\\DAV\\Xml\\Service)\"
,\"*listeners\":{\"...\":\"Over 20 items, aborting normalization\"},\"*wildcardListeners\":[],\"*listenerIndex\":[],\"*logger\":null}},\"Symfony\\Contract
s\\EventDispatcher\\EventpropagationStopped\":false}}: null","userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1git (Nextcloud)","version":"20.0.7.1"}

The nextcloud client shows me an error “Permission denied” on a file that no longer exists on the local dir nor on the server.

I would really appreciate some help !

At the moment, folders are still waiting for synchronization (I added them 1 hour ago).
I see other errors:
{"reqId":"mvyepmp2n3Vy75PlxMTh","level":3,"time":"2021-02-08T09:42:03+00:00","remoteAddr":"90.22.233.237","user":"Antonio","app":"PHP","method":"MOVE","url":"/remote.php/dav/files/Antonio/Professionnel%20actuel","message":{"Exception":"Error","Message":"fread(): read of 8192 bytes failed with errno=21 Is a directory at /var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#862","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":862,"function":"fread"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":930,"function":"readFirstBlock","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":961,"function":"getHeader","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":294,"function":"getEncryptionModule","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":278,"function":"rename","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/View.php","line":822,"function":"rename","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Connector/Sabre/Node.php","line":142,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":157,"function":"setName","class":"OCA\\DAV\\Connector\\Sabre\\Node","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":641,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/remote.php","line":167,"args":["/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"20.0.7.1","id":"6021bae1219b1"}

and
{"reqId":"PjexnHXBCLUKcp1nOlDE","level":3,"time":"2021-02-08T09:10:33+00:00","remoteAddr":"90.22.233.237","user":"Antonio","app":"PHP","method":"GET","url":"/remote.php/dav/files/Antonio/Professionnel%20actuel/Anyon/Missions%20-%20hors%20dropbox/CA%20Titres_old/CAT/06%20-%20Communication/02%20-%20ELS-Amundi/PER%20CONVERGENCE%20Reglement%202018.pdf","message":{"Exception":"Error","Message":"Cannot modify header information - headers already sent by (output started at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php:112) at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php#70","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php","line":70,"function":"header"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":308,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/remote.php","line":167,"args":["/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1git (Nextcloud)","version":"20.0.7.1","id":"6021bae121c5a"}
and
{"reqId":"PjexnHXBCLUKcp1nOlDE","level":4,"time":"2021-02-08T09:10:33+00:00","remoteAddr":"90.22.233.237","user":"Antonio","app":"webdav","method":"GET","url":"/remote.php/dav/files/Antonio/Professionnel%20actuel/Anyon/Missions%20-%20hors%20dropbox/CA%20Titres_old/CAT/06%20-%20Communication/02%20-%20ELS-Amundi/PER%20CONVERGENCE%20Reglement%202018.pdf","message":{"Exception":"OCP\\Encryption\\Exceptions\\GenericEncryptionException","Message":"Bad Signature","Code":0,"Trace":[{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/encryption/lib/Crypto/Crypt.php","line":479,"function":"checkSignature","class":"OCA\\Encryption\\Crypto\\Crypt","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/encryption/lib/Crypto/Encryption.php","line":376,"function":"symmetricDecryptFileContent","class":"OCA\\Encryption\\Crypto\\Crypt","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":501,"function":"decrypt","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":299,"function":"readCache","class":"OC\\Files\\Stream\\Encryption","type":"->"},{"function":"stream_read","class":"OC\\Files\\Stream\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php","line":91,"function":"fread"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php","line":98,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->"},{"function":"stream_read","class":"Icewind\\Streams\\CallbackWrapper","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php","line":112,"function":"stream_copy_to_stream"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":492,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/remote.php","line":167,"args":["/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/encryption/lib/Crypto/Crypt.php","Line":504,"Hint":"Mauvaise signature","CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1git (Nextcloud)","version":"20.0.7.1","id":"6021bae1221c8"}

I added my IP adress to the trusted domains, and it can now sync folders, but it is very slow.
Opening the client log with F12, it appears that when a single file is modified on a sync folders, all the sync folders are fully rescanned for modifications !
Is it the normal behaviour ?
Thanks !

Ok, I disabled “end-to-end” encryption. I don’t know if it wasn’t correctly configured but it was very very slow and my server was out of memory (2 Gb of ram) ! Maybe it’s not so usable at the moment.
Now my nextcloud runs like a charm.