Problem with OnlyOffice integration

I followed this guide: OnlyOffice Integration.

Seafile runs on server A, installed in the classic way, on server B OnlyOffice runs via Docker.

When calling up an Office document, a new browser window opens with OnlyOffice, then it takes a moment and I get the error message “Download failed” and “The document could not be saved”.

I can’t find a clue in any log file that leads me to the cause of the problem. The test page /welcome can be called without complaint. /example also works great. So it must be the integration with Seafile.

I have the following questions about the settings in the seahub_settings.py file:
ONLYOFFICE_APIJS_URL: if Seafile is called via HTTPS, does ONLYOFFICE_APIJS_URL also have to be HTTPS, or is this completely independent of the call to Seafile HTTP or HTTPS?

ONLYOFFICE_FORCE_SAVE: is this setting sufficient for the file to be saved, or is the setting in the /etc/onlyoffice/documentserver/local.json file required? If so, can this setting also be made in the /etc/onlyoffice/documentserver/production-linux.json file instead of in local.json?

I have already successfully installed Seafile and OnlyOffice, but on the same server and therefore made OnlyOffice accessible as a subfolder. However, I would now like to split the services over several servers.

My description of the problem is not entirely correct. I don’t have two, but three servers:

  • The Apache web server is running on Server A
  • Seafile is running on Server B
  • Onlyoffice runs on Server C via Docker

Seafile is addressed by the web server via reverse proxy. All servers are behind a firewall. If I can’t NAT forward Seafile requests to the same server as all other webs, I would have to use a different port or IP address. I would rather not have both.

When called via subdomain, OnlyOffice (on Server C) does not find anything running on port 80 on the Seafile server (Server B). Logically, Seafile runs on port 8000 and OnlyOffice would have to look on server A, where the web server runs on port 80. I haven’t figured out how to do this.

The error message in the Docker container at /var/log/onlyoffice/documentserver/converter/out.log is:
nodeJS - error downloadFile:url=http://servername.internal.domain/seafhttp/files/2b4dd3a8-5e07-4884-8bd5-27894f66dfe6/Test.xlsx;attempt=1;code:ECONNREFUSED;connect:undefined Error: connect ECONNREFUSED ip.address.of.seafile.server:80

At least it tries to load the document.

I hoped to be able to handle this better via subfolder. But with this variant, the document is not loaded at all. The error message is: The connection to the server was lost. In the Docker container under /var/log/onlyoffice/documentserver I can find information about the document in the docservice/out.log file. As far as I can see, all the information is correct, but the last three lines contain:
[2023-03-08T12:24:55.650] [WARN] [localhost] [docId] [userId] nodeJS - 3
[2023-03-08T12:24:55.650] [WARN] [localhost] [docId] [userId] nodeJS - Bad request
[2023-03-08T12:24:55.652] [WARN] [localhost] [docId] [userId] nodeJS - { name: ‘TRANSPORT_HANDSHAKE_ERROR’ }

In all scenarios I’m currently working without TLS so I can work around issues with certificates for now.

Can someone help me?

In addition to the documentation in Seafile, I saw at OnlyOffice helpcenter that a few more lines are needed to be able to call OnlyOffice via a subfolder: Proxy to virtual path

Define VPATH /documentserver-virtual-path
Define DS_ADDRESS backendserver address

<Location ${VPATH}>
Require all granted
SetEnvIf Host "^(.)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto http
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
RequestHeader edit X-Forwarded-Host (.
) $1${VPATH}
ProxyAddHeaders Off

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^${VPATH}/?(.*) “ws://${DS_ADDRESS}/$1” [P,L]
ProxyPass ${VPATH} “http://${DS_ADDRESS}”
ProxyPassReverse ${VPATH} “http://${DS_ADDRESS}”

So, when I do that, at least the opening of a document succeeds.

Unfortunately not the writing yet. Inside the OODS container under /var/log/onlyoffice/documentserver/docservice/out.log I find the following:
[2023-03-27T11:35:01.521] [WARN] [localhost] [a098a8d720611d72618f] [me@example.com] nodeJS - storeForgotten
[2023-03-27T11:35:19.745] [WARN] [localhost] [a098a8d720611d72618f] [me@example.com] nodeJS - sendServerRequest returned an error: data = {“error”: 1}