When I use react to build the front-end page and I disable the JWT of the document editor, the file download failed

      <DocumentEditor
        id="docxEditor"
        documentServerUrl="http://192.168.3.3"
        config={{
          document: {
            fileType: 'docx',
            key: 'Khirz6zTPdfd7',
            title: 'Sample Document Title.docx',
            url: 'http://192.168.3.3:8080/sample.docx',
          },
          documentType: 'word',
          editorConfig: {
            callbackUrl: 'http://192.168.3.3/url-to-callback.ashx',
          },
        }}
        events_onDocumentReady={onDocumentReady}
      />

This is part of the front-end react code, the url of this file is correct, and it can be downloaded from the browser. But when I open the page in the browser, it will report an error that the download failed
20230624_030837-min
This file can of course also be downloaded from the browser
20230624_030508
Here is my configuration for disabling JWT part

1 Like

Hello,

Please make sure you disabled JWT in the local.json config file, not default.json. Have you restarted Document Server services after disabling JWT in the config?

supervisorctl restart all for docker
systemctl restart ds-* for deb/rpm

Also attach logs from /var/log/onlyoffice/documentserver/ after reproducing the issue.

Yes, I’m sure it’s the modified local.json file and then restarted Document Server
Here is the converter/out.log

[2023-06-24T02:26:09.836] [ERROR] [localhost] [Khirz6zTPdfd7] [uid-1687451211906] nodeJS - error downloadFile:url=http://192.168.3.3:8080/sample.docx;attempt=3;code:undefined;connect:undefined Error: DNS lookup 192.168.3.3(family:undefined, host:undefined) is not allowed. Because, It is private IP address.
    at validateIPAddress (/snapshot/server/build/server/Common/node_modules/request-filtering-agent/lib/request-filtering-agent.js:73:20)
    at Socket.<anonymous> (/snapshot/server/build/server/Common/node_modules/request-filtering-agent/lib/request-filtering-agent.js:141:29)
    at Object.onceWrapper (events.js:519:28)
    at Socket.emit (events.js:412:35)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1145:10)

192.168.3.3 is my local ip address

Thank you for reminding me to check the log, I think I know the reason now, I uploaded the file to my cloud server, and then successfully opened the file through the public network ip.


But I still have a question, how can I get the local files? Just like the address of my local file is http://192.168.3.3:8080/sample.docx

Since the 7.4 update Document Server rejects local IP addresses by default. You can change the this parameter to true in /etc/onlyoffice/documentserver/default.json to avoid the issue.

{
“services”: {
“CoAuthoring”: {
“request-filtering-agent”: {
"allowPrivateIPAddress": true,
“allowMetaIPAddress”: true
},

By the way, local addresses should work when JWT is enabled.

Thank you very much, this does work, but JWT is still disabled, not sure if this is a bug.

this does work, but JWT is still disabled, not sure if this is a bug.

I believe all thing are OK, if JWT is disabled on the both sides (Document server and your storage). Anyway, please feel free to contact us if you face any issues.

how to edit default.json.it’s seem local not have

Hello @milkDrink
Please clarify the situation that you faced with default.json editing. For Linux you can use nano, vi or vim packages to edit this file (for docker installation, you have to go to container itself first with editing rights, example of command - docker exec -it ID_of_container bash).

I am getting the same problem. After disable the JWT i get the "download Failed " error

Please do not post the same request in multiple threads. Please stick to your main thread where we are discussing the situation.