Call convert server api: ConvertService.ashx, return error: -3

i call convert api by following curl command:

# start test http server
ruby -run -e httpd . -p 8000

# request api by curl, my client ip is: 192.168.1.115
curl -H 'Content-Type: application/json' \
     -H 'Accept: application/json'  \
     -d '{"async":false,"url":"http://192.168.1.115:8000/file3.docx","outputtype":"pdf","filetype":"docx","title":"file3.docx","key":"personal_8199907371364626998_test_file3_4.docx","region":"zh"}' \
     -X POST \
      http://192.168.1.120:8001/ConvertService.ashx

then will get error return :
{error: -3 }
or
{“percent”:0,“endConvert”:false}

converter log output:

[2024-11-05T09:47:46.216] [ERROR] [localhost] [personal_8199907371364626998_test_file3_3.docx] [userId] nodeJS - stdout:
[2024-11-05T09:47:46.216] [ERROR] [localhost] [personal_8199907371364626998_test_file3_3.docx] [userId] nodeJS - stderr:TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
DoctRenderer:<result><error code="run" /></result>

[2024-11-05T09:47:46.217] [ERROR] [localhost] [personal_8199907371364626998_test_file3_3.docx] [userId] nodeJS - ExitCode (code=80;signal=null;error:-80)
[2024-11-05T09:51:33.873] [ERROR] [localhost] [personal_8199907371364626998_test_file3_4.docx] [userId] nodeJS - stdout:
[2024-11-05T09:51:33.874] [ERROR] [localhost] [personal_8199907371364626998_test_file3_4.docx] [userId] nodeJS - stderr:TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
TypeError: window.InitNativeEditors is not a function
    at <anonymous>:1:8
DoctRenderer:<result><error code="run" /></result>

[2024-11-05T09:51:33.875] [ERROR] [localhost] [personal_8199907371364626998_test_file3_4.docx] [userId] nodeJS - ExitCode (code=80;signal=null;error:-80)

i don’t know the what cause this error, and how to resolve it. i hava searched the docservice codes ,can not found helpful information to resolve this error.

Hello @isNaN

Your curl is quite unexpected. Please try sending the request in following format:

curl --location 'http://documentserver/ConvertService.ashx' \
--header 'Content-Type: text/plain' \
--data '{
    "async": false,
    "filetype": "docx",
    "key": "key",
    "outputtype": "pdf",
    "title": "Document.docx",
    "url": "https://example.com/url-to-example-document.docx"
}'

In data you can specify all necessary parameters supported by Conversion service. You can find full list of them here: Conversion API

Note: if you are using JWT, make sure to sign the request.

Hi Constantine:

thanks return. I have tryied to send request by your command code, and get the same error.

$ curl --location http://192.168.1.120:8001/ConvertService.ashx \
     --header 'Content-Type: text/plain' \
     --data   '{"async":false,"url":"http://192.168.1.115:8000/file3.docx","outputtype":"pdf","filetype":"docx","title":"file3.docx","key":"personal_8199907371364626998_test_file3_5.docx" }'

command return data:

<?xml version="1.0" encoding="utf-8"?><FileResult><Error>-3</Error></FileResult>

Additional background information:

  1. Not use jwt
    
  2. OnlyOffice version: 8.1.3
    
  3. Operating System: Linux ETSME 4.19.232 #35 SMP Wed Oct 30 20:41:54 CST 2024 aarch64 GNU/Linux
    

my biggest puzzle is: “Where does the error ‘window.InitNativeEditors is not a function’ come from, and what causes it?” I couldn’t find any related keywords in the open-source code, and the Convert API documentation does not provide specific reasons for this error or mention an error code -80. Therefore, I’m unsure how to resolve this issue.

Try converting another file to see if it comes from this specific one. By the way, as I can see you are running Document Server in Docker, right? If so, check if your Document Server can access the file via provided link from inside the container. You can connect to the container with docker exec -it <ID> bash and get the file with, for instance, wget.

Yes, the server runing on docker。I try to convert other file type to pdf, rand result is:

  1. docx => pdf,failed, convert error code: -80, log output
  2. pptx => pdf, failed, convert error code: -80
  3. xlsx => pdf, success :joy:

following is convert log output

[2024-11-06T13:15:37.498] [ERROR] [localhost] [test_file_demo1_1.docx] [userId] nodeJS - stderr:TypeError: Cannot read property 'length' of null
    at b.Pue (<anonymous>:17012:447)
    at b.Que (<anonymous>:17013:41)
    at d.mC (<anonymous>:17019:245)
    at Object.mC.Rue (<anonymous>:13140:49)
    at e.Yw (<anonymous>:13310:472)
    at Jo.y.hm (<anonymous>:20896:284)
    at xs.y.hm (<anonymous>:19414:58)
    at Gx (<anonymous>:20681:98)
    at Zd.y.eda (<anonymous>:19879:431)
    at Zd.y.sG (<anonymous>:19851:487)
DoctRenderer:<result><error code="calculate" /></result>

[2024-11-06T13:15:37.499] [ERROR] [localhost] [test_file_demo1_1.docx] [userId] nodeJS - ExitCode (code=80;signal=null;error:-80)
[2024-11-06T13:17:51.335] [ERROR] [localhost] [test_file_demo2_2.pptx] [userId] nodeJS - stdout:
[2024-11-06T13:17:51.338] [ERROR] [localhost] [test_file_demo2_2.pptx] [userId] nodeJS - stderr:TypeError: Cannot read property 'length' of null
    at b.rre (<anonymous>:16911:447)
    at b.sre (<anonymous>:16912:41)
    at d.gN (<anonymous>:16918:245)
    at Object.gN.KRf (<anonymous>:12964:228)
    at e.G5 (<anonymous>:13124:166)
    at b.e.Nnh (<anonymous>:12990:39)
    at b.e.Onh (<anonymous>:12988:493)
    at b.e.Eoc (<anonymous>:12987:37)
    at b.x1b (<anonymous>:22172:53)
    at <anonymous>:22171:248
DoctRenderer:<result><error code="calculate" /></result>