Download fail

  1. I install onlyoffice
  2. I download java spring example.
  3. I can upload file and download file but when I edit file fail.
  4. I find the DocsAPI config
    this url is right. I can use it down load file in browser(Although a little slow). so I don’t konw how to continue.
    Actually, I do nothing except configure “files.docservice.url.site”.

4.

ok, I made a mistake because I neglected this step。

Hello @379944104

Did this 6th step solved the problem?

hello @379944104 ,I have the same problem as you. Can you give me more details. :grinning:

你好,你的onlyoffice服务是安装在linux上,然后在windows本地运行的吗

Hello @caiwei

I see that the issue has changed from your previous thread:

Could you please describe how Document Server and Java Spring Example are installed?
Do I understand it correctly that you have something like a virtual machine on your Windows server and on that virtual machine Document Server is installed via Docker?

Sort of, but I’m not using a virtual machine, I’m renting a server

Please describe the environment in details.
Are Document Server and Java Spring Example installed on the same machine? How are they running? Is Java Spring running directly on the Windows server? How is Document Server running then?

No, onlyoffice and the java spring example are not on the same computer. First, I installed onlyoffice on a rented linux server using docker, then I downloaded the java spring example from the official website on windows and ran it in the idea.

logs as follow:

[2023-05-25T02:07:48.854] [ERROR] [localhost] [695304611] [1] nodeJS - postData error: url = //track?fileName=new+%283%29.docx&userAddress=E%3A%5CCode%5CGitHub%5CJava+Spring+Example%5Cdocuments%5C192.168.80.1%5C;data = {"key":"695304611","status":1,"users":["1"],"actions":[{"type":1,"userid":"1"}],"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiI2OTUzMDQ2MTEiLCJzdGF0dXMiOjEsInVzZXJzIjpbIjEiXSwiYWN0aW9ucyI6W3sidHlwZSI6MSwidXNlcmlkIjoiMSJ9XSwiaWF0IjoxNjg0OTgwNDY4LCJleHAiOjE2ODQ5ODA3Njh9.EZ2JwweJsa9Mrwv_0PedaMJIWcgXvKzYTyW_6pnDdew"} Error: Invalid URI "//track?fileName=new+%283%29.docx&userAddress=E%3A%5CCode%5CGitHub%5CJava+Spring+Example%5Cdocuments%5C192.168.80.1%5C"
    at Request.init (/snapshot/server/build/server/Common/node_modules/request/request.js:273:31)
    at new Request (/snapshot/server/build/server/Common/node_modules/request/request.js:127:8)
    at request (/snapshot/server/build/server/Common/node_modules/request/index.js:53:10)
    at /snapshot/server/build/server/Common/node_modules/request/index.js:61:12
    at Function.post (/snapshot/server/build/server/Common/node_modules/request/index.js:100:12)
    at /snapshot/server/build/server/Common/sources/utils.js
    at new Promise (<anonymous>)
    at Object.postRequestPromise (/snapshot/server/build/server/Common/sources/utils.js)
    at sendServerRequest (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at sendServerRequest.next (<anonymous>)
    at sendStatusDocument (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at sendStatusDocument.next (<anonymous>)
    at endAuth (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at endAuth.next (<anonymous>)
    at auth (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at auth.next (<anonymous>)

Please check if these servers can be accessed by each other.
From Docker container with Document Server perform wget <java_spring_address> and from Windows via Command Line use curl <document_server_address>. After that please share results.

Also, please provide \src\main\resources\application.properties config of the Java Spring Example from your Windows machine for analysis.

Using curl on windows, I get the following result:

I used the wget command on a linux server with the following results:

the config of the Java Spring Example as follow:

server.version=1.5.0

server.address=
server.port=4000

filesize-max=5242880

files.storage=
files.storage.folder=documents

files.docservice.fillforms-docs=.oform|.docx
files.docservice.viewed-docs=.pdf|.djvu|.xps|.oxps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt|.docxf
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.timeout=120000
files.docservice.history.postfix=-hist

files.docservice.url.site=http://43.138.121.194:8090/
files.docservice.url.command=coauthoring/CommandService.ashx
files.docservice.url.api=web-apps/apps/api/documents/api.js
files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html
files.docservice.url.example=/
files.docservice.url.converter=ConvertService.ashx

files.docservice.secret=xhFxx6uD6ONY0djHMvhoq72uFAVV9O

files.docservice.header=Authorization

files.docservice.verify-peer-off=true

files.docservice.languages=en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (People's Republic of China)|zh-TW:Chinese (Traditional, Taiwan)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lv:Latvian|lo:Lao|ms:Malay (Malaysia)|nb:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:TestPro Language

spring.datasource.url=jdbc:h2:mem:usersdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
hibernate.ddl-auto
spring.h2.console.enabled=true
spring.h2.console.path=/h2

url.index=/
url.converter=/converter
url.editor=/editor
url.track=/track
url.download=/download

logo.image=
logo.imageEmbedded=
logo.url=https://www.onlyoffice.com

So as I can see there is an issue with connectivity between servers. I think you need to resolve it in the first place before we can move on.

Ok, thank you very much for your answer

hello@ Constantine,I’m sorry to bother you again.When I put the java spring example and onlyoffice server on the linux server, the download failed error still occurs when I run the java spring example. The log information in out.log is as follows:

[2023-05-31T14:25:00.502] [ERROR] [localhost] [-22343002] [1] nodeJS - postData error: url = //track?fileName=new.docx&userAddress=%2Froot%2Fdocuments%2F127.0.0.1%2F;data = {"key":"-22343002","status":1,"users":["1"],"actions":[{"type":1,"userid":"1"}],"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiItMjIzNDMwMDIiLCJzdGF0dXMiOjEsInVzZXJzIjpbIjEiXSwiYWN0aW9ucyI6W3sidHlwZSI6MSwidXNlcmlkIjoiMSJ9XSwiaWF0IjoxNjg1NTQzMTAwLCJleHAiOjE2ODU1NDM0MDB9.hP5VK2KUNLoCnO4emoz-4CbacfGxsGxY3DupnSGmvfk"} Error: Invalid URI "//track?fileName=new.docx&userAddress=%2Froot%2Fdocuments%2F127.0.0.1%2F"
    at Request.init (/snapshot/server/build/server/Common/node_modules/request/request.js:273:31)
    at new Request (/snapshot/server/build/server/Common/node_modules/request/request.js:127:8)
    at request (/snapshot/server/build/server/Common/node_modules/request/index.js:53:10)
    at /snapshot/server/build/server/Common/node_modules/request/index.js:61:12
    at Function.post (/snapshot/server/build/server/Common/node_modules/request/index.js:100:12)
    at /snapshot/server/build/server/Common/sources/utils.js
    at new Promise (<anonymous>)
    at Object.postRequestPromise (/snapshot/server/build/server/Common/sources/utils.js)
    at sendServerRequest (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at sendServerRequest.next (<anonymous>)
    at sendStatusDocument (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at sendStatusDocument.next (<anonymous>)
    at endAuth (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at endAuth.next (<anonymous>)
    at auth (/snapshot/server/build/server/DocService/sources/DocsCoServer.js)
    at auth.next (<anonymous>)

It is ok, do not hesitate asking.

So now both Document Server and Java Spring Example are now located on the same machine, is it correct? To sum up: you have Document Server running in Docker container and Java Spring Example is running under Docker Compose method.

Please share your /src/main/resources/application.properties config for analysis.

yes, my /src/main/resources/application.properties config as follow:

server.version=1.5.0

server.address=
server.port=4000

filesize-max=5242880

files.storage=/usr/fileTemp
files.storage.folder=documents

files.docservice.fillforms-docs=.oform|.docx
files.docservice.viewed-docs=.pdf|.djvu|.xps|.oxps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt|.docxf
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.timeout=120000
files.docservice.history.postfix=-hist

files.docservice.url.site=http://43.138.121.194:8090/
files.docservice.url.command=coauthoring/CommandService.ashx
files.docservice.url.api=web-apps/apps/api/documents/api.js
files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html
files.docservice.url.example=/
files.docservice.url.converter=ConvertService.ashx

files.docservice.secret=asdfghjkL123ZZW

files.docservice.header=Authorization

files.docservice.verify-peer-off=true

files.docservice.languages=en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (People's Republic of China)|zh-TW:Chinese (Traditional, Taiwan)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lv:Latvian|lo:Lao|ms:Malay (Malaysia)|nb:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:TestPro Language

spring.datasource.url=jdbc:h2:mem:usersdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
hibernate.ddl-auto
spring.h2.console.enabled=true
spring.h2.console.path=/h2

url.index=/
url.converter=/converter
url.editor=/editor
url.track=/track
url.download=/download

logo.image=
logo.imageEmbedded=
logo.url=https://www.onlyoffice.com

Thanks. I can see that you have / as a value for this string:

files.docservice.url.example=/

I have tested with it and it resulted in error. Please try removing it like that:

files.docservice.url.example=

And after that check the situation again.