Community document server fails to store changes into Nexcloud

Nextcloud version: 18.0.3
Operating system and version: Ubuntu 16.0.4
Apache or nginx version: 2.4.41
PHP version: 7.2.28
OnlyOffice Community Server bundled with NextCloud 18
Nextcloud desktop client 2.6.4 Linux
Nextcloud desktop client 2.6.4 Mac

The issue you are facing:
Edits and changes made in Onlyoffice are not saved into Nextcloud and the next sync from Nextcloud to Onlyoffice destroys by overwriting all changes made in Onlyoffice. This results in loss of work. We just lost two days of work by a very expensive consultant. I had to take down Onlyoffice to avoid further losses. As it is now the onlyoffice integration is NOT SUITABLE for production.

Files stored in the local desktop environment are synced flawlessly to Nextcloud. Onlyoffice opens them flawlessly and lets the user edit the document. After saving the document and or logging out from nextcloud changes are kept in OnlyOffice cache and never written to the actual document. When user opens same document from the desktop the changes have disappeared. If user saves the document with a small change, this change is synced to OnlyOffice overwriting the changes in the cache.

Is this the first time you’ve seen this error? (Y/N):
No, it happens all the time

Steps to replicate it:

  1. Use a desktop wordprocessor and create a document in a NextCloud synced folder in your desktop environment
  2. Log onto the Nextcloud web UI and open the file with OnlyOffice.
  3. Ask colleague to do the same
  4. Make changes in document
  5. Exit document ask your colleague to do the same.
  6. Open document with desktop wordprocessor from local NextCloud synced folder.
  7. Notice that the changes never were saved to the file in NextCloud,.
  8. Open file in OnlyOffice from the Nextcloud web UI to notice changes are still there
  9. Close OnlyOffice
  10. Make minimal change in the desktop wordprocessor and save file locally.
  11. Let NextCloud desktop client sync the file to the cloud
  12. Open file in OnlyOffice from the Nextcloud web UI to notice all changes made in OnlyOffice have been lost and overwritten with those made in the desktop environment
  13. Feel despair.

The output of your Nextcloud log in Admin > Logging:
Nothing relevant was found. Only lots of these Normalizing warnings.

PASTE {"reqId":"lGZCqvCVCiZvPy7lTRa9","level":2,"time":"2020-03-26T06:02:17+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"normalizing failed for \"v1_6 – kopio.bak\"","userAgent":"--","version":"","id":"5e7c4a71dc35f"}

The output of your config.php file in /path/to/nextcloud

PASTE $CONFIG = array (
  'passwordsalt' => '-----------------:-)----------------',
  'secret' => '-----------------:-)----------------',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '-----------------:-)----------------',
  'datadirectory' => '/home/shares/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => '-----------------:-)----------------',
  'installed' => true,
  'instanceid' => '-----------------:-)----------------',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  'mail_domain' => '-----------------:-)----------------',
  'mail_from_address' => 'erp',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '-----------------:-)----------------',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '-----------------:-)----------------',
  'mail_smtppassword' => '-----------------:-)----------------',
  'theme' => '',
  'loglevel' => 2,
  '' => 'stable',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mysql.utf8mb4' => true,

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

PASTE Nothing relevant found in the error log

We recognised similar Problem: Creating Office Document, edit, close it.
The synced document is empty when it’s opened in Word.

I did then take a closer look with ftp: the content of OnlyOffice documents is stored in different folder than the origin doc folder at file system.

This looks like the doc content is separated from the base file.

How to handle syncronisation of OnlyOffice documents ?