moalhaddar / docx-to-pdf

A LibreOffice server wrapper that is exposed over HTTP to allow easy conversions from supported documents to PDF.
36 stars 17 forks source link

uno server endpoint not working as expected PermissionError: [Errno 13] Permission denied: #1

Closed muadpn closed 4 months ago

muadpn commented 8 months ago

Running the Docker Container throws a error initially. PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/unoserver/server.py'

upon some debugging I found that starting the unoserver in --daemon us the reason for the initial error. removing it starts the process : const child = spawn('python3', ['-m', 'unoserver.server', '--daemon']); => const child = spawn('python3', ['-m', 'unoserver.server']);

but then it throws the error while converting the pdf that it file is not on the directory.

pdf_generator  | 2024-02-29T12:32:07.627189928Z [EXPRESS] [Error: ENOENT: no such file or directory, open '/tmp/generated_pdfs/tmp-1-1709209927536.pdf'] {
pdf_generator  | 2024-02-29T12:32:07.627230075Z   errno: -2,
pdf_generator  | 2024-02-29T12:32:07.627234880Z   code: 'ENOENT',
pdf_generator  | 2024-02-29T12:32:07.627236871Z   syscall: 'open',
pdf_generator  | 2024-02-29T12:32:07.627238504Z   path: '/tmp/generated_pdfs/tmp-1-1709209927536.pdf'
pdf_generator  | 2024-02-29T12:32:07.627240423Z }
moalhaddar commented 5 months ago

Hello

I've done a full rewrite for this service and it's no longer using the old methods of nodejs and python.

Try using the below image

docker pull moalhaddar/docx-to-pdf:latest

docker run -d --name docx-to-pdf -e 'pool.size=1' -p 8080:8080 moalhaddar/docx-to-pdf:latest

And let me know :)