nextcloud / richdocuments

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

Collabora Online failes to load, when file is share by public link. No errors logged. #622

Closed BjoKaSH closed 4 years ago

BjoKaSH commented 5 years ago

Describe the bug Collabora Online fails to load with message "Failed to load Collabora Online - please try again later" when a user (not logged in) tries to access the file by password protected public share link. The messages appears a few seconds after the dialogue box "Select your Nickname" has appeared. The dialogue box disappears when the messages is shown.

If one is quick enough, one can manage to type a name in the dialogue box and hit enter before the messages appears. Then the pages reloads, but ultimately fails with the same "Failed to load Collabora Online - please try again later".

If one now manually reloads the page, then the document opens in Collabora Online as expected.

For a shared by link file, this "quickly type something in the 'nickname' box, hit enter, wait for error, reload" seems to be the only way to open a file in Collabora online.

For logged-in users, no problem exists, Collabora Online just works as expected.

To Reproduce Steps to reproduce the behaviour:

  1. create an empty folder in NC
  2. upload or create an office document (example here: a LibreOffice Calc document)
  3. share the file (not the folder!) by link: Set a password, enable editing, disable download. Note down / copy the link
  4. log out. Make sure the NC really don't remember you.
  5. Try to access the link
  6. NC will ask for the set password, provide it
  7. NC will start loading, showing a "select your nickname" dialogue after a few seconds
  8. do nothing. do not enter a nickname
  9. After several seconds, the dialogue disappears and a message "Failed to load Collabora Online - please try again later" is briefly shown. Page turns empty (not counting the standard footer)
  10. Try reloading the page (remove the automatically added ?# from the URL before), steps 7 - 9 will repeat. Try several times, if you like.
  11. Try reloading the page, but quickly click the "select nickname" box as soon as it appears, type a character and hit enter. You have (on my box) approx. 3 seconds to do so.
  12. A new page will load, but stay empty. After some seconds a message "Failed to load Collabora Online - please try again later" is briefly shown.
  13. Try reloading the page. The document opens as expected.

Expected behavior

  1. User clicks shared link
  2. NC ask for password
  3. NC ask for nickname
  4. Document loads

Screenshots If applicable, add screenshots to help explain your problem.

Client details:

Server details

Operating system: Ubuntu 16.04 LTS

Web server: apache2

Database: mysql

PHP version: 7.0.33-0ubuntu0.16.04.6

Nextcloud version: 15.0.11.1

Version of the richdocuments app 3.4.1

Version of Collabora Online docker image "recursing_mendel" (updated two weeks ago, 2019-09-10)

Logs #### Nextcloud log (data/nextcloud.log) ``` 22k of commented (segmented according to steps to reproduce) logfile attached. ``` [NC-log-collabora_edited.txt](https://github.com/nextcloud/richdocuments/files/3618291/NC-log-collabora_edited.txt) #### Browser log Javascript console ``` ( tons of CSS errors removed ) JQMIGRATE: Migrate is installed, version 1.4.0 jquery-migrate.min.js:2:542 Waiting for page to render… document.js:147:4 PostMessageService.sendPostMessage parent loading postMessage.tsx:54:2 [getWopiUrl] https://share.my-domain.de/index.php/apps/richdocuments/wopi/files/22765_52c168258a884 url.js:39:1 [viewer] Received post message Object { msgId: "loading", args: undefined, deprecated: undefined } viewer.js:423:2 TypeError: e is null[Weitere Informationen] FilesAppIntegration.js:49:2 Content Security Policy: 'x-frame-options' wird wegen 'frame-ancestors'-Direktive ignoriert. ( tons of css errors ) Synchrone XMLHttpRequests am Haupt-Thread sollte nicht mehr verwendet werden, weil es nachteilige Effekte für das Erlebnis der Endbenutzer hat. Für weitere Hilfe siehe http://xhr.spec.whatwg.org/ bundle.js:22:4770 Unbekannte Eigenschaft 'undefined'. Deklaration ignoriert. loleaflet.html Unbekannte Eigenschaft 'undefined'. Deklaration ignoriert. loleaflet.html Unbekannte Eigenschaft 'undefined'. Deklaration ignoriert. loleaflet.html Unbekannte Eigenschaft 'undefined'. Deklaration ignoriert. loleaflet.html Unbekannte Eigenschaft 'undefined'. Deklaration ignoriert. loleaflet.html Fehler beim Verarbeiten des Wertes für 'max-height'. Deklaration ignoriert. loleaflet.html Fehler beim Verarbeiten des Wertes für 'max-width'. Deklaration ignoriert. loleaflet.html Content Security Policy: 'x-frame-options' wird wegen 'frame-ancestors'-Direktive ignoriert. Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src"). Source: call to eval() or related function blocked by CSP. 567f8f38-1d9f-4ad5-b30c-bf2a70f413fa:27 Fehler beim Verarbeiten des Wertes für 'max-height'. Deklaration ignoriert. loleaflet.html Fehler beim Verarbeiten des Wertes für 'max-width'. Deklaration ignoriert. loleaflet.html [document] editorInitListener: Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } document.js:178:5 PostMessageService.sendPostMessage parent {"MessageId":"App_LoadingStatus","SendTime":1568661587083,"Values":{"Status":"Frame_Ready","Features":{"VersionStates":true}}} postMessage.tsx:54:2 callMobileMessage documentLoaded undefined mobile.js:35:1 [viewer] Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } viewer.js:423:2 PostMessageService.sendPostMessage loolframe {"MessageId":"Host_PostmessageReady","SendTime":1568661587138,"Values":{}} postMessage.tsx:54:2 [document] editorInitListener: Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } document.js:178:5 PostMessageService.sendPostMessage parent {"MessageId":"App_LoadingStatus","SendTime":1568661588079,"Values":{"Status":"Document_Loaded","DocumentLoadedTime":1568661588040}} postMessage.tsx:54:2 PostMessageService.sendPostMessage loolframe {"MessageId":"Hide_Button","SendTime":1568661588194,"Values":{"id":"fullscreen"}} postMessage.tsx:54:2 PostMessageService.sendPostMessage loolframe {"MessageId":"Hide_Menu_Item","SendTime":1568661588194,"Values":{"id":"fullscreen"}} postMessage.tsx:54:2 [document] Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } document.js:229:5 PostMessageService.sendPostMessage parent {"MessageId":"App_LoadingStatus","SendTime":1568661588079,"Values":{"Status":"Document_Loaded","DocumentLoadedTime":1568661588040}} postMessage.tsx:54:2 [document] Unhandled post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } document.js:322:6 [document] Received post message Object { msgId: "View_Added", args: {…}, deprecated: false } document.js:229:5 PostMessageService.sendPostMessage parent {"MessageId":"View_Added","SendTime":1568661588080,"Values":{"ViewId":0,"UserId":"Guest-yo+v9TV/","UserName":"b (Gast)","UserExtraInfo":[],"Color":"#0646a2","ReadOnly":"0"}} postMessage.tsx:54:2 [document] Unhandled post message Object { msgId: "View_Added", args: {…}, deprecated: false } document.js:322:6 [viewer] Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } viewer.js:423:2 Toolbar button with id "fullscreen" not found. bundle.js:51:5180 [viewer] Received post message Object { msgId: "App_LoadingStatus", args: {…}, deprecated: false } viewer.js:423:2 [viewer] Received post message Object { msgId: "View_Added", args: {…}, deprecated: false } viewer.js:423:2 TypeError: this.getFileList(...) is undefined[Weitere Informationen] FilesAppIntegration.js:109:2 Fehler beim Verarbeiten des Wertes für 'max-height'. Deklaration ignoriert. loleaflet.html [document] Received post message Object { msgId: "User_Idle", args: {}, deprecated: false } document.js:229:5 PostMessageService.sendPostMessage parent {"MessageId":"User_Idle","SendTime":1568661650353,"Values":{}} postMessage.tsx:54:2 [document] Unhandled post message Object { msgId: "User_Idle", args: {}, deprecated: false } document.js:322:6 [viewer] Received post message Object { msgId: "User_Idle", args: {}, deprecated: false } viewer.js:423:2 ``` ### Web server log (NC) ``` 27k of commented (segmented according to steps to reproduce) logfile attached. ``` [NC-log-collabora-webserver-NC_edited.txt](https://github.com/nextcloud/richdocuments/files/3618292/NC-log-collabora-webserver-NC_edited.txt) ### Web server log (Reverse Proxy) Note: the reverse proxy log show activity only after setting the nickname and reloading. ``` my-ip-address - - [16/Sep/2019:22:11:08 +0200] "POST /loleaflet/79f3ef2/loleaflet.html?WOPISrc=https%3A%2F%2Fshare.my-domain.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F22765_52c168258a884&title=my-test-file.ods&lang=de&closebutton=1&revisionhistory=1 HTTP/1.1" 200 6233 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:08 +0200] "GET /loleaflet/79f3ef2/bundle.css HTTP/1.1" 200 53877 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:08 +0200] "GET /loleaflet/79f3ef2/branding.css HTTP/1.1" 200 1177 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:08 +0200] "GET /loleaflet/79f3ef2/branding.js HTTP/1.1" 200 933 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:08 +0200] "GET /loleaflet/79f3ef2/bundle.js HTTP/1.1" 200 481790 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:10 +0200] "GET /loleaflet/79f3ef2/l10n/uno-localizations.json HTTP/1.1" 200 1220 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/uno/de.json HTTP/1.1" 200 4444 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/help-localizations.json HTTP/1.1" 200 1205 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/help-de.json HTTP/1.1" 200 4462 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/locore-localizations.json HTTP/1.1" 200 1259 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/locore/de.json HTTP/1.1" 200 7255 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/localizations.json HTTP/1.1" 200 1187 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/ui-de.json HTTP/1.1" 200 6193 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:12 +0200] "GET /loleaflet/79f3ef2/l10n/uno-localizations-override.json HTTP/1.1" 200 597 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:13 +0200] "GET /loleaflet/79f3ef2/l10n/uno/de-override.json HTTP/1.1" 200 557 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" my-ip-address - - [16/Sep/2019:22:11:13 +0200] "GET /lool/https%3A%2F%2Fshare.my-domain.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F22765_52c168258a884%3Faccess_token%3DKLdLLSHAkxaYY0D6pKhJmObMk5w5Wqk7%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2Fshare.my-domain.de%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F22765_52c168258a884&compat=/ws HTTP/1.1" 200 967902 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" ```

Feel free to ask if you need further information.

BjoKaSH commented 5 years ago

One more detail: I tried to find the last working version by bisecting versions from 2.0.10 to 3.4.1. Last working version of richdocuments app is v3.3.12. Version v3.3.13 does not work.

Within version v3.3.13 the last working commit is 8bc4166 (Do not reload files list on initial load), first non-working is ea430b5 (Remove additional check call and show error if no collabora loaded after 15s). However, it is no clear to me, if the added timeout check just reveals an other problem, or if the logic behind the test is in itself broken.

If I find time, I'll try to investigate a bit deeper next weekend.

pelaxa commented 5 years ago

Having the exact same issue here. I share a link for editing with no password set on it. Still happens on NC17 and I do see an error in the logs:

{"reqId":"3uBr9ajuw9KZYxoGO5gB","level":0,"time":"2019-10-08T11:40:00+00:00","remoteAddr":"172.25.0.2","user":"--","app":"core","method":"GET","url":"\/index.php\/apps\/richdocuments\/ajax\/settings.php","message":{"Exception":"OC\\AppFramework\\Middleware\\Security\\Exceptions\\NotLoggedInException","Message":"Current user is not logged in","Code":401,"Trace":[{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Middleware\/MiddlewareDispatcher.php","line":95,"function":"beforeController","class":"OC\\AppFramework\\Middleware\\Security\\SecurityMiddleware","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\SettingsController"},"getSettings"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":97,"function":"beforeController","class":"OC\\AppFramework\\Middleware\\MiddlewareDispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\SettingsController"},"getSettings"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\SettingsController"},"getSettings"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Richdocuments\\Controller\\SettingsController","getSettings",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"richdocuments.settings.getSettings"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"richdocuments.settings.getSettings"}]},{"file":"\/var\/www\/html\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"richdocuments.settings.getSettings"}]},{"file":"\/var\/www\/html\/lib\/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/richdocuments\/ajax\/settings.php"]},{"file":"\/var\/www\/html\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/var\/www\/html\/lib\/private\/AppFramework\/Middleware\/Security\/SecurityMiddleware.php","Line":135,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/13.0.1 Safari\/605.1.15","version":"17.0.0.9"}

vpecinka commented 5 years ago

I have the same issue. On public link to some users it does not work - but if they use anonymous browser window, it works great. I think there is some collision between public link and logged user session.

However, for me as creator of the link (and logged user) it works fine. For the others - they need to open public link in an anonymous browser window.

The log says in such case: Undefined index: userId at \/www\/nextcloud\/apps\/richdocuments\/templates\/documents.php#8

vpecinka commented 5 years ago

To some users it started to work when I patched documents.php:

--- documents.orig.php  2019-10-31 13:18:11.000000000 +0100
+++ documents.php   2019-10-31 13:19:09.000000000 +0100
@@ -5,7 +5,7 @@
    var richdocuments_token = '<?php p($_['token']) ?>';
    var richdocuments_urlsrc = '<?php p($_['urlsrc']) ?>';
    var richdocuments_path = '<?php p($_['path']) ?>';
-   var richdocuments_userId = '<?php p($_['userId']) ?>';
+   var richdocuments_userId = <?php isset($_['userId']) ? print_unescaped('\'' . \OCP\Util::sanitizeHTML($_['userId']) . '\'') : print_unescaped('null') ?>;
    var richdocuments_instanceId = '<?php p($_['instanceId']) ?>';
    var richdocuments_canonical_webroot = '<?php p($_['canonical_webroot']) ?>';
    var richdocuments_directEdit = <?php isset($_['direct']) ? p('true') : p('false') ?>;

However, to some users still not working and the error arises elsewhere in richdocuments/lib/Controller/WopiController.php#609

Need to mention, the files are stored in the Swift storage and works fine :)

{"reqId":"5LFlzAeM9cwntT78xGVG","level":3,"time":"2019-11-04T11:46:10+00:00","remoteAddr":"10.66.207.20","user":"--","app":"PHP","method":"GET","url":"\/index.php\/apps\/richdocuments\/wopi\/files\/38330941_ocdn3mtk0j94?access_token=--removed--&access_token_ttl=0&reuse_cookies=nc_sameSiteCookielax%3Dtrue%3Anc_sameSiteCookiestrict%3Dtrue%3A__Host-nc_sameSiteCookielax%3Dtrue%3A__Host-nc_sameSiteCookiestrict%3Dtrue%3Alps%3D--removed--%3Aajs_user_id%3D%22qtcx6qe67jbnxqub565t7e99oa%22%3Aajs_group_id%3Dnull%3Aajs_anonymous_id%3D%2200000000000000000000000000%22%3A__gfp_64b%3D6wcqseFxlSO3LZQCrhUeGl4jd3WRU_lODuwMRJe1LZ3.r7%3Anc_username%3D39DEC6BF-105B-40BD-AF59-666083E7DF4E%3Anc_token%3DV5YzfnnnhMftgQbXY5zERsUIYf5ByaqP%3Anc_session_id%3D94688--removed--6e19e%3Aoc_sessionPassphrase%3DJU6--removed--Yj%2BJ1NY7--removed--UOUX%2BFSg%2BKmJZEIHd--removed--%3Aocdn3mtk0j94%3D94--removed--e19e&permission=edit","message":"Undefined offset: 0 at \/www\/nextcloud\/apps\/richdocuments\/lib\/Controller\/WopiController.php#609","userAgent":"LOOLWSD WOPI Agent 4.0.8","version":"16.0.5.1"}
vpecinka commented 5 years ago

In 3.4.3 the problem is still here. I focused on cookies because in anonymous browser window the error does not exist. Maybe it helps @juliushaertl

  1. as logged regular user I have two cookies: nc_session_id and <instanceid> (instanceid as in config.php) both containing the same value (let's say XXX). The document on public link does not load, ending with error.

  2. if I log out regular user, the nc_session_id cookies disappears and the cookie <instanceid> contains different value (let's say YYY). Now the document on public link works.

  3. However, if I am logged as in the 1st example and simply delete nc_session_id cookie and leaving <instanceid> with XXX (value of logged user) - the document does not loads.

  4. If I delete <instanceid> only, it also does not work - a cookie with the same name and value of XXX appears after reload.

The problem does not exist on the public link I create and try to use. I guess the XXX value of the logged user (or valid session) somehow interfere with user id owning the shared file?

juliusknorr commented 4 years ago

In 3.4.3 the problem is still here. I focused on cookies because in anonymous browser window the error does not exist

@vpecinka Any change you could try 3.4.4? I could not reproduce the issue neither with or without being logged in. Maybe you can share the error message to the error you mention in richdocuments/lib/Controller/WopiController.php#609

vpecinka commented 4 years ago

I will try it in the evening. Did you try to load file provided by someone else? If you try to access file via public link you created itself, it works. But not if created by someone else.

In 3.4.3 I got no error in nextcloud.log file, it has been mitigated. The rich document app still says (in Czech, so no exact phrase in English :): Cannot load the document. Please contact the administrator of your storage.

I caught the following error on LOOL side: (sensitive info removed, however in the uri is my logged username nc_username, so probably other parameters are also valid for logged user):

wsd-00027-04084 2019-11-11 09:02:59.421399 [ docbroker_0ca ] ERR  WOPI::CheckFileInfo failed with 403 Forbidden| wsd/Storage.cpp:495
wsd-00027-04084 2019-11-11 09:02:59.421875 [ docbroker_0ca ] ERR  loading document exception: WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1186
wsd-00027-04084 2019-11-11 09:02:59.421931 [ docbroker_0ca ] ERR  Failed to add session to [/index.php/apps/richdocuments/wopi/files/26586126_ocdn3mtk0j94] with URI [https://central.szn.cz/index.php/apps/richdocuments/wopi/files/26586126_--removed--?access_token=--removed--&access_token_ttl=0&reuse_cookies=guestUser%3DVP%3Anc_session_id%3D--removed--%3Anc_token%3D--removed--%3Anc_username%3--removed--%3Aoc_sessionPassphrase%3DQ--removed--SY%2FzNe--removed--YAiV%3A--removed--%--removed--%3Alps%--removed-----removed---c---removed-----removed-----removed-----removed--.3G7ZiEs3q-HEt42Ot4-ZJ5eX9Ws%3Alsds%--removed-----removed--%3A__gfp_64b%--removed--.L7%3A__Host-nc_sameSiteCookielax%3Dtrue%3A__Host-nc_sameSiteCookiestrict%3Dtrue&permission=edit]: WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1148
wsd-00027-04084 2019-11-11 09:02:59.422295 [ docbroker_0ca ] WRN  Child session [35f] not found to forward message: load url=https://central.szn.cz/index.php/apps/richdocuments/wopi/files/--removed--?access_token=--removed--&access_token_ttl=0&reuse_cookies=guestUser%3DVP%3Anc_session_id%--removed--%3Anc_token%--removed--%3Anc_username%--removed--%3Aoc_sessionPassphrase%--removed--%--removed--%3Aocdn3...| wsd/DocumentBroker.cpp:1802
wsd-00027-04084 2019-11-11 09:02:59.510245 [ docbroker_0ca ] ERR  Invalid or unknown session [35f] to remove.| wsd/DocumentBroker.cpp:1222
kit-04052-00029 2019-11-11 09:03:01.424366 [ kit_spare_0c9 ] WRN  Setting TerminationFlag due to 'exit' command from parent.| kit/Kit.cpp:2074
wsd-00027-00028 2019-11-11 09:03:01.424469 [ prisoner_poll ] WRN  Prisoner connection disconnected but without valid socket.| wsd/LOOLWSD.cpp:1807
kit-04052-00029 2019-11-11 09:03:01.424635 [ kit_spare_0c9 ] WRN  Kit connection lost without exit arriving from wsd. Setting TerminationFlag| kit/Kit.cpp:2110
vpecinka commented 4 years ago

@vpecinka Any change you could try 3.4.4? I could not reproduce the issue neither with or without being logged in. Maybe you can share the error message to the error you mention in richdocuments/lib/Controller/WopiController.php#609

Tried 3.4.4, still not working. Reproducible steps:

  1. logged as user A create public link (editing allowed) and copy that link to clipboard
  2. log out and log in as user B
  3. enter public link from step 1 to the browser
  4. error occurs
  5. log out user B and enter public link again
  6. everything works well

Tried also NC 16.0.6 + rich documents 3.4.4, storage is Swift.

mikshepard commented 4 years ago

We are experiencing the same issue, on our production server and test server with Nextcloud 16.0.5 and rich documents 3.4.4, using local storage.

Happy to test any solutions or ideas on this.

vpecinka commented 4 years ago

I also noticed, that in the top menu bar, where currently cooperating users on one particular document are displayed, there is mix of different users from different documents.

I shared a document X to the user A via public link - user opened the document. I also opened the document, but directly from my storage. Then I left and opened another document Y. However, I can see the user A among the participating users (the LOOL admin console says that he is not viewing that file Y as well).

juliusknorr commented 4 years ago

https://github.com/nextcloud/richdocuments/pull/700 Should fix this. Testing is very welcome.

vpecinka commented 4 years ago

700 Should fix this. Testing is very welcome.

I applied patch to my running 3.4.4 version and works great! Thanks @juliushaertl

vpecinka commented 4 years ago

Hi, this issue is back when I upgraded to NC 17.0.3 with richdocuments 3.5.2

Steps to reproduce

  1. login as an user, create public link to a office file
  2. logout such a user and log in as another one and keep logged in
  3. use the public link

The document cannot be loaded, in the nextcloud's log is nothing but HTTP 403 is returned:

10.75.139.137 - - [05/Feb/2020:10:45:38 +0100] "GET /index.php/apps/richdocuments/wopi/files/32693_<sensitive>?access_token=<sensitive>&access_token_ttl=0 HTTP/1.0" 403 2 "-" "LOOLWSD WOPI Agent 4.2.0" "-"

When logged out completely or logged in as the owner of the file under public link, it works.

vpecinka commented 4 years ago

For complete context - I upgraded from 16.0.6 to 17.0.3

juliusknorr commented 4 years ago

Hm, too bad, thanks for reporting. I'll look into it

vpecinka commented 4 years ago

I think here:

https://github.com/nextcloud/richdocuments/blob/bbc3a31a30bcd482f6fe86a1167393ef1e4e19dc/lib/Controller/WopiController.php#L660

should be $userFolder = $this->rootFolder->getUserFolder($wopi->getOwnerUid()); as under public link we need to access owners folder(?)

Or the guest detection doesn't work properly, as

var_dump($wopi->getGuestDisplayname());
echo("\n");
var_dump($wopi->isGuest());

gets in my case

NULL

bool(false)

Maybe there can be guests with no nickname (at least I'm not asked to enter guest name).

Commifreak commented 3 years ago

This is still an issue with:

Any progress here?

eBug commented 2 years ago

This is also an issue with NC 23.0.0 and Collabora Office 6.4-50 (git hash: d53ee72), when I share a public link to a folder, anonymous users can't create or edit documents online.

quentinDupont commented 2 years ago

@eBug it's the same issue here : https://github.com/nextcloud/richdocuments/issues/1914