Download failed,(error downloadFile:url=http://localhost:80/filehandler.ashx,statusCode:403)


I keep getting the error download failed when opening a newly created document.
I looked at the log file /var/log/onlyoffice/documentserver/converter/, and the problem that kept coming up was:
nodeJS - error downloadFile:url=http://localhost:80/filehandler.ashx? action=stream&fileid=13&stream_auth=456975222837.CGY1KKVM3MBYMR8CTR0O8BLKOMVR4XL5CEVQAO6LAN0; attempt=3; code:null; connect:null Error: Error response: statusCode:403; Headers: {" server “:” openresty / 1.25.3.1 ", “date” : “Tue, 25 Jun 2024 01:33:46 GMT”,“transfer-encoding”:“chunked”,“connection”:“keep-alive”}.
/var/log/onlyoffice/docspace/files.log.I found an error in this file information, 2024-06-25 10:05:04, 231 ERROR [81] ASC. Web. Files. FileHandlerService - Download stream header http://localhost/filehandler.ashx? Action = stream&fileid = 13 & stream_auth = 456977100824.39 U4PGR8UOLH7ZTFAQ2REV46A3J8WJ7ECRZHXCD4W System. Exception: Invalid signature header AuthorizationJwt with value .Trace headers: Connection=close
Host=localhost
The user-agent = Node. Js / 6.13
Accept-Encoding=gzip, deflate
X-ray Real - IP = 127.0.0.1
X-Forwarded-Ssl=off
X-Forwarded-Host=localhost:80
X-Original-Proto=http
X - the Original - For = 127.0.0.1:48772.
A friend said I looked at the community need to modify the file/etc/onlyoffice documentserver/default. json
“request-filtering-agent” : {
“allowPrivateIPAddress”: true,
“allowMetaIPAddress”: true
},
But it doesn’t work for me,Please help me solve this problem, thank you very much.

Hey @xiaolu :wave:

  1. Docker/Linux?
  2. Have you modified any configuration files for the Document Server besides the “allowPrivateIPAddress” and “allowMetaIPAddress” settings? (default. json/local.json)
  3. How is your network configured?
  4. What is specified in your Settings > Integration > Document server?
  1. Did you restart the Document Server after applying the settings?

1.I use Linux
2.I also changed the attribute of the local.json services.token.browser to false.
This is my configuration
default.docx (21.6 KB)
local.docx (13.1 KB)
3.I used Ubuntu22.04 network setup bridge mode,
My access on my current Linux system also shows 403


4.This is my configuration

5.I use the command: systemctl restart ds-* to restart

@Nikolas I have explained my problem, can you tell me how to solve it?

Sure, thank you very much for providing the requested information. Now, let’s see what the issue might be.

@xiaolu

  1. Update the value in the local.json file to:
"browser": true

1.1 Execute the following command to apply the settings:

systemctl restart ds-*
  1. Try opening the document in your browser and include a screenshot from Chrome’s DevTools Console and Network tab.

  2. Please provide logs from the directories:

/var/log/onlyoffice/documentserver/docservice/out.log
/var/log/onlyoffice/documentserver/converter/out.log

@Nikolas thank you! I set the attribute “browser”: true, and the system can be accessed normally.

1 Like

I encountered a similar issue while using Docker to install the OnlyOffice Document Server. The integration with Nextcloud was successful, but attempting to open documents results in a download failed error. Nextcloud and Onlyoffice is behind Traefik.

Below is the error log from the OnlyOffice Document Server:
[2025-01-23T16:01:14.811] [ERROR] [localhost] [612002144] [ocqgeb7t8tvv_admin] nodeJS - error downloadFile:
url=https://xxx.x.x.x.x…me/apps/onlyoffice/download?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6NzUwLCJ1c2VySWQiOiJhZG1pbiJ9.Ms4Wh4eLZqsz8InDW5XL60TtTDlQ3UciLM-RRzJnNZc;
attempt=3; code:null; connect:null

Error: Error response: statusCode:400;
headers: {
“date”: “Thu, 23 Jan 2025 16:01:14 GMT”,
“content-type”: “application/vnd.openxmlformats-officedocument.wordprocessingml.document”,
“content-length”: “0”,
“connection”: “keep-alive”,
“cache-control”: “no-cache, no-store, must-revalidate”,
“content-disposition”: “attachment; filename="oxlava.docx"”,
“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’”,
“referrer-policy”: “no-referrer”,
“set-cookie”: [
“ocqgeb7t8tvv=e52b8dfc0427683a3bb9f53d9f05537c; path=/; secure; HttpOnly; SameSite=Lax”,
“oc_sessionPassphrase=0a2UDX%2B6FCXmiTa4SBUZQbtQYJK%2BX4%2FpXNtHmblXW2DtHWFlqvG1oefJfaJWE3hBDe4%2FPQOLV21gKacv%2BHQ7rOUjkHiUgKJyU%2BzUGHhQEE0i%2BIOqwrFEC%2BrKE6E%2BrC6Y; 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”
],
“x-content-type-options”: “nosniff”,
“x-frame-options”: “SAMEORIGIN”,
“x-permitted-cross-domain-policies”: “none”,
“x-powered-by”: “PHP/8.2.27”,
“x-request-id”: “QO0BmpO5LmwP9crNy0mt”,
“x-robots-tag”: “noindex, nofollow”,
“x-xss-protection”: “1; mode=block”,
“cf-cache-status”: “DYNAMIC”,
“report-to”: "{"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4\“}],\“group\”:\“cf-nel\”,\“max_age\”:604800}”,
“nel”: “{"success_fraction":0,"report_to":"cf-nel","max_age":604800}”,
“server”: “cloudflare”,
“cf-ray”: “906900518ac0e248-ORD”
}

Hey @oxbli

The ‘Download failed’ error means that the Document Server cannot download the file from the storage for editing.

Most usual reason for that is inaccessibility of the Document Server and the storage for each other. Here is some description of the error in our API Troubleshooting

Try to do the following:

  1. Enter the container with the Document Server sudo docker exec -it [container_id] bash
  2. Execute wget https://storage_address/ to check if it is accessible for the Document Server
  3. On the server with your application (DMS) execute wget https://documentserver_address/

Send me the screenshots of the commands outputs.