LibreOffice and Heroku

Hey, its my first time here… Wish I can get some help which I will widely appreciate! I havre tried for a couple days to make Libre Office work with my app in Heroku, and I constantly receive this message.

{“message”:“Error convirtiendo a PDF: Command ‘[’/app/.apt/usr/bin/soffice’, ‘–headless’, ‘–convert-to’, ‘pdf’, ‘/tmp/tmpkaxp2euc.docx’, ‘–outdir’, ‘/tmp’]’ returned non-zero exit status 127.”,“success”:false}

I am a not professional programmer, and tried to debug and solve beeing helped by GPT, but I couldnt find a solution… maybe someone can tell me what is wrong. Many thanks in advance!

At first: Your tag base seems wrong. Base is the component of LibreOffice, wich connects to databases. But I don’t see anything related to databases. (And please don’t try Basic, that’s a programming-language)
.
On your topic: Have you tried the command without --headless from commandline yourself?
Have you checked the path? ( Your /.apt/ looks unusual for me, but you have not told anything about your environment besides “in Heroku”
.
PS: Compare suggestions from here:
https://stackoverflow.com/questions/30349542/command-libreoffice-headless-convert-to-pdf-test-docx-outdir-pdf-is-not

a bit oudated / overkill.

should now (24.8) run simply with :

$ soffice --convert-to pdf /tmp/ha.docx  
convert /tmp/ha.docx as a Writer document -> /tmp/ha.pdf using filter : writer_pdf_Export


$ file /tmp/ha.*
/tmp/ha.docx: Microsoft Word 2007+
/tmp/ha.pdf:  PDF document, version 1.7, 3 page(s)

definitely need to make sure soffice can run properly.
the output {“message”: ... suggests it is launched through a wrapper ?
the return code 127 suggests a non existant program …

is there a normal shell available to test from ?