Hi. I have installed Collabora Online integrated with NextCloud (i give more details at the bottom).
While some times it works perfectly and I can open any document, at other moments it waits spinning for some seconds and then it gives an error message. I haven’t been able to identify a pattern of working or failing, although it seems to work better when i’m alone, and fail more when there are other persons using the platform.
(it means “an error occurred when connecting to the document, please retry”).
In the docker logs i see nothing interesting (there are some warnings, but they are the same when it works or it fails). But in the javascript message i see this error when it fails:
VM1572:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at PostMessageReadyListener (loleaflet.html?WOPISrc=https%3A%2F%2Fcloud.kaleidos.net%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F259…:14)
PostMessageReadyListener @ VM1984 loleaflet.html?WOPISrc=https%3A%2F%2Fcloud.kaleidos.net%2Fapps%2Frichdocuments%2Fwopi%2Ffile…:14
The decoded url is loleaflet.html?WOPISrc=https://cloud.kaleidos.net/apps/richdocuments/wopi/files/263_ocmltpgb8sjn&title=EBC-Informe-1.doc&lang=es&closebutton=1&revisionhistory=1
When pausing it with Chrome devtools, i get that the error occurs in this code:
// Start listening for Host_PostmessageReady message and save the
// result for future
window.WOPIpostMessageReady = false;
var PostMessageReadyListener = function(e) {
var msg = JSON.parse(e.data);
if (msg.MessageId === 'Host_PostmessageReady') {
window.WOPIPostmessageReady = true;
window.removeEventListener('message', PostMessageReadyListener, false);
}
};
window.addEventListener('message', PostMessageReadyListener, false);
I think the statement with error is the JSON.parse(e.data). If I display the content of “e” I get
MessageEvent
bubbles: false
cancelBubble: false
cancelable: false
composed: false
currentTarget: Window
data: Object
name: "started"
target: "extension"
timestamp: 1486037999644
__proto__: Object
(...)
defaultPrevented: false
eventPhase: 2
isTrusted: true
lastEventId: ""
origin: "https://cloud.kaleidos.net"
path: Array[1]
ports: Array[0]
(...)
It seems that the problem is the “data” attribute of the event is not a JSON-encoded string, but a decoded javascript object.
I cannot dig any further, I don’t understand this code, nor do i know where the event comes from, or why the data is already decoded. Also don’t know why some times it works and others fails, even with the same documents, users and browser. Any clue of how may I continue tracing the failure?
This is my system setup with more detail:
- NextCloud 11.0.1
- Collabora/code docker image, tag latest from 4 weeks ago (image id 833435740816)
- Reverse proxy in the same machine with nginx as explained in https://icewind.nl/entry/collabora-online/
- Another proxy in a fontal machine, also with nginx, that is in charge of the SSL certificates.
Thanks in advance.