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

Hello friends at OnlyOffice,

Thank you very much for your continued attention and patient responses to this issue over the past few days from several of your colleagues.

Let me briefly explain the background of this issue. The OnlyOffice service is running on a portable device within our company. This device requires strict security measures, meaning all program executions are strictly monitored, random programs cannot be run, and accessing the internet is not allowed. Therefore, it is not feasible to run the installation programs provided by OnlyOffice in the usual way on this device; modifications are necessary for deployment. Thus, we have taken the following steps to deploy the OnlyOffice docservice service onto the device:

  1. Run the OnlyOffice installation program on a device with the same hardware version that can access external networks (Linux + ARM).
  2. Copy the installed program’s runtime directory /var/www/onlyoffice/documentserver and configuration directory /etc/onlyoffice/documentserver to a mounted storage device on the target device.
  3. Create a Docker environment on the installation device and install nginx, plsql, activemq, etc., within the Docker environment.
  4. Manually initialize the database tables required by OnlyOffice.
  5. Use Docker’s bind mounts to map /var/www/onlyoffice, /var/logs/onlyoffice, and /etc/onlyoffice in the Docker environment to the directories where the installation files were copied.

After these modifications, the program runs smoothly in Docker, and the example services operate normally, allowing for file preview and system editing functions. However, the convert API fails to work correctly and throws an error.

From my exploration over the past few days, I have reached the following conclusions:

  1. The root cause of this problem appears to be the lack of certain third-party libraries needed for the convert functionality to operate properly, which are not located in the location specified by LD_LIBRARY_PATH. Alternatively, the LD_LIBRARY_PATH might include this third-party library, but the library could depend on operating system libraries that are missing. During my search, I found a relevant discussion which seems to reflect the same underlying issue: Errors that occur when using conversion APIs:error spawnAsync Error: Process exited with non-zero code: 80

  2. Although the convert API reports errors during execution, the DownloadAs and SaveAs functionalities in the OnlyOffice examples work fine, suggesting that the part of the convert API responsible for generating the post submission content for DownloadAS triggers this error, as they rely on the same service.

Therefore, my main questions are:

  1. Are all the dynamic libraries that OnlyOffice depends on included in the LD_LIBRARY_PATH? Which libraries are missing from this path? This would help us identify which library’s absence is causing this conversion error.

  2. Does the body content submitted via post for the DownloadAs feature match the content of the Editor.bin file? If not, what are the differences? I want to replace the body submitted by the browser with the corresponding Buffer from Editor.bin to call this API on the server side.

Thank you again for your attention and answers to this issue. I look forward to your replies.

(My limited English skills are insufficient to express this issue clearly, so this content has been translated using AI. I apologize in advance for any offense caused by potential translation errors.)


OnlyOffice 的朋友们你们好,非常感谢这些天多位 OnlyOffice 的同事对这个问题的持续关注和耐心回复。

简单说下这个产生这个问题的具备背景。首先 OnlyOffice 服务运行在我们公司的一台便携式设备上,
这个设备上的程序对安全性有要求,所有的程序的运行都被严格监控,不能随便运行程序,也不能访问外网。
因此在这个设备上是不能通过常规方式运行 OnlyOffice 官方提供的安装程序的,必须进行适当的改造才
可以进行部署。因此我们做了如下处理将 OnlyOffice 的 docservice 服务部署到了设备上。

  1. 在一台硬件版本相同且可以访问外的设备上(Linux + ARM)运行 OnlyOffice 安装程序
  2. 将安装后的程序按住后的运行文件目录:/var/www/onlyoffice/documentserver 和配置文件目录: /etc/onlyoffice/documentserver 拷贝到设备中 mount 的存储设备
  3. 在安装设备中创建 Docker 环境,并在 docker 环境中安装 nginx、 plsql、activemq…
  4. 手工初始化 onlyoffice 需要的数据库表
  5. 通过 docker 的 bind mounts 将 docker 环境的的 /var/www/onlyoffice、/var/logs/onlyoffice、 /etc/onlyoffice 映射到安装文件拷贝到的目录中

经过这样改造之后程序在 docker 中可以顺畅的运行,可以正常运行 example 服务,可以实现文件的预览和系统编辑功能。唯独 convert api 无法正常调用会报错。

经过这些天对这个文件的摸索,我暂时能得到如下结论:

  1. 这个问题的根本原因是:缺少一些 convert 正常运行所需要的第三方库,且这些第三方库没有位于 LD_LIBRARY_PATH 所指定的位置,亦或者 LD_LIBRARY_PATH 包含这个第三方库,但这个库可能依赖了操作系统库,而操作系统重缺乏对应的库。 我在搜索过程中找到了这个提问,这个问题应该和我这个问题本质上是一个问题:Errors that occur when using conversion APIs:error spawnAsync Error: Process exited with non-zero code: 80

  2. 虽然 convert api 运行会报错,但 onlyoffice 自带的 example 的 DownloadAs 和 SaveAs 功能却能正常运行,所以应该是 convert api 中生成 DownloadAS post 提交内容的这部分代码
    触发了这个错误, 因为这两个 API 依赖的服务和 convert api 依赖的服务是同一个。

所以我现在比较大的疑惑是:

  1. OnlyOffice 依赖的动态链接库,是否都位于 LD_LIBRARY_PATH 中,没有那些库是没有这里的?这样我们比较好排查到底缺失了那个库导致了这个转换错误
  2. DownloadAs 功能通过 post 提交的 body 内容与 Editor.bin 文件的内容一样吗? 如果不一样的话,差异是什么? 我想通过提交 Editor.bin 对应 Buffer 来替换浏览器提交的 body, 这样我可以在服务端调用这个 API。

再次感谢大家对这个问题的关注和解答,期待各位的回复。

(我蹩脚的英文不足以支撑我对这个问题进行表达,所以这段内容通过 AI 进行了翻译,如有因为 AI 翻译有误造成冒犯,在此先行道歉)