0
Under review

OnlyOffice Error "The document could not be saved"

Matt V 4 months ago updated 3 months ago 4

I'm seeing the following error when trying to edit documents with OnlyOffice. This is happening after upgrading to latest version of OnlyOffice.

Image 1241

The OnlyOffice logs show the following at the time of attempting to open the document:

root@File:tail -20 /var/log/onlyoffice/documentserver/docservice/out.log

[2022-10-24T12:43:05.218] [ERROR] [localhost] [54736--1635372934] [11] nodeJS - postData error: url = <a href="https://[REDACTED_URL]/wl/?id=Jvr3YBngwvtPoVyRT6fThOql7RmsG8xf&action=onlyoffice&save=1;data" class="redactor-autoparser-object">https://[REDACTED_URL]/wl/?id=Jvr3YBngwvtPoVyRT6fThOql7RmsG8xf&action=onlyoffice&save=1;data</a> = {"key":"54736--1635372934","status":4,"actions":[{"type":0,"userid":"1"}]} Error: Error response: statusCode:404; headers:{"server":"nginx","date":"Mon, 24 Oct 2022 18:43:05 GMT","content-type":"text/html","transfer-encoding":"chunked","connection":"keep-alive","content-encoding":"gzip"}; body:

<title>404 Not Found</title>

<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>

    at Request._callback (/snapshot/server/build/server/Common/sources/utils.js)
    at Request.callback (/snapshot/server/build/server/Common/node_modules/request/request.js:185:22)
    at Request.emit (events.js:400:28)
    at Request.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:400:28)
    at Gunzip.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at Gunzip.emit (events.js:400:28)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
</anonymous></anonymous>

This looks to me like something is wrong with the way FileRun is generating the callback weblink for the OnlyOffice API. The URL 

https://[REDACTED_URL]/wl/?id=Jvr3YBngwvtPoVyRT6fThOql7RmsG8xf&action=onlyoffice&save=1

resolves to a page that says "Empty contents.".

OnlyOffice is behind an NGINX reverse proxy that I have configured per OnlyOffice documentation here: Using ONLYOFFICE Docs behind the proxy - ONLYOFFICE. NGINX logs do not show any errors.

FileRun version: 20220519

OnlyOffice Document Server version: 7.2.1-34

Any ideas?

Under review

If OO would access that FileRun URL the same as you do in your brower, the output would be "Empty contents" instead of "404 Not Found", so that is where you should look.

Finally had some more time to look into this. I have tried quite literally everything I can think of, but still have not fixed the issue.


I am no longer connecting to OnlyOffice via reverse-proxy-- I'm using default NGINX config for direct-connection, I'm still seeing the error:

Image 1246


I am able to use the example editor without issue. I can open, edit and save the document:

Image 1245


I tried digging into the OnlyOffice app ([webroot]/customizables/plugins/onlyoffice/app.php) and checking that the API calls are well-formed, and sure enough everything looks good. I simply cannot figure out why the callback URL is throwing a 404 error when FileRun tries to access the API, but everything seems to work fine when I use the OnlyOffice example editor...


The only thing logged when the failure occurs is what I posted above:

root@File:~# tail -20 "/var/log/onlyoffice/documentserver/docservice/out.log"
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
[2022-11-01T16:50:48.885] [ERROR] [localhost] [45540--1480725392] [11] nodeJS - postData error: url = <a href="https://[redacted]/wl/?id=vUSHgeS1QbuYbyvrGlQXjEdHDZPBzJT0&action=onlyoffice&save=1;data" class="redactor-autoparser-object">https://[redacted]/wl/?id=vUSHgeS1QbuYbyvrGlQXjEdHDZPBzJT0&action=onlyoffice&save=1;data</a> = {"key":"45540--1480725392","status":4,"actions":[{"type":0,"userid":"1"}]} Error: Error response: statusCode:404; headers:{"server":"nginx","date":"Tue, 01 Nov 2022 22:50:48 GMT","content-type":"text/html","transfer-encoding":"chunked","connection":"keep-alive","content-encoding":"gzip"}; body:

<title>404 Not Found</title>

<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>



    at Request._callback (/snapshot/server/build/server/Common/sources/utils.js)
    at Request.callback (/snapshot/server/build/server/Common/node_modules/request/request.js:185:22)
    at Request.emit (events.js:400:28)
    at Request.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:400:28)
    at Gunzip.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at Gunzip.emit (events.js:400:28)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
</anonymous></anonymous>

Is there anywhere else I can look? Anything else I can try?

I see you focused on the saving back to FileRun via the callback URL. But, do documents from FileRun even open in OO?

Have you configured DocumentServer with valid storage location (https://github.com/ONLYOFFICE/Docker-DocumentServer#storing-data)?

Good suggestion. OO does not load the document from Filerun. I have verified that the storage locations are set correctly. Permissions seem to be correct as well.

I should note that I am not running OO in a Docker container, it is a Debian 10 install following this guide: Installing ONLYOFFICE Docs Community Edition for Debian, Ubuntu, and derivatives.