owncloud / richdocuments

:notebook_with_decorative_cover: Collabora Online for ownCloud
116 stars 54 forks source link

Documents not loading since 4.1.0 #533

Open cs35-owncloud opened 6 months ago

cs35-owncloud commented 6 months ago

Hello,

I had an issue with richdocuments that could not load documents a few weeks ago that's explained in this issue, it seems to have been fixed in 4.1.0.

I upgraded my ownCloud instances to 10.13.0 and richdocuments to 4.1.0, and now documents are still not loading and I don't have any logs on the collabora instance to understand what could be causing this issue.

ownCloud: 10.13.0 richdocuments: 4.1.0

My ownCloud server and my collabora server are on several machine. My collabora server is behind an HAProxy. Any time I try to open a file with collabora, my ownCloud server returns me an http 302 code, it doesn't seem to even reach my HAProxy server. Here's the log of my NGinx ownCloud server:

xxx.xxx.xxx.xxx - - [18/Dec/2023:08:28:49 +0100] "GET /index.php/apps/richdocuments/documents.php/index?fileId=7528494&dir=%2F HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"

If I log to my Collabora server's admin page, I see no statistics whatsoever about any documents, but at least the admin is UP which makes me think that there's a communication problem between my ownCloud instance and my collabora instance.

I changed nothing on my configuration wether it's on the ownCloud server, the collabora server or the HAProxy, I just updated the softwares.

I'm not sure if I gave enough relevant informations about this problem, feel free to give my any pointers to improve. Thanks.

MalkmusT commented 6 months ago

i'm facing a similar problem.

On my setup both owncloud and collabora ar hosted on the same machine, installed versions are:

ownCloud: 10.13.4.1 richdocuments: 4.1.0 collabora: 23.05.6

Opening a file results in an HTTP 500 internal Server error:

xxx.xxx.xxx.xxx - - [28/Dec/2023:12:07:17 +0100] "GET /apps/richdocuments/documents.php/index?fileId=18033&dir=%2F HTTP/1.1" 500 6914 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0" "-"

The correcspondin Owncloud Error Message is:

{
"reqId":"A77n4jjDhuRdM9Wri7Hs",
"level":3,
"time":"2023-12-28T11:07:17+00:00",
"remoteAddr":"xxx.xxx.xxx.xxx",
"user":"XXXX",
"app":"index",
"method":"GET",
"url":"\/apps\/richdocuments\/documents.php\/index?fileId=18033&dir=%2F",
"message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"The requested uri(\\\/apps\\\/richdocuments\\\/documents.php\\\/index) cannot be processed by the script '\\\/index.php\\\/apps\\\/richdocuments\\\/documents.php')\",\"Code\":0,\"Trace\":\"#0 \\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/lib\\\/kernel.php(860): OC\\\\AppFramework\\\\Http\\\\Request->getRawPathInfo()\\n#1 \\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/index.php(32): OC::handleRequest()\\n#2 {main}\",\"File\":\"\\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Request.php\",\"Line\":666}"
}

Note /usr/share/nginx/html/wolke is the owncloud base dir and owncloud is one hour off... (i think i should fix this some time)

I can not find any corresponding access to the collabora instance.

Let me know if i should perform some tests or further information for debuging is needed.

cs35-owncloud commented 5 months ago

Hello,

so far it's still not working with richdocuments 4.1.0 and the latest collabora 23.05.6.5.1. To have it working I had to use richdocuments 3.0.0 and collabora 22.05.6.1.1.

pako81 commented 5 months ago

Can you please try https://github.com/owncloud/richdocuments/pull/535 out and report back? Thx.

pako81 commented 5 months ago

It is also recommended to apply following core fix https://github.com/owncloud/core/pull/41161

MalkmusT commented 5 months ago

Thanks @pako81 for the reply, I did the suggested changes manually:

apps/richdocuments/lib/AppInfo/Application.php

                                                'href' => $container->query('ServerContainer')->getURLGenerator()->linkToRoute('richdocuments.Document.index'),

core/Controller/AppRegistryController.php

                if ($app_name === 'richdocuments') {
                        $link = $this->generator->linkToRoute('richdocuments.Document.index', [
                                'fileId' => $fileId
                        ]);
                if ($link !== '') {
                                $uri = $this->generator->getAbsoluteUrl($link);
                        } else {
                                $uri = $this->generator->linkToRouteAbsolute('richdocuments.document.index', ['fileId' => $fileId]);
                        }
                } 

Resulting in the same error as befor :

{
"reqId":"7YJWWjOR6BQqua5TtI9s",
"level":3,
"time":"2024-01-25T06:44:44+01:00",
"remoteAddr":"xx.xx.xx.xx",
"user":"XXXX",
"app":"index",
"method":"GET","url":"\/apps\/richdocuments\/documents.php\/index?fileId=14357&dir=%2F",
"message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"The requested uri(\\\/apps\\\/richdocuments\\\/documents.php\\\/index) cannot be processed by the script '\\\/index.php\\\/apps\\\/richdocuments\\\/documents.php')\",\"Code\":0,\"Trace\":\"#0 \\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/lib\\\/kernel.php(860): OC\\\\AppFramework\\\\Http\\\\Request->getRawPathInfo()\\n#1 \\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/index.php(32): OC::handleRequest()\\n#2 {main}\",\"File\":\"\\\/usr\\\/share\\\/nginx\\\/html\\\/wolke\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Request.php\",\"Line\":666}"
}
voodoovood commented 4 months ago

The same here, Clean installation, owncloud and collabora.

cs35-owncloud commented 3 months ago

Hello, a little head's UP. I tried again with richdocuments 4.2.0 and collabora code 23.05.9.4.1, sadly documents still won't load.

T0mWz commented 2 months ago

@voodoovood & @cs35-owncloud , what happend when you remove the &dir part from your URL? I think the richdocuments app tried to use that path, but should only check the fileid.

I guess the issue is here; https://github.com/owncloud/richdocuments/blob/master/lib/DocumentService.php#L144 When a dir is specified, then it tries to lookup the document in that specific directory. However when I have shared a document that is for my account in Folder A, but due to sharing it ends up in the Root of the other user, the path to the document is not the same. So when I share the URL from the browser to collaborate on the same document, that will not work. Unless you omit the dir part and just look at the file ID.

iasdeoupxe commented 2 months ago

Noticed the same today on the following system:

Initially i received the following mentioned error:

{"reqId":"removed",
"level":3,
"time":"removed",
"remoteAddr":"removed",
"user":"removed",
"app":"index",
"method":"GET",
"url":"\/apps\/richdocuments\/documents.php\/index?fileId=removed&dir=%2F",
"message":"Exception: {
\"Exception\":\"Exception\",
\"Message\":\"The requested uri(\\\/apps\\\/richdocuments\\\/documents.php\\\/index) cannot be processed by the script '\\\/index.php\\\/apps\\\/richdocuments\\\/documents.php')\",
\"Code\":0,
\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/kernel.php(872): OC\\\\AppFramework\\\\Http\\\\Request->getRawPathInfo()\\n#1 \\\/var\\\/www\\\/owncloud\\\/index.php(32): OC::handleRequest()\\n#2 {main}\",
\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Request.php\",
\"Line\":666}"}

which changes to the following after trying the previous suggestion to remove the &dir part from the URL (an internal server error is still shown and no documents showing up):

{"reqId":"removed",
"level":3,
"time":"removed",
"remoteAddr":"removed",
"user":"removed",
"app":"index",
"method":"GET",
"url":"\/apps\/richdocuments\/documents.php\/index?fileId=removed",
"message":"Exception: {
\"Exception\":\"Exception\",
\"Message\":\"The requested uri(\\\/apps\\\/richdocuments\\\/documents.php\\\/index) cannot be processed by the script '\\\/index.php\\\/apps\\\/richdocuments\\\/documents.php')\",
\"Code\":0,
\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/kernel.php(872): OC\\\\AppFramework\\\\Http\\\\Request->getRawPathInfo()\\n#1 \\\/var\\\/www\\\/owncloud\\\/index.php(32): OC::handleRequest()\\n#2 {main}\",
\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Request.php\",
\"Line\":666}"}

and the only difference in the log is the following:

--- <unnamed>
+++ <unnamed>
@@ -5,7 +5,7 @@
 "user":"removed",
 "app":"index",
 "method":"GET",
-"url":"\/apps\/richdocuments\/documents.php\/index?fileId=removed&dir=%2F",
+"url":"\/apps\/richdocuments\/documents.php\/index?fileId=removed",
 "message":"Exception: {
 \"Exception\":\"Exception\",
 \"Message\":\"The requested uri(\\\/apps\\\/richdocuments\\\/documents.php\\\/index) cannot be processed by the script '\\\/index.php\\\/apps\\\/richdocuments\\\/documents.php')\",