elwerene / libreoffice-convert

MIT License
239 stars 94 forks source link

Command failed with code 81 #120

Open BuistvoPloti opened 2 weeks ago

BuistvoPloti commented 2 weeks ago

I'm trying to implement a POC: store libreoffice binaries in the EFS (AWS) and pass binaries path to the libre convert function. I'm having an issue as in here, without many details:

const file = Buffer.from("test txt");
libre.convertAsync = require("util").promisify(libre.convertWithOptions);
const result = await libre.convertAsync(file, `.pdf`, undefined, {
    sofficeBinaryPaths: [binaries_path], // -> /mnt/efs/libreoffice/program/soffice.bin
});

and the error:

2024-06-11T21:17:01.424Z    58776d86-b3be-40bb-a854-e44f45d865ec    INFO Error: Command failed: /mnt/efs/libreoffice/program/soffice.bin -env:UserInstallation=file:///tmp/soffice-8-NwpfnEKpQvaG --headless --convert-to .pdf --outdir /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS/source

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17) {
  code: 81,
  killed: false,
  signal: null,
  cmd: '/mnt/efs/libreoffice/program/soffice.bin -env:UserInstallation=file:///tmp/soffice-8-NwpfnEKpQvaG --headless --convert-to .pdf --outdir /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS/source'
}

any ideas why it fails?

elwerene commented 2 weeks ago

https://github.com/shelfio/libreoffice-lambda-layer/issues/20

Am 11. Juni 2024 23:32:18 MESZ schrieb Denis Khorovets @.***>:

I'm trying to implement a POC: store libreoffice binaries in the EFS (AWS) and pass binaries path to the libre convert function. I'm having an issue as in here, without many details:

const file = Buffer.from("test txt");
libre.convertAsync = require("util").promisify(libre.convertWithOptions);
const result = await libre.convertAsync(file, `.pdf`, undefined, {
   sofficeBinaryPaths: [binaries_path], // -> /mnt/efs/libreoffice/program/soffice.bin
});

and the error:

2024-06-11T21:17:01.424Z   58776d86-b3be-40bb-a854-e44f45d865ec    INFO Error: Command failed: /mnt/efs/libreoffice/program/soffice.bin -env:UserInstallation=file:///tmp/soffice-8-NwpfnEKpQvaG --headless --convert-to .pdf --outdir /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS/source

   at ChildProcess.exithandler (node:child_process:402:12)
   at ChildProcess.emit (node:events:513:28)
   at ChildProcess.emit (node:domain:489:12)
   at maybeClose (node:internal/child_process:1100:16)
   at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
   at Process.callbackTrampoline (node:internal/async_hooks:130:17) {
 code: 81,
 killed: false,
 signal: null,
 cmd: '/mnt/efs/libreoffice/program/soffice.bin -env:UserInstallation=file:///tmp/soffice-8-NwpfnEKpQvaG --headless --convert-to .pdf --outdir /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS /tmp/libreofficeConvert_-8-hVLaVCQ9E6QS/source'
}

any ideas why it fails?

-- Reply to this email directly or view it on GitHub: https://github.com/elwerene/libreoffice-convert/issues/120 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

BuistvoPloti commented 2 weeks ago

@elwerene , yeah that's why I'm doing this thing, I don't want to use layer because it requires unpacking libreoffice every time, so I wanna use binaries from EFS and pass its path to a convert fn