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.81k stars 1.08k forks source link

Error while converting docx File to PDF over Conversion API #1806

Open Moedav opened 2 years ago

Moedav commented 2 years ago

Do you want to request a feature or report a bug? Bug What is the current behavior? If I want to convert a docx file with size around 7MB (Umcompromized ~ 110 MB) over the conversion api, I get an error response with error code -3. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Example Get Request: My OnlyOffice DocumentServer ist Running on http://localhost:8082/

http://localhost:8082/ConvertService.ashx?async=true&filetype=docx&key=36944test421&outputtype=pdf&title=Converted.docx&url=http://localhost:8080/api/files/36943

What is the expected behavior?

getting a response with for example followinig result after document is converted:

{
    "fileUrl": "http://localhost:8082/cache/files/conv_36943-test421_pdf/output.pdf/Converted.pdf?md5=xsxM7kBfGjau442LyJiTbQ&expires=1653927952&filename=Converted.pdf",
    "fileType": "pdf",
    "percent": 100,
    "endConvert": true
}

Did this work in previous versions of DocumentServer? I dont know DocumentServer Docker tag: latest

Host Operating System: Ubuntu 18.04.6 LTS

My Error Logs

[2022-05-30T15:36:17.929] [ERROR] nodeJS - error spawnAsync(id=conv_36944-test_pdf)
Error: /var/www/onlyoffice/documentserver/server/FileConverter/bin/x2t exited with signal: SIGILL
    at ChildProcess.completionListener (/snapshot/server/build/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
    ...
    at spawnAsync (/snapshot/server/build/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:8:21)
    at ExecuteTask (/snapshot/server/build/server/FileConverter/sources/converter.js)
    at ExecuteTask.next (<anonymous>)
    at /snapshot/server/build/server/FileConverter/sources/converter.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/FileConverter/node_modules/co/index.js:65:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-05-30T15:36:17.930] [ERROR] nodeJS - stdout (id=conv_36944-test_pdf):
[2022-05-30T15:36:17.930] [ERROR] nodeJS - stderr (id=conv_36944-test_pdf):
#
# Fatal javascript OOM in CALL_AND_RETRY_LAST
#

Received signal 4 ILL_ILLOPN 7f10925db769

==== C stack trace ===============================

 [0x7f10925dc9b2]
 [0x7f10919d23c0]
 [0x7f10925db769]
 [0x7f1091df71fd]
 [0x7f1091df73fc]
 [0x7f1091fc48df]
 [0x7f109253a9fc]
 [0x129a935046fd]
[end of stack trace]

[2022-05-30T15:36:17.930] [ERROR] nodeJS - ExitCode (code=0;signal=SIGILL;error:-80;id=conv_36944-test_pdf)

I dont know if this might be the reason, but maybe the nodejs server isn't using all the memory and is limitted to 4GB.

I already increased the possible FileConverter Size: Here is the local.json config with the FileConverterSettings:

"FileConverter": {
        "converter": {
          "maxDownloadBytes": 1048576000,
          "inputLimits": [
              {
              "type": "docx;dotx;docm;dotm" ,
                "zip": {
                    "uncompressed": "500MB",
                    "template": "*.xml"
                }
              },
              {
              "type": "xlsx;xltx;xlsm;xltm",
                "zip": {
                    "uncompressed": "300MB",
                    "template": "*.xml"
                }
              },
              {
              "type": "pptx;ppsx;potx;pptm;ppsm;potm",
                "zip": {
                    "uncompressed": "50MB",
                    "template": "*.xml"
                }
              }
          ]
      }
  },
ShockwaveNN commented 2 years ago

Hi, I think i need this file you've trying to convert

Moedav commented 2 years ago

Hey, thank you for your response. Here is an example document, that fails. With for example 10 pages of this document, it works fine. employee-entries.docx

I hope it helps

ShockwaveNN commented 2 years ago

I can confirm that something is wrong with your file, I do not get SIGILL message, but I got -93 error, we need some time to localize the problem

Moedav commented 2 years ago

Ok, thanks for looking into it. I will use a workaround as long as you need to fix this. I splitted the document into multiple smaller documents with around 100 pages and then I will merge all PDFs together in the end.

l8556 commented 2 years ago

Hi @Moedav

Thank you for your issue I can confirm - this is a bug. Issue 57465 in our private issue tracker.

menghan3306 commented 2 years ago

I ran into the same problem when converting the DOCX to PDF files.

Version: 7.1.1. Build: 23

I think the DOCX file is too large (more than 3,000 pages), is there any good solution?

ShockwaveNN commented 2 years ago

@menghan3306 Sorry, currently there is no solution only workaround mentioned earlier

menghan3306 commented 2 years ago

@menghan3306 Sorry, currently there is no solution only workaround mentioned earlier

Thinks for reply. But what is the solution mentioned earlier? Do you mean split the document into multiple smaller documents?

ShockwaveNN commented 2 years ago

@menghan3306 Yes