nextcloud / documentserver_community

Document server for onlyoffice
https://apps.nextcloud.com/apps/documentserver_community
129 stars 29 forks source link

Excel File - after close - client sync only after cron job run, wrong downloaded version, versioning failures #191

Open Githopp192 opened 3 years ago

Githopp192 commented 3 years ago

Actual behaviour

When editing i.e an EXCEL File - the File will not suddenly being synchronized to the Clients (i.e. Windows NC Agent). This only happens when the next PHP-Cron Job will run. (after it has run).

Also when leaving the Document (in this case the EXCEL File) and then push the Download button, the current Version of the Document will not be downloaded (instead it will download an old version).

Again here - the download is only working, when the next PHP-Cron Job will run. (after it has run).

This hit me once - because - i lost some of my data into the Excel through this behave.

Also - i think the NC versioning did not work as expected.

Steps to reproduce

every time when repeating those steps

Expected behaviour

  1. the Document itself (proper saving)
  2. Client Sychronization without delay
  3. File versioning is working properly

Server configuration details

Operating System: System Linux 4.18.0-240.1.1.el8_3.x86_64 Build => Hat

Webserver: Apache/2.4.37 (centos)

Database: mysql 10.3.17-MariaDB,

PHP version: PHP Version => 7.4.13

[PHP Modules] apcu bcmath bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext gmp hash iconv igbinary imagick intl json ldap libsmbclient libxml mbstring memcached msgpack mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix readline redis Reflection session shmop SimpleXML smbclient sockets sodium SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib [Zend Modules] Zend OPcache

Nextcloud: - version: 19.0.5.2

{ "system": { "memcache.local": "\OC\Memcache\APCu", "filelocking.enabled": true, "redis": { "host": "REMOVED SENSITIVE VALUE", "timeout": 1.5, "password": "REMOVED SENSITIVE VALUE" }, "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusteddomains": [ ], "datadirectory": "REMOVED SENSITIVE VALUE", "htaccess.RewriteBase": "\/", "overwriteprotocol": "https", "dbtype": "mysql", "version": "19.0.5.2", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbport": "", "dbtableprefix": "oc", "mysql.utf8mb4": true, "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "maintenance": false, "theme": "", "loglevel": 0, "updater.release.channel": "stable", "auth.bruteforce.protection.enabled": true, "check_for_working_htaccess": true, "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_smtpsecure": "tls", "mail_smtpauth": 1, "mail_smtpname": "REMOVED SENSITIVE VALUE", "mail_smtppassword": "REMOVED SENSITIVE VALUE", "mail_smtphost": "REMOVED SENSITIVE VALUE", "session_lifetime": 1200, "session_keepalive": false, "logfile": "\/media\/log\/nextcloud.log", "knowledgebaseenabled": false, "log_rotate_size": 3145728, "mail_sendmailmode": "smtp", "app_install_overwrite": [ "passman",

Enabled:

Githopp192 commented 3 years ago

these are some message i saw into the nc.log -->

"2020-12-11T21:27:08+01:00","remoteAddr":"xxx.xxx.xxx.xxx", "user":"Michael","app":"no app in context","method":"GET","url":"/remote.php/webdav/Documents/Shopping/xxx.xlsx?downloadStartSecret=ctjfvlscnoo", "message":"Deprecated event type for {\"[object] (OCP\SabrePluginEvent)\":{\"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\Contracts\EventDispatcher\EventpropagationStopped\":false}}: null", "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.57","version":"19.0.5.2"}

Just saw, that one Excel File - i did an update into - was only updated after 10 minutes, even if CRON is running now every 5 minutes ..

Document will be left in this way -->

ScreenShot1100

NC is using REDIS .. so i tried also to flush REDIS Cache to Disk .. same result (flushall).

Githopp192 commented 3 years ago

Today did the Upgrade to NC Version: 20.0.4 - same issue

robinm8 commented 3 years ago

same issue here

robinm8 commented 3 years ago

The following fixes worked for me:

  1. On my Linux installation in /usr/share/webapps/nextcloud/config/config.php, appended the following to the $CONFIG array:

    array(
    'verify_peer_off => TRUE,'
    ),
  2. Added crontab entry for user running nextcloud via php-fpm etc.

    • on my Linux installation, the user is "http"
    • sudo crontab -u http -e
      */5  *  *  *  * php -f /usr/share/webapps/nextcloud/cron.php
      */1  *  *  *  * php -f /usr/share/webapps/nextcloud/occ documentserver:flush
  3. Edited /usr/share/webapps/nextcloud/apps/documentserver_community/lib/Channel/SessionManager.php

    • Followed the pull request #114
    • Modified line 130 to be:
      $cutoffTime = $this->timeFactory->getTime() - 30;
  4. Modified nextcloud admin settings onlyoffice:

    • checkmark "Disable certificate verification"
    • checkmark "Generate document preview"
    • un-checkmark "Keep intermediate versions when editing"
    • un-checkmark all of the customization section "Display ..."

After these fixes, excel files worked for me (YMMV)

Githopp192 commented 3 years ago

Thx robinm8,

found a good article how OO will handle document savings -->

https://www.onlyoffice.com/blog/2020/04/save-and-force-save-in-onlyoffice-never-lose-a-document/

i think for my needs "verify_peer_off => TRUE,'" is not necessary; i think this is only needed, if you're using "Self-signed-Certs".

It seems, that one of the main issues here is, that OO will not flush the contents to disk in time, when you will leave the document (there's no real EXIT button in Nextcloud - only a button to open the "File Location".

And yes .. the "Flush command" does the Job.

The rest i did not change - and it seems to work.

Some time ago, when the OO-App did not exist yet as App into the NC App Store - i used an extra VM with Docker to run OO. And i must say - i never had issues - so it seems that the NC App Integration is not so "mature" as my Docker (OO) Installation was.

github-actions[bot] commented 1 month ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 60 days. Thank you for your contribution!

Retaking repo management include inheritance of old, not treated, and probablty obsolete issues, this is why it was decided to mark issues as stale.