ONLYOFFICE / onlyoffice-nextcloud

The app which enables the users to edit office documents from Nextcloud using ONLYOFFICE Document Server, allows multiple users to collaborate in real time and to save back those changes to Nextcloud
GNU Affero General Public License v3.0
553 stars 157 forks source link

OnlyOffice and Group Folders #434

Open codello opened 3 years ago

codello commented 3 years ago

I am experiencing a bug where ONLYOFFICE sometimes cannot open documents. ONLYOFFICE displays an error message "An error has occurred while opening the file" with no further indication of the problem. This seems to be the same behavior described in #146.

I hope this is the correct place to report this issue. Otherwise I'll gladly report this issue in ONLYOFFICE/DocumentServer.

Reproducing the Problem

I originally observed the issue when modifying a document using Excel with a mapped WebDav drive. The issue also sometimes occurs when replacing a document by manually uploading a new version. However I was not able to consistently reproduce the error this way.

I was however able to (more or less) reliably reproduce the error in the following way:

  1. Upload a file into a NextCloud group folder or create a new file with ONLYOFFICE. I was able to reproduce the issue with both xlsx and pptx files but not with docx files.
  2. Open a Document in NextCloud twice without waiting for ONLYOFFICE to load. If the delay before opening the second document is too long, the issue does not seem to occur.
  3. Do some changes and verify in the second window/tab that the changes are visible in the other ONLYOFFICE instance.
  4. Close both ONLYOFFICE windows and wait a few seconds.
  5. Open the document again, the error message displays.

Video

Despite my best efforts I am not able to reproduce the issue 100% reliably. The above steps result in the error most of the time but not always. Outside of a group folder I was not able to reproduce the error using the above steps.

What is the expected behavior?

I expect to be able to open the same document multiple times without issues. Moreover I expect to be able to change a document in NextCloud (e.g. by editing it with Excel over WebDAV) and then be able to open it with ONLYOFFICE.

Additional Context

Additional Files

ONLYOFFICE configuration This is the `local.json` from the docker container. ```json { "services": { "CoAuthoring": { "sql": { "type": "postgres", "dbHost": "localhost", "dbPort": "5432", "dbName": "onlyoffice", "dbUser": "onlyoffice", "dbPass": "onlyoffice" }, "token": { "enable": { "request": { "inbox": true, "outbox": true }, "browser": true }, "inbox": { "header": "Authorization", "inBody": false }, "outbox": { "header": "Authorization", "inBody": false } }, "secret": { "inbox": { "string": "secret" }, "outbox": { "string": "secret" }, "session": { "string": "secret" } } } }, "rabbitmq": { "url": "amqp://guest:guest@localhost" } } ```
NextCloud Configuration (relevant parts) ```shell ./occ config:list onlyoffice ``` I replaced the document server url with `https://office.domain.tld`: ```json { "apps": { "onlyoffice": { "DocumentServerInternalUrl": "http:\/\/test-onlyoffice\/", "DocumentServerUrl": "https:\/\/office.domain.tld\/", "StorageUrl": "http:\/\/test-nginx\/", "customizationChat": "true", "customizationCompactHeader": "false", "customizationFeedback": "false", "customizationForcesave": "false", "customizationHelp": "false", "customizationReviewDisplay": "original", "customizationToolbarNoTabs": "false", "defFormats": "{\"csv\":\"false\",\"doc\":\"true\",\"docm\":\"true\",\"docx\":\"true\",\"dotx\":\"false\",\"epub\":\"false\",\"html\":\"false\",\"odp\":\"true\",\"ods\":\"true\",\"odt\":\"true\",\"otp\":\"true\",\"ots\":\"true\",\"ott\":\"true\",\"pdf\":\"false\",\"potm\":\"false\",\"potx\":\"false\",\"ppsm\":\"false\",\"ppsx\":\"false\",\"ppt\":\"true\",\"pptm\":\"false\",\"pptx\":\"true\",\"rtf\":\"false\",\"txt\":\"false\",\"xls\":\"true\",\"xlsm\":\"true\",\"xlsx\":\"true\",\"xltm\":\"false\",\"xltx\":\"false\"}", "demo": "{\"available\":true,\"enabled\":false,\"start\":{\"date\":\"2021-02-13 12:01:27.708514\",\"timezone_type\":3,\"timezone\":\"UTC\"}}", "editFormats": "{\"csv\":\"false\",\"odp\":\"false\",\"ods\":\"false\",\"odt\":\"false\",\"rtf\":\"false\",\"txt\":\"false\"}", "enabled": "yes", "groups": "[]", "installed_version": "6.2.0", "jwt_secret": "secret", "preview": "false", "sameTab": "false", "settings_error": "", "types": "filesystem", "verify_peer_off": "false" } } } ```
NextCloud Logs As far as I can tell the NextCloud logs do not give any indication about the source of the error. Below are the `DEBUG` logs generated when performing step 5. I have removed some deprecation warnings: ```shell cat nextcloud.log | jq 'select(.message | startswith("/appinfo/app.php is deprecated") | not) | select(.message | startswith("Deprecated event type") | not)' > nextcloud-debug.log ``` I also replaced the name of the document in the URLs and messages with `<%2Fpath%2Fto%2Fdoc.xlsx>` and `` respectively: [nextcloud-debug.log](https://github.com/ONLYOFFICE/onlyoffice-nextcloud/files/5976148/nextcloud-debug.log)
Document Server Logs These logs are generated with a log level of `"ALL"` (configured in `/etc/onlyoffice/documentserver/log4js/production.json`). I replaced the name of the document with ``: `cat /var/log/onlyoffice/documentserver/converter/out.log`: [converter-out.log](https://github.com/ONLYOFFICE/onlyoffice-nextcloud/files/5976164/converter-out.log) `cat /var/log/onlyoffice/documentserver/docserver/out.log`: [docservice-out.log](https://github.com/ONLYOFFICE/onlyoffice-nextcloud/files/5976170/docservice-out.log)

Did this work in previous versions of DocumentServer?

I have experienced this issue since version 5.4. I have not tested earlier versions.

Environment

I am running ONLYOFFICE and NextCloud in Docker containers using docker-compose. NextCloud is using S3 object storage as its primary storage (via Minio). NextCloud is served via PHP FPM and nginx.

NextCloud and the document server are running behind a reverse proxy via HTTPS. Internally the NextCloud server is reachable under http://test-nginx/ and the document server is reachable as http://test-onlyoffice/. Externally the document server is reachable under https://office.domain.tld.

NextCloud Version

20.0.6, group folders version 8.2.0

DocumentServer version:

6.1.1

Operating System:

The server runs CentOS 8, NextCloud and ONLYOFFICE run in docker containers.

Browser version:

The client is Safari 14.0.3 on macOS 11.2. Other users have reported the same issue using versions of Firefox and Chrome on macOS and Windows.

SergeyKorneyev commented 3 years ago

Do you have any directories in /var/lib/onlyoffice/documentserver/App_Data/cache/files/ or /var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten/ the name of which match any of the problematic files' ID? According to your logs, one of them might be "1989457682". That should be inside the Document Server's container. Also, please try reproducing the issue with your browser's console open, export the .har file from the Network tab and send it to us.

codello commented 3 years ago

Thanks for your response! I created the logs in a test environment and didn't keep the containers so I can't exactly check this ID. I recreated the test setup and reproduced the error and I also checked in the production environment:

However the folders do match the respective IDs of the files in the task_result table.

I have a feeling that this issue is somehow related to conflicting versions of the same file or at least ONLYOFFICE thinking that there are conflicts...

Also, please try reproducing the issue with your browser's console open, export the .har file from the Network tab and send it to us.

I have reproduced the problem as shown in the GIF above. Every time a new ONLYOFFICE tab is opened, I have opened the web inspector and reloaded the page. Just before closing an ONLYOFFICE tab I have exported the .har file.

Again I have replaced the domain names:

I also checked the JS log but except for a ton of jQuery deprecation warnings there does not seem to be anything there.

Please do tell me if I can provide anything else to help. I really appreciate your help!