ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.87k stars 1.09k forks source link

documentserver 'download failed' #1702

Closed tbswork1 closed 2 years ago

tbswork1 commented 2 years ago

Do you want to request a feature or report a bug? implementing a wopi host, debugging with onlyoffice docs server.

What is the current behavior? Browser shows 'Download failed'. But simulating the same request with curl command running on same host of docs server, file can be downloaded . The problem occurs after CheckFileInfo request excuted successfully.

The following is from docs server log:

[2022-03-25T06:05:36.148] [ERROR] nodeJS - error downloadFile:url=http://192.168.217.1/wopi/files/L2F2ZXJzaW9udGVzdC5kb2N4/contents?access_token=xxxxxxxxxxxxxxxxxxxx;attempt=1;code:ESOCKETTIMEDOUT;connect:false;(id=view.L2F2ZXJzaW9udGVzdC5kb2N4.undefined)^M
Error: ESOCKETTIMEDOUT
    at ClientRequest.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:816:19)
    at Object.onceWrapper (events.js:519:28)
    at ClientRequest.emit (events.js:400:28)
    at Socket.emitRequestTimeout (_http_client.js:790:9)
    at Object.onceWrapper (events.js:519:28)
    at Socket.emit (events.js:412:35)
    at Socket._onTimeout (net.js:484:8)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. n/a

What is the expected behavior? download file

Did this work in previous versions of DocumentServer? no idea

DocumentServer version: 7.0.1

Operating System: Ubuntu 20.04

Browser version: Chrome 99.

ShockwaveNN commented 2 years ago

Hi, I think there is may be some troubles with proxy or firewall

Try to tempraly disable ufw if it's enabled

tbswork1 commented 2 years ago

Curl and telnet can connect. Also checkfileinfo is executed by docs server too, which should have failed too if it is firewall issue.

ShockwaveNN commented 2 years ago

That is the error on backend side? in logs /var/log/onlyoffice

tbswork1 commented 2 years ago

That is the error on backend side? in logs /var/log/onlyoffice

yes from /var/log/onlyoffice/documentserver/converter/out.log.

ShockwaveNN commented 2 years ago

Is this error can be reproduced with /example page (enabled via /welcome)?

To rule out if this problem is related to WOPI or can be reproduced without WOPI

ShockwaveNN commented 2 years ago

And another question - is there any error on WOPI side? In logs of WOPI server, seems that ESOCKETTIMEDOUT may raise an error on other side of server

tbswork1 commented 2 years ago

Is this error can be reproduced with /example page (enabled via /welcome)?

/example page works fine (clicking on any of the examples all show perfectly, API or WOPI.

ShockwaveNN commented 2 years ago

Ok seems this is problem somehow related to exact WOPI implementation, I'll redirect issue to my collegue

tbswork1 commented 2 years ago

And another question - is there any error on WOPI side? In logs of WOPI server, seems that ESOCKETTIMEDOUT may raise an error on other side of server

no error on our WOPI server. The Docs server however doesn't send any GetFile request after the 1ST occurrence of 'Download failed', i.e. subsequently it simply says 'Download failed' after CheckFileInfo because our server never detects GetFile again. This makes it very difficult to debug.

igwyd commented 2 years ago

Hello @tbswork1, i can't reproduse your error. Can you enable debug logs in documentserver (set level ALL) and attach it please?

konovalovsergey commented 2 years ago

it looks like socket inactivity timeout is triggered. try to increase connectionAndInactivity config property

tbswork1 commented 2 years ago

It seems to be a proxy problem. The browser has enabled proxy and after disabling it the download works. It is strange though checkfileinfo request, which runs before download, doesn't have the issue.