nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
349 stars 115 forks source link

Failed to load Nextcloud Office #2778

Closed schklom closed 1 year ago

schklom commented 1 year ago

Describe the bug Cannot open any document.

To Reproduce Steps to reproduce the behavior:

  1. Try to open a document
  2. "Failed to load Nextcloud Office - please try again later"

Expected behavior The document loads

Client details:

Additional info My Collabora Docker image uses the parameters --o:ssl.enable=false --o:ssl.termination=true, because it is behind a HAProxy (reverse-proxy) that ensures SSL termination. Also, the log includes more errors when I setup notify_push for some reason.

Server details

Operating system: Debian

Web server: Docker image

Database: Postgres

PHP version: 8.1.14

Nextcloud version: 25.0.3

Version of the richdocuments app 7.1.0

Version of Collabora Online 22.05.9.3

Logs #### Nextcloud log (data/nextcloud.log) No log #### Browser log (javascript console) ```log $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 11 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 8 globals.js:60:15 File info for /Cover letter.docx fetched Object { filename: "/Cover letter.docx", basename: "Cover letter.docx", lastmod: "Tue, 01 Nov 2022 00:00:05 GMT", size: 8764, type: "file", etag: null, mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", getlastmodified: "Tue, 01 Nov 2022 00:00:05 GMT", getcontenttype: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", resourcetype: "", … } Viewer.vue:490:18 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 9 globals.js:60:15 OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities capabilities.js:35:9 Content Security Policy: Ignoring “'unsafe-inline'” within script-src: nonce-source or hash-source specified Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive. Content Security Policy: Ignoring “'unsafe-inline'” within script-src: nonce-source or hash-source specified Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14 JQMIGRATE: Migrate is installed, version 3.4.0 jquery-migrate.min.js:2:698 Proxying an event bus of version 2.1.1 with 3.0.2 index.esm.js:11:20 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 session heartbeat polling started session-heartbeat.js:103:9 PostMessageService.sendPostMessage parent loading postMessage.tsx:42:16 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 Waiting for page to render… document.js:229:12 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 PostMessageService.sendPostMessage parent loading postMessage.tsx:42:16 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 oc_appswebroots is deprecated: use OC.appswebroots instead, this will be removed in Nextcloud 20 globals.js:60:15 [getWopiUrl] https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44 url.js:42:9 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 6 globals.js:60:15 Content Security Policy: Ignoring “'unsafe-inline'” within script-src: nonce-source or hash-source specified Content Security Policy: Ignoring “'unsafe-inline'” within script-src: nonce-source or hash-source specified $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:60:15 Content Security Policy: Ignoring “'unsafe-inline'” within script-src: nonce-source or hash-source specified 4 This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. cool.html:107:41 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.whatwg.org/ bundle.js:1:809510 PostMessageService.sendPostMessage loolframe {"MessageId":"Host_PostmessageReady","SendTime":1675040323334,"Values":{}} postMessage.tsx:42:16 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 16 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 missing popover data 2 bundle.js:1:2225569 FAILED Office.vue:202 loadingTimeout Office.vue:202 (Async: setTimeout handler) n Office.vue:201 u Office.vue:71 _invoke Office.vue:71 y Office.vue:71 Ae Office.vue:71 i Office.vue:71 we Office.vue:71 we Office.vue:71 load Office.vue:193 t Office.vue:187 u Office.vue:71 _invoke Office.vue:71 y Office.vue:71 Ae Office.vue:71 i Office.vue:71 (Async: promise callback) Ae Office.vue:71 i Office.vue:71 (Async: promise callback) Ae Office.vue:71 i Office.vue:71 we Office.vue:71 we Office.vue:71 mounted Office.vue:165 VueJS 19 o Viewer.vue:517 u runtime.js:288 _invoke runtime.js:262 C runtime.js:83 Ig Pencil.vue:19 a Pencil.vue:19 Ng Pencil.vue:19 Ng Pencil.vue:19 openFileInfo Viewer.vue:582 r Viewer.vue:491 u runtime.js:288 _invoke runtime.js:262 C runtime.js:83 Ig Pencil.vue:19 a Pencil.vue:19 (Async: promise callback) Ig Pencil.vue:19 a Pencil.vue:19 Ng Pencil.vue:19 Ng Pencil.vue:19 openFile Viewer.vue:471 file Viewer.vue:337 VueJS 5 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 12 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 10 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 [document] editorInitListener: Received post message Object { MessageId: "App_LoadingStatus", Values: {…} } document.js:272:13 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 15 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 14 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 14 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 6 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 10 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 3 globals.js:60:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 13 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 16 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 16 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 16 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 16 globals.js:60:15 No new notification data received NotificationsApp.vue:389 Polling interval updated to 30000 NotificationsApp.vue:421 ``` #### Collabora instance logs (when opening a Nextcloud file) ```log wsd-00001-00153 2023-01-30 18:44:58.096154 +0000 [ docbroker_007 ] ERR No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/Storage.cpp:265 wsd-00001-00153 2023-01-30 18:44:58.097029 +0000 [ docbroker_007 ] ERR loading document exception: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2348 wsd-00001-00153 2023-01-30 18:44:58.098279 +0000 [ docbroker_007 ] ERR Failed to add session to [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44] with URI [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44?access_token=5lynPpN6VzLvVT7Tr33hw733ZxP40XPI&access_token_ttl=1675140296000]: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2310 wsd-00001-00153 2023-01-30 18:44:58.098995 +0000 [ docbroker_007 ] ERR Unauthorized Request while starting session on https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/COOLWSD.cpp:4765 Forced Exit with code: 70 kit-00136-00028 2023-01-30 18:44:58.100274 +0000 [ kit_spare_007 ] FTL Forced Exit with code: 70| common/Util.cpp:1118 wsd-00001-00153 2023-01-30 18:44:58.102252 +0000 [ docbroker_007 ] ERR #24: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1436 wsd-00001-00153 2023-01-30 18:44:58.132031 +0000 [ docbroker_007 ] ERR #22: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1136 wsd-00001-00153 2023-01-30 18:44:58.132456 +0000 [ docbroker_007 ] WRN Unassociated Kit (136) disconnected unexpectedly| wsd/COOLWSD.cpp:3311 kit-00154-00028 2023-01-30 18:44:58.354097 +0000 [ kit_spare_008 ] ERR mknod(/opt/cool/child-roots/UMytlhRhigcHNKPr//tmp/dev/random) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:300 kit-00154-00028 2023-01-30 18:44:58.355329 +0000 [ kit_spare_008 ] ERR mknod(/opt/cool/child-roots/UMytlhRhigcHNKPr//tmp/dev/urandom) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:312 wsd-00001-00171 2023-01-30 18:44:58.537524 +0000 [ docbroker_008 ] ERR No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/Storage.cpp:265 wsd-00001-00171 2023-01-30 18:44:58.538169 +0000 [ docbroker_008 ] ERR loading document exception: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2348 wsd-00001-00171 2023-01-30 18:44:58.539163 +0000 [ docbroker_008 ] ERR Failed to add session to [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44] with URI [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44?access_token=5lynPpN6VzLvVT7Tr33hw733ZxP40XPI&access_token_ttl=1675140296000&permission=edit]: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2310 wsd-00001-00171 2023-01-30 18:44:58.539720 +0000 [ docbroker_008 ] ERR Unauthorized Request while starting session on https://nextcloud.mydomain:58497/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44 for socket #23. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/COOLWSD.cpp:4765 wsd-00001-00171 2023-01-30 18:44:58.540828 +0000 [ docbroker_008 ] ERR #23: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1436 wsd-00001-00171 2023-01-30 18:44:58.568168 +0000 [ docbroker_008 ] ERR #24: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1136 wsd-00001-00171 2023-01-30 18:44:58.568539 +0000 [ docbroker_008 ] WRN Unassociated Kit (154) disconnected unexpectedly| wsd/COOLWSD.cpp:3311 kit-00172-00028 2023-01-30 18:44:58.778872 +0000 [ kit_spare_009 ] ERR mknod(/opt/cool/child-roots/hEPdl0WfcHrI72fv//tmp/dev/random) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:300 kit-00172-00028 2023-01-30 18:44:58.779495 +0000 [ kit_spare_009 ] ERR mknod(/opt/cool/child-roots/hEPdl0WfcHrI72fv//tmp/dev/urandom) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:312 wsd-00001-00183 2023-01-30 18:44:58.891195 +0000 [ docbroker_009 ] ERR No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/Storage.cpp:265 wsd-00001-00183 2023-01-30 18:44:58.892935 +0000 [ docbroker_009 ] ERR loading document exception: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2348 wsd-00001-00183 2023-01-30 18:44:58.894856 +0000 [ docbroker_009 ] ERR Failed to add session to [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44] with URI [https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44?access_token=5lynPpN6VzLvVT7Tr33hw733ZxP40XPI&access_token_ttl=1675140296000&permission=edit]: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/DocumentBroker.cpp:2310 wsd-00001-00183 2023-01-30 18:44:58.896312 +0000 [ docbroker_009 ] ERR Unauthorized Request while starting session on https://nextcloud.mydomain:10000/index.php/apps/richdocuments/wopi/files/2458756_ocdkjjvxzd44 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [nextcloud.mydomain] in config.| wsd/COOLWSD.cpp:4765 wsd-00001-00183 2023-01-30 18:44:58.900544 +0000 [ docbroker_009 ] ERR #24: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1436 wsd-00001-00183 2023-01-30 18:44:58.931554 +0000 [ docbroker_009 ] ERR #22: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1136 wsd-00001-00183 2023-01-30 18:44:58.931978 +0000 [ docbroker_009 ] WRN Unassociated Kit (172) disconnected unexpectedly| wsd/COOLWSD.cpp:3311 kit-00190-00028 2023-01-30 18:44:59.318749 +0000 [ kit_spare_00a ] ERR mknod(/opt/cool/child-roots/qyG7c3JtmnqTjypV//tmp/dev/random) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:300 kit-00190-00028 2023-01-30 18:44:59.319404 +0000 [ kit_spare_00a ] ERR mknod(/opt/cool/child-roots/qyG7c3JtmnqTjypV//tmp/dev/urandom) failed. Mount must not use nodev flag. (EPERM: Operation not permitted)| common/JailUtil.cpp:312 ```
vasyugan commented 1 year ago

do you have the push notify app set up? For me, restarting the push notify service solved it. https://github.com/nextcloud/richdocuments/issues/2707#issuecomment-1368866405

schklom commented 1 year ago

I restarted it, but the problem stayed. Disabling the app also does not help.

The logs above are with that app disabled.

vasyugan commented 1 year ago

I restarted it, but the problem stayed. Disabling the app also does not help.

The logs above are with that app disabled.

Are you using Firefox? I experience the issue only with Firefox, while Chrome based browsers are unaffected.

Also, downgrading the app to version 7.0.2 made Collabora work again in the case of Issue #2781. I should say so, that this specifically is about documents opened via publicly shared links.

schklom commented 1 year ago

Thanks @vasyugan for helping :)

Good idea, I am actually using Firefox. However, I am sad to report that it does not work either on Chromium based browsers. I can capture and share the log again, but I doubt it will be more interesting. I will keep downgrading in mind if I need to share documents, but only after it works. I need to keep it simple for now :P

vasyugan commented 1 year ago

Did it work in the past but has stopped? What is your web server? I assume, your Collabora is behind a reverse proxy (nginx or Apache). Did you double check that its configuration conforms to the latest instructions? Because, AFAIK, there have been changes not long ago. Also, did you test whether it works if you use a different collabora instance?

vasyugan commented 1 year ago

The very first line of you docker log should give you a hint: No acceptable WOPI host found. Did you follow the instruction how to tell docker from which hosts to accept connections?

Please paste the command that you use to start the docker container.

schklom commented 1 year ago

This is my first attempt at using Collabora.

My Collabora Online instance is behind a reverse-proxy (HAProxy), the webGUI works well, and is accessible by the Nextcloud instance.

My Docker does not restrict IPs and the port is correctly forwarded. I am using the same setup for a dozen Docker containers and they are all accessible via HTTPS with no problem.

I am using a LetsEncrypt certificate, so this isn't a self-signing problem.

What other Collabora image should I try? My instance of Collabora is brand new from the Docker image. Here is the docker-compose.yml section

  collabora:
    image: collabora/code
    container_name: collabora
    hostname: collabora
    privileged: true
    environment:
      aliasgroup1: "https://collabora.mydomain:10000"
      username: admin
      password: XXXXXX
      DONT_GEN_SSL_CERT: 1
      extra_params: "--o:ssl.enable=false --o:ssl.termination=true --o:logging.color=true"
    ports:
      # Admin console at https://collabora.mydomain:10000/browser/dist/admin/admin.html
      - 30000:9980
vasyugan commented 1 year ago

"aliasgroup1" should contain the url of your Nextcloud instance. Because that's how collabora knows whether to allow a connection from that host.

vasyugan commented 1 year ago

"aliasgroup1" should contain the url of your Nextcloud instance, not of your collabora instance. Because that's how collabora decides whether to allow a connection from that host.

See here: https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html " \<your-dot-escaped-domain> is the WOPI host, i.e. your preferred File Sync and Share solution that implements WOPI protocol, for example share\.example\.com."

Closing this as this is a configuration error on your side. Please in the future, ask at the Nexcloud forum first.