Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 7.2.1.34)

Here is my screenshoot

Do I understand it right that Document server and ownCloud are installed on the same server? It looks like DS tries to achieve ownCloud via 127.0.0.1:8086 address. If so, please double check that DS and ownCloud can communicate each other. Please run wget command inside the container. For example, go to DS container (with command docker exec -it ID_of_container bash) and run wget https://domain_name_of_owncloud. Also run this test for ownCloud container with DS address. Please provide us with results.
Usually we recommend to use separate server for Document server installation. It’s necessary to avoid dependencies and port conflicts.

I don’t know why but after i deleted the onlyoffice connect app and install it again, the error went out. The problem is solved, thank you so much

We are glad that the issue is solved, please feel free to contact us if you face any issues.

Maybe i figured out the issue, it related to time sync between DC and OwnCloud server. I post the link here, maybe it can hepl someone

Hello @toipq Thank you for provided data.
Indeed, time difference between servers can provoke issues. I’m not sure that you faced that issue, because I didn’t find situation-related error entries in the provided logs earlier. Anyway, I believe this workaround solution will be useful for other users.
By default Document Server can receive requests with 60 seconds time difference between servers, however connector app of the Owncloud is set to reject those by default.
To configure that parameter you have to follow these steps:

  1. Find connector app JWT config located in /var/www/owncloud/apps/onlyoffice/3rdparty/jwt/JWT.php
  2. In JWT.php config file find next line “public static $leeway = 0;” and set the needed value in seconds (in our case it is 60 seconds, 0 is default).

This solution solved my problem. I noticed that in my installation, instead of “AuthorizationJwt” it said “AuthorizeJwt”. I changed it to the correct way, changed the inBody to false and then executed the command proposed by @Constantine, and it worked as a charm.

1 Like

Hello @andresvilla

Glad to hear that this solution worked for you!

1 Like

Hi @Alexandre and @Constantine in my setup, I turned off jwt authorization. I got the same error message. unable to download document.

same problem here. What is weird about this is that after i try to connect nextcloud, i can no longer access test files via direct IP.

docservice out.log after i try to connect via nextcloud (before that i can load files with no issue).

[2023-07-06T17:57:59.265] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672

converter out.log

[2023-07-06T17:58:23.709] [ERROR] [localhost] [conv_check_762376340_docx] [userId] nodeJS - error downloadFile:url=https://drive.**.org/index.php/apps/onlyoffice/empty?doc=..;attempt=3;code:undefined;connect:undefined Error: Error response: statusCode:403; headers:{"date":"Thu, 06 Jul 2023 15:04:24 GMT","content-type":"application/json; charset=utf-8","content-length":"27","connection":"keep-alive","strict-transport-security":"max-age=15552000; includeSubDomains, max-age=63072000;includeSubDomains; preload","set-cookie":["ocfo9mt9vamc=vjm0gd8dlj0fb3thfmm9ilg8a9; path=/; secure; HttpOnly; SameSite=Lax","oc_sessionPassphrase=xqL674tk9NAod77rGkxDoiyN7uIlL6kafZyQV7jzJAc7uqLD%2BPDbPSTevrQ0%2FhNCLcr9YbVFMvXRn7YYcwQ5rVI9ss%2FoOI%2FD3kTrqx54OuBuGEchaHYMIs5TxmS84efG; path=/; secure; HttpOnly; SameSite=Lax","ocfo9mt9vamc=evnqvspqjp43n5j5td0s8dr82s; path=/; secure; HttpOnly; SameSite=Lax","ocfo9mt9vamc=evnqvspqjp43n5j5td0s8dr82s; 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","ocfo9mt9vamc=evnqvspqjp43n5j5td0s8dr82s; path=/; secure; HttpOnly; SameSite=Lax"],"expires":"Thu, 19 Nov 1981 08:52:00 GMT","cache-control":"no-cache, no-store, must-revalidate","pragma":"no-cache","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-robots-tag":"noindex, nofollow","x-xss-protection":"1; mode=block","x-request-id":"fLkAyIj0kAaQY5ZAh4yj","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","cf-cache-status":"DYNAMIC","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=s3xrF0c9v2cAV4kHTxWNfI7o%2FhU7%2FfZeO7xHsaMC79tNcXKD3Z9Gq0%2FR0VJI9kZasWPBXa4bortNT7j%2FUsm7yCkzW%2F1iwfV0mI5vz2RLiuNxGw8WOgKkDO261edYtoRHagCu\"}],\"group\":\"cf-nel\",\"max_age\":604800}","nel":"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}","server":"cloudflare","cf-ray":"7e28bd714c66f180-CDG","alt-svc":"h3=\":443\"; ma=86400"};
    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)

I changed following properties to false in DocumentServer\config\default.json and now it is working for me.

 "request-filtering-agent" : {                               
     "allowPrivateIPAddress": false, 
     "allowMetaIPAddress": false              
  },

they are already set to false for me unfortunately

Hi @Alexandre @Constantine,
I’ve tried your code but didn’t get anything

{
              "header":"AuthorizationJwt",
              "inBody":false
            },
            "outbox":  {
              "header":"AuthorizationJwt",
              "inBody":false
            }

I’ve also tried in nexctloud

array (
    'verify_peer_off' => true,
    'jwt_secret' => 'code',
    'jwt_header' => 'AuthorizationJwt',
  ),

What else can I try

Never i just saw I’m stupid and modified the wrong inbox and outbox ! it indeed works

my bad, set those properties as true.

"request-filtering-agent" : {                               
     "allowPrivateIPAddress": false, 
     "allowMetaIPAddress": false              
  },
1 Like

Hello @Harishkumar and @ArnaudT
Sorry for the late reply.
As far as I understand, you have managed situations. If I misunderstood it and issue still reproduces, please clarify it.

No i just modified too much stuff following different forum and had to reset the file to default values. but its fine now ! thanks

1 Like

So I do have the same issue, I have followed this thread closely. I am running Nextcloud (v27) and Onlyoffice (latest) as docker containers. I do have certified access setup to both containers using onlyoffice.domain.io and nextcloud.domain.io (setup using pfSense and HAProxy).
I did change the nextcloud config.php to:

  'onlyoffice' =>
  array (
    'verify_peer_off' => true,
    'jwt_secret' => 'code_from_local.json',
    'jwt_header' => 'AuthorizationJwt',
  ),

And this is my changed local.json:

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

This is my docker setup:

  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    restart: unless-stopped
    environment:
      - PGID=1000
      - PUID=1000
      - TZ=${TZ}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
    volumes:
      - ./appdata/nextcloud:/config
      - /storage/nextcloud:/data
    ports:
      - 8080:80
      - 4443:443
    depends_on:
      - mariadb

  onlyoffice:
    container_name: onlyoffice
    image: onlyoffice/documentserver:latest
    restart: unless-stopped
    environment:
      - JWT_ENABLED=false
      - JWT_HEADER=Authorization
    ports:
      - 8880:80
      - 8843:443
    volumes:
      - ./appdata/onlyoffice/document_data:/var/www/onlyoffice/Data
      - ./appdata/onlyoffice/document_log:/var/log/onlyoffice

The thing I failing at is to change the JWT_HEADER to AuthorizationJwt, if I change that in the docker-compose file it does not change the local.json file. If I change it inside the local.json file it doesn’t stick.

So I did try to use Authorization everywhere instead, but that failed as well.

So what easy error am I making? What have I missed? :smiley:

Hello @mattias

Since there is a proxy used, please take a look at this configs that are recommened to used with Document Server and compare to the one that you are using:
https://helpcenter.onlyoffice.com/installation/docs-community-proxy.aspx

If the issue reproduces after verifying the proxy config, please share logs of Document Server for analysis.