Docker document server and nextcloud : document could not be saved

Hi,
First of all, i’m a software developer and I’m quite new (and bad) at managing servers. Long story shot, our sysadmin left and i’m trying to make document server work again.
I have a nextcloud connector on a server and a docker document server on another server behind a proxy.

problem: When I try to access the example page, I can upload files but I can’t edit them

And when i try to set up the connectors from nextcloud I have:
“Error while downloading the document file to be converted”

Document Server version: 7.4.1
Connector version: 7.3.0
OS: Debian

I have installed docker document server image from this yml:

version: '3'
services:
  app:
    container_name: app-server
    image: nextcloud:fpm
    restart: always
    expose:
      - '80'
      - '9000'
    volumes:
      - app_data:/var/www/html
  onlyoffice-document-server:
    container_name: onlyoffice-document-server
    image: onlyoffice/documentserver:latest
    restart: always
    environment:
      - JWT_SECRET=secret
    expose:
      - '80'
      - '443'
    volumes:
      - document_data:/var/www/onlyoffice/Data
      - document_log:/var/log/onlyoffice
  nginx:
    container_name: nginx-server
    image: nginx
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - app_data:/var/www/html
volumes:
  document_data:
  document_log:
  app_data:
  mysql_data:

Then i have run with this:

sudo docker run -i -t -d -p 80:80 -p 443:443 --restart=always \
    -e LETS_ENCRYPT_DOMAIN=url_to_document_server -e LETS_ENCRYPT_MAIL=myemail@domain.com -e JWT_SECRET=same_secret_as_my_nextcloud_connector onlyoffice/documentserver

Now the url of my document server is working:
https://url_to_document_server/ is showing me the page " ONLYOFFICE Docs Community Edition installed"

I have started the example service and i can acess the main page of it (list of files,).

I can upload a document just fine but I can’t edit it because i Have the “document could not be saved error”.

I can share some logs:
/converter/out.log

> [2024-04-10T15:16:17.238] [ERROR] [localhost] [conv_check_766622223_docx] [userId] nodeJS - error downloadFile:url=https://url_nextcloud/index.php/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.fuEyMXxjgGCd1cgkbuokWkFBIZrm0oVdgUAR7UF7Qkk;attempt=1;code:undefined;connect:undefined Error: Error response: statusCode:403; headers:{"server":"nginx","date":"Wed, 10 Apr 2024 15:16:17 GMT","content-type":"application/json; charset=utf-8","content-length":"27","connection":"keep-alive","x-powered-by":"PHP/7.4.30","expires":"Thu, 19 Nov 1981 08:52:00 GMT","pragma":"no-cache","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-download-options":"noopen","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-xss-protection":"1; mode=block","cache-control":"no-cache, no-store, must-revalidate","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","x-robots-tag":"none","set-cookie":["oc_sessionPassphrase=47Wwsl0szd4ks44HXaF6ELWlDSrhVIn%2B7uX7GcWy4QsNpHXL8PnNG%2BAv8qYqiW8TVFdVb6AV47Bl8teg%2FohqbxTmdNQ8iVd62mK%2BSOC4QbxZ4TzQLZ2nZTqrpVlU212j; path=/; secure; HttpOnly; SameSite=Lax","oc95ykwvqq3n=ethjcc7hhjb26gt9h70ocv8ea5; path=/; secure; HttpOnly; SameSite=Lax","__Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax","__Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict"]};
>     at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js)
>     at Request.emit (events.js:400:28)
>     at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10)
>     at ClientRequest.emit (events.js:400:28)
>     at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
>     at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
>     at TLSSocket.socketOnData (_http_client.js:515:22)
>     at TLSSocket.emit (events.js:400:28)
>     at addChunk (internal/streams/readable.js:293:12)
>     at readableAddChunk (internal/streams/readable.js:267:9)
>     at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
>     at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
> [2024-04-10T15:16:18.457] [ERROR] [localhost] [conv_check_766622223_docx] [userId] nodeJS - error downloadFile:url=https://url_nextcloud/index.php/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.fuEyMXxjgGCd1cgkbuokWkFBIZrm0oVdgUAR7UF7Qkk;attempt=2;code:undefined;connect:undefined Error: Error response: statusCode:403; headers:{"server":"nginx","date":"Wed, 10 Apr 2024 15:16:18 GMT","content-type":"application/json; charset=utf-8","content-length":"27","connection":"keep-alive","x-powered-by":"PHP/7.4.30","expires":"Thu, 19 Nov 1981 08:52:00 GMT","pragma":"no-cache","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-download-options":"noopen","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-xss-protection":"1; mode=block","cache-control":"no-cache, no-store, must-revalidate","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","x-robots-tag":"none","set-cookie":["oc_sessionPassphrase=50kiMHQwA9PITO3RYVi7MrI477YKXNMkWtFYt%2BfUVfq8KBOQllEROBaKhxTKpMPiK1xEeebxQv8szeSLDUbuYK7dv3v1CyiEUSIOQFqiB%2BvXuwC2W%2FVjykROgwMPkniz; path=/; secure; HttpOnly; SameSite=Lax","oc95ykwvqq3n=bne5hdnqsefj35mai4m4odadi2; path=/; secure; HttpOnly; SameSite=Lax","__Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax","__Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict"]};
>     at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js)
>     at Request.emit (events.js:400:28)
>     at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10)
>     at ClientRequest.emit (events.js:400:28)
>     at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
>     at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
>     at TLSSocket.socketOnData (_http_client.js:515:22)
>     at TLSSocket.emit (events.js:400:28)
>     at addChunk (internal/streams/readable.js:293:12)
>     at readableAddChunk (internal/streams/readable.js:267:9)
>     at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
>     at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
> [2024-04-10T15:16:19.690] [ERROR] [localhost] [conv_check_766622223_docx] [userId] nodeJS - error downloadFile:url=https://url_nextcloud/index.php/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.fuEyMXxjgGCd1cgkbuokWkFBIZrm0oVdgUAR7UF7Qkk;attempt=3;code:undefined;connect:undefined Error: Error response: statusCode:403; headers:{"server":"nginx","date":"Wed, 10 Apr 2024 15:16:19 GMT","content-type":"application/json; charset=utf-8","content-length":"27","connection":"keep-alive","x-powered-by":"PHP/7.4.30","expires":"Thu, 19 Nov 1981 08:52:00 GMT","pragma":"no-cache","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-download-options":"noopen","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-xss-protection":"1; mode=block","cache-control":"no-cache, no-store, must-revalidate","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","x-robots-tag":"none","set-cookie":["oc_sessionPassphrase=EdCab8Q0PfhJ5ovk2ZwwQlyikVOPsvjk813lyb3%2FRiEPzo4E5i4nqFTI7pagLhT1ycob9AMO1%2BPCXsqSsjLSVyD8dBK3nf%2FvPeNPnW9gd%2BwYJ5LQE2XZyDFmht16gaNn; path=/; secure; HttpOnly; SameSite=Lax","oc95ykwvqq3n=j546d1cp80tclv6bkes27vgqm5; path=/; secure; HttpOnly; SameSite=Lax","__Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax","__Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict"]};
>     at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js)
>     at Request.emit (events.js:400:28)
>     at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10)
>     at ClientRequest.emit (events.js:400:28)
>     at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
>     at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
>     at TLSSocket.socketOnData (_http_client.js:515:22)
>     at TLSSocket.emit (events.js:400:28)
>     at addChunk (internal/streams/readable.js:293:12)
>     at readableAddChunk (internal/streams/readable.js:267:9)
>     at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
>     at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)

and docservice/out.log

[2024-04-10T15:34:40.501] [ERROR] [localhost] [195.15.192.164__10.0.1.230aep.csv1712757602065] [uid-1] nodeJS - postData error: url = https://url_document_server.com/example/track?filename=aep.csv&useraddress=195.15.192.164__10.0.1.230;data = {"key":"195.15.192.164__10.0.1.230aep.csv1712757602065","status":1,"users":["uid-1"],"actions":[{"type":1,"userid":"uid-1"}],"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiIxOTUuMTUuMTkyLjE2NF9fMTAuMC4xLjIzMGFlcC5jc3YxNzEyNzU3NjAyMDY1Iiwic3RhdHVzIjoxLCJ1c2VycyI6WyJ1aWQtMSJdLCJhY3Rpb25zIjpbeyJ0eXBlIjoxLCJ1c2VyaWQiOiJ1aWQtMSJ9XSwiaWF0IjoxNzEyNzYzMjc3LCJleHAiOjE3MTI3NjM1Nzd9.8-wtA5VjaL451_UirA8pH142CtuzAoX7L6b3QToB4OY"} Error: Error response: statusCode:503; headers:{"cache-control":"no-cache","content-type":"text/html"}; body:
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>


    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 IncomingMessage.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
root@49fd043cce71:/var/log/onlyoffice/documentserver/docservice#

I have also made the wget test (from ds to nc and vice-versa).

Can you please help me.

THanks.

Hi @oHInsane :wave:

Please execute the command docker ps on the server with ONLYOFFICE Docs.

  • Can you make a screenshot of the connector app page with the settings?

  • Please, send me both "local.json " files:

/etc/onlyoffice/documentserver/
/etc/onlyoffice/documentserver-example/

Also, please note that the current version of the document server is 8.0.1.

  • And please specify the version of NextCloud.

Hello and thanks for your answer.

Here is the docker ps:

The connector settings:

where url_to_document_server is editer. The url there is pointing to the documentserver address.

document server local.json

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Authorization",
          "inBody": false
        },
        "outbox": {
          "header": "Authorization",
          "inBody": false
        }
      },
      "secret": {
        "inbox": {
          "string": "SH7mKS0GXsvbI21B0muNMi5EUuM98CSm"
        },
        "outbox": {
          "string": "SH7mKS0GXsvbI21B0muNMi5EUuM98CSm"
        },
        "session": {
          "string": "SH7mKS0GXsvbI21B0muNMi5EUuM98CSm"
        }
      }
    }
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost"
  },
  "storage": {
    "fs": {
      "secretString": "DQxB3wYfu84lmcY4Ltv8"
    }
  }
}

documentserver-example local.json

{
  "server": {
    "token": {
      "enable": true,
      "secret": "SH7mKS0GXsvbI21B0muNMi5EUuM98CSm",
      "authorizationHeader": "Authorization"
    }
  }
}

NC version is 22.1.0

1 Like

hi @oHInsane

I suspect it might be related to the proxy configuration.

Could you please confirm if you followed our instructions for creating the configuration?

Using ONLYOFFICE Docs behind the proxy

Sorry for my late feedback, was getting busy with other problems.

I have managed to solve my issue thanks for your input.
There were two problems:

  1. The problem to use the “example” page: It was indeed a haproxy problem. The ip wasn’t listed in the acl authorization list. I added it, restarted haproxy and example worked fine.
  2. Concerning the nextcloud connector problem, since it was a 403 error in the log, I figured out that it was an authorization problem. So i launched my docker image with this command:
sudo docker run -i -t -d -p 80:80 -p 443:443 --restart=always \
    -e LETS_ENCRYPT_DOMAIN=xxx.tools -e LETS_ENCRYPT_MAIL=xxxt@xxx.com -e 'JWT_ENABLED'='true' -e 'JWT_HEADER'='AuthorizationJwt' -e 'JWT_IN_BODY'='true' -e JWT_SECRET=secret_key onlyoffice/documentserver

And I edited the config file of nc with;

'onlyoffice' =>
           array (
    "jwt_secret" => "secret_key ",
    "jwt_header" => "AuthorizationJwt"
 ),

everything works now !

2 Likes