i am testing word files covert to pdfs, all word files are in Chinese with 100+pages, and this problem occurs very frequently.
\nthis is my .env file:
\n# base\nAPI_TIMEOUT=3600s\n# libreoffice\nLIBREOFFICE_MAX_QUEUE_SIZE=1\nLIBREOFFICE_RESTART_AFTER=1\nLIBREOFFICE_AUTO_START=true\nLIBREOFFICE_START_TIMEOUT=60s\nthis is my docker compose file:
\nversion: '3.8'\n\nservices:\n gotenberg1:\n image: gotenberg/gotenberg:8.23.1\n container_name: gotenberg-instance-1\n environment:\n - TZ=Asia/Shanghai\n ports:\n - \"8094:3000\"\n volumes:\n - ./fonts:/usr/local/share/fonts\n env_file:\n - .env\n restart: unless-stoppedI set API_TIMEOUT=60s or 600s or 3600s , they are all can't complete the task normally, is my settings wrong?
\nuse docker stats see the cpus is using 103%, memory using 240M, and after each task ends abnormally, the CPU usage remains at 100%+, I dont know why? i am in China, if some package url timeout ?
\nand i search google says mount fonts to docker, but problems remain.
\nand i set Load Balancin , but problems remain.
Thinks!
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"I try to solve the problem all day, and I found some clues, those word files are all in Chinese, documents written by different people on different computers, has may different fonts, I build a new docker image with my windows fonts and other debain apt depends, and resolved a batch of document issues, But there are still many documents that have problems.
\nand i think this is a an effective way, like this Dockerfile to build a new gotenberg docker image.
FROM gotenberg/gotenberg:8.23.1\n\nUSER root\n\nCOPY ./fonts/* /usr/local/share/fonts/\n\nRUN apt-get update && apt-get install -y \\\n fonts-noto-core \\\n fonts-noto-cjk \\\n fonts-noto-color-emoji \\\n fonts-liberation \\\n fonts-wqy-zenhei \\\n fonts-arphic-gbsn00lp \\\n fonts-wqy-microhei \\\n fonts-arphic-gkai00mp \\\n ttf-wqy-zenhei \\\n fonts-symbola \\\n fontconfig \\\n libgl1 \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/*\n\nRUN fc-cache -f -v\n\n# USER gotenberg\n-
gotenberg-instance-1 | _____ __ __
gotenberg-instance-1 | / ___/__ / /____ ___ / / ___ _______ _
gotenberg-instance-1 | / (_ / _ \/ __/ -_) _ \/ _ \/ -_) __/ _ '/
gotenberg-instance-1 | \___/\___/\__/\__/_//_/_.__/\__/_/ \_, /
gotenberg-instance-1 | /___/
gotenberg-instance-1 |
gotenberg-instance-1 | A containerized API for seamless PDF conversion.
gotenberg-instance-1 | Version: 8.23.1
gotenberg-instance-1 | -------------------------------------------------------
gotenberg-instance-1 | [SYSTEM] modules: api chromium exiftool libreoffice libreoffice-api libreoffice-pdfengine logging pdfcpu pdfengines pdftk prometheus qpdf webhook
gotenberg-instance-1 | [SYSTEM] chromium: Chromium ready to start
gotenberg-instance-1 | [SYSTEM] pdfengines: merge engines - qpdf pdfcpu pdftk
gotenberg-instance-1 | [SYSTEM] pdfengines: split engines - pdfcpu qpdf pdftk
gotenberg-instance-1 | [SYSTEM] pdfengines: flatten engines - qpdf
gotenberg-instance-1 | [SYSTEM] pdfengines: convert engines - libreoffice-pdfengine
gotenberg-instance-1 | [SYSTEM] pdfengines: read metadata engines - exiftool
gotenberg-instance-1 | [SYSTEM] pdfengines: write metadata engines - exiftool
gotenberg-instance-1 | [SYSTEM] pdfengines: encrypt engines - qpdf pdftk pdfcpu
gotenberg-instance-1 | [SYSTEM] prometheus: collecting metrics
gotenberg-instance-1 | [SYSTEM] libreoffice-api: LibreOffice automatically started
gotenberg-instance-1 | [SYSTEM] api: server started on [::]:3000
gotenberg-instance-1 | {"level":"error","ts":1758291846.124828,"logger":"api","msg":"convert to PDF: supervisor run task: context deadline exceeded","log_type":"access","trace":"f6509344-fa5e-4998-ad11-b7eb97fa2264","remote_ip":"10.0.0.97","host":"10.0.7.145:8094","uri":"/forms/libreoffice/convert","method":"POST","path":"/forms/libreoffice/convert","referer":"","user_agent":"python-httpx/0.28.1","status":503,"latency":3600000576763,"latency_human":"1h0m0.000576763s","bytes_in":856886,"bytes_out":19}i am testing word files covert to pdfs, all word files are in Chinese with 100+pages, and this problem occurs very frequently. this is my .env file: this is my docker compose file: version: '3.8'
services:
gotenberg1:
image: gotenberg/gotenberg:8.23.1
container_name: gotenberg-instance-1
environment:
- TZ=Asia/Shanghai
ports:
- "8094:3000"
volumes:
- ./fonts:/usr/local/share/fonts
env_file:
- .env
restart: unless-stoppedI set API_TIMEOUT=60s or 600s or 3600s , they are all can't complete the task normally, is my settings wrong? use docker stats see the cpus is using 103%, memory using 240M, and after each task ends abnormally, the CPU usage remains at 100%+, I dont know why? i am in China, if some package url timeout ? and i search google says mount fonts to docker, but problems remain. Thinks! |
Beta Was this translation helpful? Give feedback.
-
|
Hello @finch-xu, LibreOffice struggles with « large » files, not sure if I can do anything alas! Maybe try to increase the CPU/Memory of your instance? |
Beta Was this translation helpful? Give feedback.
-
|
and i write a blog https://pidan.dev/20250920/office-convert-pdf-use-gotenberg-libreoffice/ |
Beta Was this translation helpful? Give feedback.
I try to solve the problem all day, and I found some clues, those word files are all in Chinese, documents written by different people on different computers, has may different fonts, I build a new docker image with my windows fonts and other debain apt depends, and resolved a batch of document issues, But there are still many documents that have problems.
and i think this is a an effective way, like this Dockerfile to build a new gotenberg docker image.