onlyoffice-nextcloud icon indicating copy to clipboard operation
onlyoffice-nextcloud copied to clipboard

"Error while downloading the document file to be converted" on Onlyoffice-Nextcloud integration setup (on docker containers)

Open omaluma opened this issue 6 years ago • 14 comments

I'm having difficulties setting up docserver and nextcloud on docker containers.

When setting up in the GUI nextcloud section for onlyoffice (https://nextcloud.mydomain.com/settings/admin/onlyoffice), an error occur:

 Error al intentar establecer la conexión (Se ha producido un error en el servicio de documentos: Error while downloading the document file to be converted.)

I have already modify the default.json file on onlyoffice container:

"secret": {
    "browser": {"string": "mysecret", "file": "", "tenants": {}},
    "inbox": {"string": "mysecret", "file": "", "tenants": {}},
    "outbox": {"string": "mysecret", "file": ""},
    "session": {"string": "mysecret", "file": ""}
},
"token": {
    "enable": {
        "browser": true,
        "request": {
            "inbox": true,
            "outbox": true
        }

and the config.php on the nextcloud contianer:

'onlyoffice'=>array(
     'verify_peer_off'=>true,

But still got this error.

I can wget both sites from each one of them, I mean, is suppose isn't an interconnectivity issue.

On the document server container, the converter logs send this:

 [2019-10-11T22:17:50.413] [ERROR] nodeJS - error downloadFile:url=https://nextcloud.mydomain.com/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0;attempt=3;code:null;connect:null;(id=conv_check_2042821037_docx)
 Error: Error response: statusCode:403 ;body:
 {"message":"Access denied"}
     at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:257:18)
     at Request.self.callback (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:185:22)
     at emitTwo (events.js:126:13)
     at Request.emit (events.js:214:7)
     at Request.<anonymous> (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1161:10)
     at emitOne (events.js:116:13)
     at Request.emit (events.js:211:7)
     at IncomingMessage.<anonymous> (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1083:12)
     at Object.onceWrapper (events.js:313:30)
     at emitNone (events.js:111:20)
     at IncomingMessage.emit (events.js:208:7)
     at endReadableNT (_stream_readable.js:1064:12)
     at _combinedTickCallback (internal/process/next_tick.js:139:11)
     at process._tickCallback (internal/process/next_tick.js:181:9)

on the nextcloud container, i get this:

 192.168.240.2 - - [11/Oct/2019:22:17:48 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 1311 "-" "-"
 192.168.240.2 - - [11/Oct/2019:22:17:49 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 1315 "-" "-"
 192.168.240.2 - - [11/Oct/2019:22:17:50 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 1315 "-" "-"
 192.168.240.2 - - [11/Oct/2019:22:17:47 +0000] "PUT /apps/onlyoffice/ajax/settings/address HTTP/1.1" 200 1240 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"

And on the proxy container that is helping me out, get this:

 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 200.236.113.176 - - [11/Oct/2019:22:17:12 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 1976 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 109.70.100.26 - - [11/Oct/2019:22:17:32 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 74 "-" "Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 200.236.113.176 - - [11/Oct/2019:22:17:42 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 1976 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
 ESC[0;33;1mnginx.1    | ESC[0mdocserver.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:48 +0000] "GET /healthcheck HTTP/1.1" 200 4 "-" "GuzzleHttp/6.3.3 curl/7.64.0 PHP/7.3.9"
 ESC[0;33;1mnginx.1    | ESC[0mdocserver.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:48 +0000] "POST /coauthoring/CommandService.ashx HTTP/1.1" 200 32 "-" "GuzzleHttp/6.3.3 curl/7.64.0 PHP/7.3.9"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:48 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 27 "-" "-"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:49 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 27 "-" "-"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:50 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.tB-df7RJd6Wb7mYwZ4kq_goQEDCfaS-ASNkaXy0iZF0 HTTP/1.1" 403 27 "-" "-"
 ESC[0;33;1mnginx.1    | ESC[0mdocserver.mydomain.com 192.168.240.1 - - [11/Oct/2019:22:17:52 +0000] "POST /ConvertService.ashx HTTP/1.1" 200 80 "-" "GuzzleHttp/6.3.3 curl/7.64.0 PHP/7.3.9"
 ESC[0;33;1mnginx.1    | ESC[0mnextcloud.mydomain.com 200.236.113.176 - - [11/Oct/2019:22:17:52 +0000] "PUT /apps/onlyoffice/ajax/settings/address HTTP/2.0" 200 330 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"

Any idea what am I doing wrong??

omaluma avatar Oct 11 '19 22:10 omaluma

Hello @omaluma,

Access Denied error might be caused by JWT mismatch. For Document Server, the JWT secret has to be indicated in /etc/onlyoffice/documentserver/local.json config. Don't forget to restart Document Server services after changing the config supervisorctl restart all

CarlOnlyoffice avatar Oct 17 '19 10:10 CarlOnlyoffice

我也遇到了同样的问题,上传了一个doc格式的文档,就出现这样的错误提示,我没有做其它的操作

hongluoluo avatar Oct 18 '19 06:10 hongluoluo

@hongluoluo Sorry, we don't provide assistance in Chinese. Please post your message in English.

CarlOnlyoffice avatar Oct 18 '19 07:10 CarlOnlyoffice

@hongluoluo抱歉,我们不提供中文帮助。请用英语发布您的信息。

I also encountered the same problem. When I uploaded a doc format document, there was such an error prompt. I didn't do other operations. Finally, I restarted the web server to solve the problem.

hongluoluo avatar Oct 18 '19 07:10 hongluoluo

Thanks

@CarlOnlyoffice I did write down the config as follows on /etc/onlyoffice/documentserver/local.json:

 {
   "services": {
     "CoAuthoring": {
       "sql": {
         "dbHost": "localhost",
         "dbName": "onlyoffice",
         "dbUser": "onlyoffice",
         "dbPass": "onlyoffice"
       },
       "redis": {
         "host": "localhost"
       },
       "token": {
         "enable": {
           "request": {
             "inbox": true,
             "outbox": true
           },
           "browser": true
         },
         "inbox": {
           "header": "Authorization"
         },
         "outbox": {
           "header": "Authorization"
         }
       },
       "secret": {
         "inbox": {
           "string": "mysecret"
         },
         "outbox": {
           "string": "mysecret"
         },
         "session": {
           "string": "mysecret"
         }
       }
     }
   },
   "rabbitmq": {
     "url": "amqp://guest:guest@localhost"
   }
 }

Then I did write the same key on the aplication panel on the nextcloud's GUI.

It failed. But now with different error, something like:

An error has occured on the document server: Invalid token

the original message on spanish is this: Error al intentar establecer la conexión (Se ha producido un error en el servicio de documentos: Invalid token)

And no relevant logs on the nextcloud, proxy and the onlyoffice logs neither.

I tried then with this config on /etc/onlyoffice/documentserver/default.json also:

 ...
                    "secret": {
                            "browser": {"string": "mysecret", "file": "", "tenants": {}},
                            "inbox": {"string": "mysecret", "file": "", "tenants": {}},
                            "outbox": {"string": "mysecret", "file": ""},
                            "session": {"string": "mysecret", "file": ""}
                    },
                    "token": {
                            "enable": {
                                    "browser": true,
                                    "request": {
                                            "inbox": true,
                                            "outbox":true
                                    }
                            },
 ...

And the result is the same.

Is there something missing??

Where can I track this kind of error??

omaluma avatar Oct 21 '19 20:10 omaluma

Hello @omaluma, You don't need to change the JWT settings in default.json. In local.json, please try to change the header to AuthorizationJwt => save the file and run supervisorctl restart all. Then in nextcloud/config/config.php, add a section

'onlyoffice' =>
  array (
    "jwt_secret" => "secret-from-local.json",
    "jwt_header" => "AuthorizationJwt"
)

and check if the issue persists.

CarlOnlyoffice avatar Oct 22 '19 10:10 CarlOnlyoffice

thank you very much

------------------ 原始邮件 ------------------ 发件人: "Carl"<[email protected]>; 发送时间: 2019年10月22日(星期二) 晚上6:34 收件人: "ONLYOFFICE/onlyoffice-nextcloud"<[email protected]>; 抄送: "浮云"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [ONLYOFFICE/onlyoffice-nextcloud] "Error while downloading the document file to be converted" on Onlyoffice-Nextcloud integration setup (on docker containers) (#153)

Hello @omaluma, You don't need to change the JWT settings in default.json. In local.json, please try to change the header to AuthorizationJwt => save the file and run supervisorctl restart all. Then in nextcloud/config/config.php, add a section 'onlyoffice' => array ( "jwt_secret" => "secret-from-local.json", "jwt_header" => "AuthorizationJwt" )
and check if the issue persists.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hongluoluo avatar Oct 23 '19 09:10 hongluoluo

Wow, thanks @CarlOnlyoffice for this hint, that probably saved me another day of debugging. I had this same problem after an upgrade and also with a fresh install on Nextcloud 17.0.1. And I found a lot of problems other people had, but none where directly related to the token. Because in my case all worked fine if I disabled authorization.

Now I would be interested: is this just a quick fix or is this to stay and only not yet documented?

Because throughout all my debugging attempts and web searches I didn't find any obvious documentation on that, but still found a lot of official docs that still use "Authorization" for services.CoAuthoring.token.inbox.header and services.CoAuthoring.token.outbox.header in the local.json. And also here in this repo in the README.md it says nothing about having to add the onlyoffice array to the Nextcloud's config.php, with the jwt_header and jwt_secret set correctly, after installing the onlyoffice-nextcloud app.

This could at least go into the Known Issues section of the README.md here.

jackieklaura avatar Nov 22 '19 10:11 jackieklaura

谢谢,我的问题解决了!------------------ 原始邮件 ------------------ 发件人: "jackieklaura"[email protected] 发送时间: 2019年11月22日(星期五) 晚上6:40 收件人: "ONLYOFFICE/onlyoffice-nextcloud"[email protected]; 抄送: "hongluoluo"[email protected];"Mention"[email protected]; 主题: Re: [ONLYOFFICE/onlyoffice-nextcloud] "Error while downloading thedocument file to be converted" on Onlyoffice-Nextcloud integration setup (ondocker containers) (#153)

Wow, thanks @CarlOnlyoffice for this hint, that probably saved me another day of debugging. I had this same problem after an upgrade and also with a fresh install on Nextcloud 17.0.1. And I found a lot of problems other people had, but none where directly related to the token. Because in my case all worked fine if I disabled authorization.

Now I would be interested: is this just a quick fix or is this to stay and only not yet documented?

Because throughout all my debugging attempts and web searches I didn't find any obvious documentation on that, but still found a lot of official docs that still use "Authorization" for services.CoAuthoring.token.inbox.header and services.CoAuthoring.token.outbox.header in the local.json. And also here in this repo in the README.md it says nothing about having to add the onlyoffice array to the Nextcloud's config.php, with the jwt_header and jwt_secret set correctly, after installing the onlyoffice-nextcloud app.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hongluoluo avatar Nov 23 '19 00:11 hongluoluo

@omaluma Does it work without turning on the JWT settings in ONLYOFFICE and Nextcloud?

LinneyS avatar Dec 27 '19 10:12 LinneyS

Just ran into this, solved it with the solution from @CarlOnlyoffice . This definitely needs to be documented somewhere!

madscientist159 avatar May 03 '20 18:05 madscientist159

same issue here:

-> ive installed nextcloud in a jail on my freenas server -> ive a vm which serves the onlyoffice socument server with the docker image -> added office.domainX.de to the trusted domains in nextcloud config.php

both are accessible through a nginx reverse proxy with letsencrypt certs Internally these are on port 80 and https is done by the reverse proxy as said.

i can easily do a wget office.domainX.de from my nextcloud jail

Any how i get the error if i set up the onlyoffice app in nextcloud.

I wonder how to set the options in onlyoffice within that dockr image? How do i do so?

Edit: the docker log says image

Edit: One step closer: Long story short, i needed to reboot my fresh docker service vm and then it fully worked. No idea why but i was installing dcker and it was running fine but any how it did not work from my nextcloud host to connect. (see that werid docker dns error) -after i rebootet the machine (first time after installing of that container) it worked to save the settings in the onyloffice settings. But now i get this: image

edit: SOLVED Oki got it woirking now by using this reverse proxy script for my nginx reverse proxy (it was related to the office configuration) https://helpcenter.onlyoffice.com/de/server/document/document-server-proxy.aspx

Krautmaster avatar May 07 '20 07:05 Krautmaster

Hello @omaluma, You don't need to change the JWT settings in default.json. In local.json, please try to change the header to AuthorizationJwt => save the file and run supervisorctl restart all. Then in nextcloud/config/config.php, add a section

'onlyoffice' =>
  array (
    "jwt_secret" => "secret-from-local.json",
    "jwt_header" => "AuthorizationJwt"
)

and check if the issue persists.

This saved me. I couldn't find this literally anywhere. I by pure luck found this. It's not mentioned anywhere in the docs, the default config is not working. Is there a reason for that or did nobody update it?

Will you update the Nextcloud app configuration and docker-compose.yml so we don't have to deal with this? It's really hard to find this solution.

jiriks74 avatar Mar 09 '22 23:03 jiriks74

@CarlOnlyoffice saved my life... thanks...

ricardocora avatar May 09 '23 17:05 ricardocora