nextcloud / richdocuments

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

Collabora 21.11.4.3 not working with richdocuments 5.0.5 #2248

Closed jejo86 closed 1 year ago

jejo86 commented 2 years ago

Describe the bug Cannot open any file after automatic updates. Opening any file takes a long while and ends in Document loading failed Nextcloud Office could not be loaded - Please try again later (freely translated from German)

Before the automatic updates, it used to work.

To Reproduce Try to open any .ods or .odt file.

Expected behavior The files should open.

Screenshots Loading Failed_Loading

Client details: Independent of client (Android, Windows 10, Linux Mint 20.3) and using the latest Firefox.

Server details

Operating system: AlmaLinux 8.6 (Sky Tiger) Kernel: Linux 4.18.0-372.9.1.el8.x86_64 Architecture: x86-64

Web server: Apache 2.4.37

Database: Ver 15.1 Distrib 10.3.32-MariaDB

PHP version: PHP 8.0.19

Nextcloud version: 23.0.4.1

Version of the richdocuments app 5.0.5

Version of Collabora Online Coolwsd 21.11.4.3

Logs [log_1.txt](https://github.com/nextcloud/richdocuments/files/8780943/log_1.txt) #### Nextcloud log (data/nextcloud.log) EMPTY! (Level 2 - Warnings)
juliushaertl commented 2 years ago

Mai 26 19:10:13 coolwsd[368072]: wsd-368072-368108 2022-05-26 19:10:13.165221 +0200 [ docbroker_001 ] WRN #30 has timed out while requesting [GET /index.php/apps/richdocuments/wopi/files/62993_ocar9eya3hy1?access_token=EfReoDEeUDzgfaUMs6SnSf5eHNGglRaf&access_token_ttl=0] after 30016ms| net/HttpRequest.hpp:1295

Seems there was a timeout when Collabora tried to request the Nextcloud server, so maybe you can check your setup if there is any issue with that, e.g. with trying to request the server manually using curl.

jejo86 commented 2 years ago

I selected a different file (URL is now different), copied the URL and used curl: <NEXTCLOUD_URL>/index.php/apps/richdocuments/wopi/files/69613_ocar9eya3hy1?access_token=J5Q3omSSMxt3WVoKtamqxr50pEiFqsnb&access_token_ttl=0

I received the following reply:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://<NEXTCLOUD_URL>/index.php/apps/richdocuments/wopi/files/69613_ocar9eya3hy1?access_token=J5Q3omSSMxt3WVoKtamqxr50pEiFqsnb">here</a>.</p>
</body></html>

I cannot identify whether the problem comes from richdocuments or Collabora, which, by the way updated yesterday to:

Letzte Prüfung auf abgelaufene Metadaten: vor 1:31:08 am Sa 28 Mai 2022 11:17:19 CEST.
Installierte Pakete
Name         : coolwsd
Version      : 21.11.5.1
Release      : 1.el8
Architecture : x86_64
Size         : 39 M
Quelle       : coolwsd-21.11.5.1-1.el8.src.rpm
Repository   : @System
Aus Paketque : collaboraoffice.com_repos_CollaboraOnline_CODE-centos8
Summary      : Collabora Online WebSocket Daemon
Lizenz       : EULA
Description  : 

I merged the config files, but the problem persists.

What I found interesting, is that the preview is working. I uploaded a new file Test.odt, with the content

TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

Selecting the Details view, I can see the preview of the text: Preview_Working

So the connection cannot be completely messed up, right?!

How can I verify, that the URL richdocuments is generating, is actually a correct one?

EricMaGo commented 2 years ago

I have the same problem! Any hint on how to solve it?

timparker14 commented 2 years ago

I have the same issue with a dockerless (standalone) CODE server. Nextcloud integration fails after the latest CODE server update. I still get the green tick in the nextcloud settings but documents fail to load.

timparker14 commented 2 years ago

RE: https://github.com/CollaboraOnline/online/issues/4828. Removing the WOPI host on the CODE server worked for me

jejo86 commented 2 years ago

I do not have the argument --o:storage.wopi.host[0]=nextcloud.mydomain.de in my service file /usr/lib/systemd/system/coolwsd.service:

ExecStart=/usr/bin/coolwsd --version --o:sys_template_path=/opt/cool/systemplate --o:child_root_path=/opt/cool/child-roots --o:file_server_root_path=/usr/share/coolwsd

The respective part in my coolwsd.xml looks like this

<storage desc="Backend storage">
        <filesystem allow="false"/>
        <wopi desc="Allow/deny wopi storage." allow="true">
            <max_file_size desc="Maximum document size in bytes to load. 0 for unlimited." type="uint">0</max_file_size>
            <locking desc="Locking settings">
                <refresh desc="How frequently we should re-acquire a lock with the storage server, in seconds (default 15 mins) or 0 for no refresh" type="int" default="900">900</refresh>
            </locking>

            <alias_groups desc="default mode is 'first' it allows only the first host when groups are not defined. set mode to 'groups' and define group to allow multiple host and its aliases" mode="first">
            <!-- If you need to use multiple wopi hosts, please change the mode to "groups" and
                    add the hosts below.  If one host is accessible under multiple ip addresses
                    or names, add them as aliases. -->
            <!--<group>
                    <host desc="hostname to allow or deny." allow="true">scheme://hostname:port</host>
                    <alias desc="regex pattern of aliasname">scheme://aliasname1:port</alias>
                    <alias desc="regex pattern of aliasname">scheme://aliasname2:port</alias>
            </group>-->
            <!-- More "group"s possible here -->
            </alias_groups>

        </wopi>

Setting <wopi desc="Allow/deny wopi storage." allow="false"> has no effect.

audelorAd commented 2 years ago

I have the same issue too. I'm using Nextcloud Office with an "Integrated CODE Server" with the following version :

I saw the trick below from @timparker14 , but how can I remove WOPI host on an Integrated CODE Server ?

RE: CollaboraOnline/online#4828. Removing the WOPI host on the CODE server worked for me

jejo86 commented 2 years ago

I noticed an update of coolwsd to version 21.11.5.3 fixed the problem, without changing richdocuments or changing any settings.

I guess I should have created the issue in the CollaboraOnline/online repository...

jejo86 commented 2 years ago

Again it is not working after some updates, without changing any settings :(. My setup is frustratingly unstable...

jejo86 commented 2 years ago

Correction of Previous Post

@juliushaertl: Regarding your suggestion

Mai 26 19:10:13 coolwsd[368072]: wsd-368072-368108 2022-05-26 19:10:13.165221 +0200 [ docbroker_001 ] WRN #30 has timed out while requesting [GET /index.php/apps/richdocuments/wopi/files/62993_ocar9eya3hy1?access_token=EfReoDEeUDzgfaUMs6SnSf5eHNGglRaf&access_token_ttl=0] after 30016ms| net/HttpRequest.hpp:1295

Seems there was a timeout when Collabora tried to request the Nextcloud server, so maybe you can check your setup if there is any issue with that, e.g. with trying to request the server manually using curl.

to use curl. In my previous post I had forgotten to prepend https://, which is why I got the 301 Moved Permanently message.

This time I did it right

curl https://<NEXTCLOUD_URL>/index.php/apps/richdocuments/wopi/files/69734_ocar9eya3hy1?access_token=yuZLJmKCvcmDURSlKnzUGpxMRDv7jl85&access_token_ttl=0

and got the following JSON string:

{"BaseFileName":"Test2.odt","Size":4537,"Version":"0","UserId":"<USER_ID>","OwnerId":"<USER_ID>","UserFriendlyName":"<FIRST_NAME> <LAST_NAME>","UserExtraInfo":{"avatar":"https:\/\/<NEXTCLOUD_URL>\/index.php\/avatar\/<USER_ID>\/32","is_admin":true},"UserCanWrite":true,"UserCanNotWriteRelative":false,"PostMessageOrigin":"https:\/\/<NEXTCLOUD_URL>\/","LastModifiedTime":"2022-06-01T06:29:43.000000Z","SupportsRename":true,"UserCanRename":true,"EnableInsertRemoteImage":true,"EnableShare":true,"HideUserList":"","DisablePrint":false,"DisableExport":false,"DisableCopy":false,"HideExportOption":false,"HidePrintOption":false,"DownloadAsPostMessage":false}

What surprises me, is that at times my setup is working and then some system and nextcloud updates are installed and collabora is not working anymore.

Any further help how to debug this problem is much appreciated.

jejo86 commented 2 years ago

Currently it is working again for some reason. I increased the verbosity to DEBUG and noticed the following entry in the coolwsd log (journalctl -fe -u coolwsd):

Jul 12 20:53:37 <HOST_NAME> coolwsd[368398]: wsd-368398-368423 2022-07-12 20:53:37.215829 +0200 [ websrv_poll ] INF  URL [https://<NEXTCLOUD_URL>/index.php/apps/richdocuments/wopi/files/69734_ocar9eya3hy1?access_token=X1LjRs5ZuGWzIohvXf7AzxSx3ooUGBX5&access_token_ttl=0] for WS Request.| wsd/COOLWSD.cpp:4358

The https:// is correctly prepended to the link! If you check my posts above you will notice the protocol is missing completely. It starts directly with the <NEXTCLOUD_URL>:

[GET <NEXTCLOUD_URL>/index.php/apps...

If the https:// is missing, the connection apparently defaults to http:// and then my Apache server shows the 301 Moved Permanently error, pointing to the exact same link, with https:// prepended.

I want to have my Nextcloud setup with https:// of course. The question remains, who generates this link and why is it sometimes correctly prepended with https:// and sometimes not?

jejo86 commented 1 year ago

My setup has been working well for over two month now. I guess this eventually got fixed over time with the diverse updates of the richdocuments app and/or coolwsd package.