File get corrupted when saving a document to custom wopi host

Do you want to: Report a bug

Document Server version: Docker (9.0.2) official image - docker compose file
OS: Linux amd64 - Contabo - Ubuntu 24.04
Browser version: Chrome Latest
Additional information: I’m using custom WOPI host provider using Laravel (nagi1/laravel-wopi)

The Problem:
When editing any file (docx, xlsx, pptx) in the Document Server, the file gets corrupted after saving. Showing this image.

[2025-06-30T13:15:47.914] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - error spawnAsync Error: /var/www/onlyoffice/documentserver/server/FileConverter/bin/x2t /tmp/ASC_CONVERT2025530-lydja8.egiag/params.xml exited with non-zero code: 89
    at ChildProcess.completionListener (/snapshot/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:639:26)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)
    ...
    at spawnAsync (/snapshot/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawnProcess (/snapshot/server/FileConverter/sources/converter.js)
    at spawnProcess.next (<anonymous>)
    at ExecuteTask (/snapshot/server/FileConverter/sources/converter.js)
    at ExecuteTask.next (<anonymous>)
    at /snapshot/server/FileConverter/sources/converter.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/FileConverter/node_modules/co/index.js:65:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce:

  1. Open a document in the Document Server.
  2. Make any changes to the document.
  3. Save the document. (auto save or manual save)

Expected result:
The document should save without corruption and retain all changes made.

Actual result:
The document gets corrupted after saving, and the following error is displayed

I’m running docker logs with logs4js debug level, here’s the full log output:

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2025-06-30T13:15:47.680] [INFO] [localhost] [63849] [Unknown User] nodeJS - Start Task

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2025-06-30T13:15:47.692] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - End command

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2025-06-30T13:15:47.701] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - getWopiFileUrl url=https://wopi-host.com/wopi/files/63849/contents?access_token=2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV; headers={"X-WOPI-MaxExpectedSize":104857600,"X-WOPI-Proof":"gHz7knsLTQKQaWfChxo8PmHjL/HeCLVfIAiMsNXIl4S3ltyVzduF5T+dE3bmFZqwlRQSTbNkz17ZmwGM1sDYbHp3m2MV0afawf6RP+Pw0Kawbq1De9QvpCifcLKEhVo+pVb5KNNLa/InEVQmQcm18ydDQx0nXYplrb6LgBksWoafEeRj1Fd2BdAQrxMRy65CnMdJmIXFu41vy6det7mTcI/IFb/KuTUuhWgojtOXbzVtGjr46pH25NnasdSE3p6dRM2Govv3SvSmQK14eVtQ91Z4cOeAbpohqpHibcmdBZu3190APh5W80zH2EZobAuuZSTV3mbOi6ZtksciyrDv7A==","X-WOPI-ProofOld":"gHz7knsLTQKQaWfChxo8PmHjL/HeCLVfIAiMsNXIl4S3ltyVzduF5T+dE3bmFZqwlRQSTbNkz17ZmwGM1sDYbHp3m2MV0afawf6RP+Pw0Kawbq1De9QvpCifcLKEhVo+pVb5KNNLa/InEVQmQcm18ydDQx0nXYplrb6LgBksWoafEeRj1Fd2BdAQrxMRy65CnMdJmIXFu41vy6det7mTcI/IFb/KuTUuhWgojtOXbzVtGjr46pH25NnasdSE3p6dRM2Govv3SvSmQK14eVtQ91Z4cOeAbpohqpHibcmdBZu3190APh5W80zH2EZobAuuZSTV3mbOi6ZtksciyrDv7A==","X-WOPI-TimeStamp":"638868861476900000","X-WOPI-ClientVersion":"9.0.2.9"}
[2025-06-30T13:15:47.704] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - isAllowDirectRequest url in jwt token res=true
[2025-06-30T13:15:47.868] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - downloadFile complete filesize=38375 sha256=cf4dee97b768157250b7d1cd913dc2bee4904b28fe9903ce9187ce870076b3f4
[2025-06-30T13:15:47.914] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - error spawnAsync Error: /var/www/onlyoffice/documentserver/server/FileConverter/bin/x2t /tmp/ASC_CONVERT2025530-lydja8.egiag/params.xml exited with non-zero code: 89
    at ChildProcess.completionListener (/snapshot/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:639:26)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)
    ...
    at spawnAsync (/snapshot/server/FileConverter/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawnProcess (/snapshot/server/FileConverter/sources/converter.js)
    at spawnProcess.next (<anonymous>)
    at ExecuteTask (/snapshot/server/FileConverter/sources/converter.js)
    at ExecuteTask.next (<anonymous>)
    at /snapshot/server/FileConverter/sources/converter.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/FileConverter/node_modules/co/index.js:65:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2025-06-30T13:15:47.915] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - stdout:
[2025-06-30T13:15:47.915] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - stderr:
[2025-06-30T13:15:47.915] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - ExitCode (code=89;signal=null;error:-89)
[2025-06-30T13:15:47.916] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - copyOrigin complete
[2025-06-30T13:15:47.930] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - processUploadToStorage complete
[2025-06-30T13:15:47.934] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - output (data={"ctx":{"tenant":"localhost","docId":"63849","userId":"Unknown User","wopiSrc":"https://wopi-host.com/wopi/files/63849"},"cmd":{"wopiParams":{"commonInfo":{"lockId":"63849","fileInfo":{"BaseFileName":"bigdata pap.docx","OwnerId":"10003","Size":38375,"Version":"3","UserId":"Unknown User","UserFriendlyName":"Leanne Reynolds III","ReadOnly":false,"UserCanNotWriteRelative":true,"UserCanWrite":true,"FileExtension":".docx","LastModifiedTime":"2025-06-30T13:14:15+00:00","DisablePrint":false,"HidePrintOption":false,"DisableExport":false,"HideExportOption":false,"DisableCopy":false,"SupportsUserInfo":false,"SupportsDeleteFile":false,"SupportsLocks":true,"SupportsGetLock":true,"SupportsUpdate":true,"SupportsRename":false,"SupportsExtendedLockLength":true,"ClosePostMessage":true}},"userAuth":{"wopiSrc":"https://wopi-host.com/wopi/files/63849","access_token":"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","access_token_ttl":0,"userSessionId":"63849","mode":"edit"},"LastModifiedTime":"2025-06-30T13:14:15+00:00"},"c":"open","id":"63849","userid":"Unknown User","format":"docx","url":"https://wopi-host.com/wopi/files/63849/contents?access_token=2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","title":"bigdata pap.docx","outputformat":8193,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":-89,"lcid":9,"nobase64":true,"convertToOrigin":".pdf.xps.oxps.djvu"}})
[2025-06-30T13:15:47.935] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - postProcess
[2025-06-30T13:15:47.940] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - deleteFolderRecursive
[2025-06-30T13:15:47.941] [INFO] [localhost] [63849] [Unknown User] nodeJS - End Task

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2025-06-30T13:15:47.945] [INFO] [localhost] [63849] [Unknown User] nodeJS - receiveTask start: {"ctx":{"tenant":"localhost","docId":"63849","userId":"Unknown User","wopiSrc":"https://wopi-host.com/wopi/files/63849"},"cmd":{"wopiParams":{"commonInfo":{"lockId":"63849","fileInfo":{"BaseFileName":"bigdata pap.docx","OwnerId":"10003","Size":38375,"Version":"3","UserId":"Unknown User","UserFriendlyName":"Leanne Reynolds III","ReadOnly":false,"UserCanNotWriteRelative":true,"UserCanWrite":true,"FileExtension":".docx","LastModifiedTime":"2025-06-30T13:14:15+00:00","DisablePrint":false,"HidePrintOption":false,"DisableExport":false,"HideExportOption":false,"DisableCopy":false,"SupportsUserInfo":false,"SupportsDeleteFile":false,"SupportsLocks":true,"SupportsGetLock":true,"SupportsUpdate":true,"SupportsRename":false,"SupportsExtendedLockLength":true,"ClosePostMessage":true}},"userAuth":{"wopiSrc":"https://wopi-host.com/wopi/files/63849","access_token":"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","access_token_ttl":0,"userSessionId":"63849","mode":"edit"},"LastModifiedTime":"2025-06-30T13:14:15+00:00"},"c":"open","id":"63849","userid":"Unknown User","format":"docx","url":"https://wopi-host.com/wopi/files/63849/contents?access_token=2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","title":"bigdata pap.docx","outputformat":8193,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":-89,"lcid":9,"nobase64":true,"convertToOrigin":".pdf.xps.oxps.djvu"}}

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2025-06-30T13:15:47.950] [INFO] [localhost] [63849] [Unknown User] nodeJS - ackTask addResponse

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2025-06-30T13:15:47.954] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - getCallbackByUserIndex: userIndex = undefined callbacks = {"userIndex":1,"callback":"{\"lockId\":\"63849\",\"fileInfo\":{\"BaseFileName\":\"bigdata pap.docx\",\"OwnerId\":\"10003\",\"Size\":38375,\"Version\":\"3\",\"UserId\":\"Unknown User\",\"UserFriendlyName\":\"Leanne Reynolds III\",\"ReadOnly\":false,\"UserCanNotWriteRelative\":true,\"UserCanWrite\":true,\"FileExtension\":\".docx\",\"LastModifiedTime\":\"2025-06-30T13:14:15+00:00\",\"DisablePrint\":false,\"HidePrintOption\":false,\"DisableExport\":false,\"HideExportOption\":false,\"DisableCopy\":false,\"SupportsUserInfo\":false,\"SupportsDeleteFile\":false,\"SupportsLocks\":true,\"SupportsGetLock\":true,\"SupportsUpdate\":true,\"SupportsRename\":false,\"SupportsExtendedLockLength\":true,\"ClosePostMessage\":true}}"}{"userIndex":2,"callback":"{\"wopiSrc\":\"https://wopi-host.com/wopi/files/63849\",\"access_token\":\"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV\",\"access_token_ttl\":0,\"userSessionId\":\"63849\",\"mode\":\"edit\"}"}
[2025-06-30T13:15:47.954] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - getCallbackByUserIndex: userIndex = 1 callbacks = {"userIndex":1,"callback":"{\"lockId\":\"63849\",\"fileInfo\":{\"BaseFileName\":\"bigdata pap.docx\",\"OwnerId\":\"10003\",\"Size\":38375,\"Version\":\"3\",\"UserId\":\"Unknown User\",\"UserFriendlyName\":\"Leanne Reynolds III\",\"ReadOnly\":false,\"UserCanNotWriteRelative\":true,\"UserCanWrite\":true,\"FileExtension\":\".docx\",\"LastModifiedTime\":\"2025-06-30T13:14:15+00:00\",\"DisablePrint\":false,\"HidePrintOption\":false,\"DisableExport\":false,\"HideExportOption\":false,\"DisableCopy\":false,\"SupportsUserInfo\":false,\"SupportsDeleteFile\":false,\"SupportsLocks\":true,\"SupportsGetLock\":true,\"SupportsUpdate\":true,\"SupportsRename\":false,\"SupportsExtendedLockLength\":true,\"ClosePostMessage\":true}}"}{"userIndex":2,"callback":"{\"wopiSrc\":\"https://wopi-host.com/wopi/files/63849\",\"access_token\":\"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV\",\"access_token_ttl\":0,\"userSessionId\":\"63849\",\"mode\":\"edit\"}"}
[2025-06-30T13:15:47.954] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - getCallbacks: callbacks = {"userIndex":1,"callback":"{\"lockId\":\"63849\",\"fileInfo\":{\"BaseFileName\":\"bigdata pap.docx\",\"OwnerId\":\"10003\",\"Size\":38375,\"Version\":\"3\",\"UserId\":\"Unknown User\",\"UserFriendlyName\":\"Leanne Reynolds III\",\"ReadOnly\":false,\"UserCanNotWriteRelative\":true,\"UserCanWrite\":true,\"FileExtension\":\".docx\",\"LastModifiedTime\":\"2025-06-30T13:14:15+00:00\",\"DisablePrint\":false,\"HidePrintOption\":false,\"DisableExport\":false,\"HideExportOption\":false,\"DisableCopy\":false,\"SupportsUserInfo\":false,\"SupportsDeleteFile\":false,\"SupportsLocks\":true,\"SupportsGetLock\":true,\"SupportsUpdate\":true,\"SupportsRename\":false,\"SupportsExtendedLockLength\":true,\"ClosePostMessage\":true}}"}{"userIndex":2,"callback":"{\"wopiSrc\":\"https://wopi-host.com/wopi/files/63849\",\"access_token\":\"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV\",\"access_token_ttl\":0,\"userSessionId\":\"63849\",\"mode\":\"edit\"}"}
[2025-06-30T13:15:47.954] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - parseWopiCallback wopiParams:{"commonInfo":{"lockId":"63849","fileInfo":{"BaseFileName":"bigdata pap.docx","OwnerId":"10003","Size":38375,"Version":"3","UserId":"Unknown User","UserFriendlyName":"Leanne Reynolds III","ReadOnly":false,"UserCanNotWriteRelative":true,"UserCanWrite":true,"FileExtension":".docx","LastModifiedTime":"2025-06-30T13:14:15+00:00","DisablePrint":false,"HidePrintOption":false,"DisableExport":false,"HideExportOption":false,"DisableCopy":false,"SupportsUserInfo":false,"SupportsDeleteFile":false,"SupportsLocks":true,"SupportsGetLock":true,"SupportsUpdate":true,"SupportsRename":false,"SupportsExtendedLockLength":true,"ClosePostMessage":true}},"userAuth":{"wopiSrc":"https://wopi-host.com/wopi/files/63849","access_token":"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","access_token_ttl":0,"userSessionId":"63849","mode":"edit"},"LastModifiedTime":"2025-06-30T13:14:15+00:00"}
[2025-06-30T13:15:47.955] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - receiveTask publish: {"type":"open","status":"needparams"}

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2025-06-30T13:15:47.950] [INFO] [localhost] [63849] [Unknown User] nodeJS - ackTask ack

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2025-06-30T13:15:47.956] [INFO] [localhost] [63849] [Unknown User] nodeJS - receiveTask end
[2025-06-30T13:15:47.959] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - pubsub message start:{"type":7,"ctx":{"tenant":"localhost","docId":"63849","userId":"Unknown User","wopiSrc":"https://wopi-host.com/wopi/files/63849"},"cmd":{"wopiParams":{"commonInfo":{"lockId":"63849","fileInfo":{"BaseFileName":"bigdata pap.docx","OwnerId":"10003","Size":38375,"Version":"3","UserId":"Unknown User","UserFriendlyName":"Leanne Reynolds III","ReadOnly":false,"UserCanNotWriteRelative":true,"UserCanWrite":true,"FileExtension":".docx","LastModifiedTime":"2025-06-30T13:14:15+00:00","DisablePrint":false,"HidePrintOption":false,"DisableExport":false,"HideExportOption":false,"DisableCopy":false,"SupportsUserInfo":false,"SupportsDeleteFile":false,"SupportsLocks":true,"SupportsGetLock":true,"SupportsUpdate":true,"SupportsRename":false,"SupportsExtendedLockLength":true,"ClosePostMessage":true}},"userAuth":{"wopiSrc":"https://wopi-host.com/wopi/files/63849","access_token":"2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","access_token_ttl":0,"userSessionId":"63849","mode":"edit"},"LastModifiedTime":"2025-06-30T13:14:15+00:00"},"c":"open","id":"63849","userid":"Unknown User","format":"docx","url":"https://wopi-host.com/wopi/files/63849/contents?access_token=2IN6iVS0l4JnuOJ7Y7OM2yaf1Ku6DGz1EkTOVRBV","title":"bigdata pap.docx","outputformat":8193,"outputpath":"Editor.bin","embeddedfonts":false,"status_info":-89,"lcid":9,"nobase64":true,"convertToOrigin":".pdf.xps.oxps.djvu"},"output":{"type":"documentOpen","data":{"type":"open","status":"needparams"}},"needUrlKey":"63849/origin.docx","needUrlMethod":1,"needUrlType":1}
[2025-06-30T13:15:47.961] [DEBUG] [localhost] [63849] [Unknown User] nodeJS - sendData: type = documentOpen
[2025-06-30T13:16:48.952] [DEBUG] [localhost] [docId] [userId] nodeJS - expireDoc connections.length = 1
[2025-06-30T13:16:49.221] [INFO] [localhost] [docId] [userId] nodeJS - checkDocumentExpire start
[2025-06-30T13:16:49.221] [INFO] [localhost] [docId] [userId] nodeJS - checkDocumentExpire end: startSaveCount = 0, removedCount = 0

Note: https://wopi-host.com is masked link from the original it sometimes works and save the file but in many situations it corrupts the file.

Problem:

Corrupted File:
bigdata pap-coruputed.docx (37.5 KB)

Original File:
bigdata pap-coruputed.docx (37.5 KB)

Hello @nagi

First of all, as I can see, attached files are actually the same file, they open without any issue.

As for the issue, please elaborate on how you are saving the file. Status code 89 means that opening parameters are required for TXT. Do I understand correctly that this error appears after the save?

Thank you @Constantine For taking the time to reply and support:

I was using collabora office without any problem but as soon as I tried onlyoffice the corrupted files issue eated my brain away.

I tried every possible solution I know

I’m sorry my bad for the wrong files here’s the correct files:

bigdata pap-original.docx (36.7 KB)
bigdata pap-coruputed.docx (37.5 KB)

  • I’m using custom wopi host using laravel that implements wopi protocol 100% and passing microsoft testing.
  • I’m using a very simple put function that saves the raw content comes from onlyoffice client to the file

as part of my effort of solving this issue I tried to use Command Service to force save the whole file when exit saving or auto save.

When I open any office file (docx, pptx, xlsx) and make any change and then either:

  • auto save the file and then close it
  • force save the file and then close it

when I tried to open the file again using onlyoffice client it just get corrupted.

Here’s more logs:

When I open the file

Open-file-logs.log (38.1 KB)

When I tried to auto save the file and then close it

auto-save-close-file.log (46.1 KB)

When I open the file it get’s corrupted:

open-file-after-courrpt.log (42.8 KB)

I have noticed that you initially created topic here:

Please copy your most recent reply to this topic to share most recent information. I am closing this one as a duplicate.