gotenberg: Generate big pdf ( 250 pages) format pdf A-2B : print to PDF: Printing failed (-32000)

We use gotenberg to generate pdf format A-2B using chromium but failed for big files.

The process is working for small pdf (30 pages). But when we want to generate bigger one (250 pages and 1000 pages) the process failed.

Generate big files without format pdf A-2B is also working.

Request example : curl \ --request POST '[http://localhost:3000/forms/chromium/convert/html'](http://localhost:3000/forms/chromium/convert/html%27) \ --form 'files=@"/path/to/index.html"' \ --form 'pdfFormat="PDF/A-2b"' \ -o my.pdf

Error gotenberg : "convert HTML to PDF: convert to PDF: chromium PDF: print to PDF: Printing failed (-32000)"

The error seems to come from : [ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory

Debug stack :

{“level”:“debug”,“ts”:1649754891.2555325,“logger”:“api.formschromiumconverthtml”,“msg”:“print to PDF with: &{Landscape:false DisplayHeaderFooter:true PrintBackground:false Scale:1 PaperWidth:16.54166 PaperHeight:11.7 MarginTop:0 MarginBottom:0 MarginLeft:0 MarginRight:0 PageRanges: IgnoreInvalidPageRanges:false HeaderTemplate:<html><head></head><body></body></html> FooterTemplate:<html><head></head><body></body></html> PreferCSSPageSize:false TransferMode:}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754891.2555625,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“-> {"id":22,"sessionId":"30D2DCD8648B911761EB9A11204181F4","method":"Page.printToPDF","params":{"displayHeaderFooter":true,"scale":1,"paperWidth":16.54166,"paperHeight":11.7,"marginTop":0,"marginBottom":0,"marginLeft":0,"marginRight":0,"headerTemplate":"\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e","footerTemplate":"\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e"}}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754893.8353238,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.styleSheetAdded","params":{"header":{"styleSheetId":"48.1","frameId":"3BF1DD850143A1F5055149B685D19D45","sourceURL":"","origin":"regular","title":"","ownerNode":10,"disabled":false,"isInline":false,"isMutable":false,"isConstructed":false,"startLine":0,"startColumn":0,"length":54,"endLine":0,"endColumn":54}},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7671938,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7672672,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7672853,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673156,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673314,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673461,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"Page.frameResized","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673676,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673826,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7673972,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.7674253,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754951.767442,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"CSS.mediaQueryResultChanged","params":{},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649754953.041991,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"method":"Page.lifecycleEvent","params":{"frameId":"3BF1DD850143A1F5055149B685D19D45","loaderId":"B6AE9B3040A45125A1EC443694E88125","name":"InteractiveTime","timestamp":82911.294613},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649755007.3219748,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“[0412/091647.321770:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)\n[0412/091647.321890:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)\n”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649755007.3305554,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“[0412/091647.325938:ERROR:directory_reader_posix.cc(42)] opendir /tmp/Crashpad/attachments/1cab1e5d-fe5f-4dbb-9a5d-3a333432b83d: No such file or directory (2)\n”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649755008.0098526,“logger”:“api.formschromiumconverthtml.browser”,“msg”:“<- {"id":22,"error":{"code":-32000,"message":"Printing failed"},"sessionId":"30D2DCD8648B911761EB9A11204181F4"}”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649755008.010061,“logger”:“api.formschromiumconverthtml”,“msg”:“remove user profile directory ‘/tmp/71e43cb7-d7af-4d96-8835-49f2164ee763’”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”} {“level”:“debug”,“ts”:1649755008.030683,“logger”:“api.formschromiumconverthtml”,“msg”:“‘/tmp/08443c30-f29b-4d0e-8fc5-0a8260d72d19’ removed”,“trace”:“e0aea925-1ddd-4760-b910-7b915b8e75ac”}

Maybe it’s same problem than here : https://bugs.chromium.org/p/chromium/issues/detail?id=1228625

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28

Most upvoted comments

I’ve added a link in the documentation to this Chromium issue 👍

Thanks for taking the time to make this subject progress (I kinda have a limited amount of free time currently 😅).

Honestly I dunno, there isn’t much I can do here, as Chromium seems to be the culprit. You may stick to version 6 in the meantime, but I know it’s not ideal…

OK so what would be the next steps? If it’s the Chromium bug there’s not much to do here? Is waiting (and praying) the only alternative 🫠 ?

Hey 👋 , updates:

  • I’ve tried with skipNetworkIdleEvent=true and I have the same error.
  • I’ve tried with 8.12 (both with and without skipNetworkIdleEvent=true) and I have the same error.
  • I forgot to mention this but I think this is due to an old Chromium bug that is still open (I saw that reference in this other gotenberg issue).

Did you try to run this locally yourself like I explained above? I bet you’ll have the same issue.

@unstarved I’ll need a reproductible scenario to understand what’s going on.

Hey team is there any news about this bug?

Just like @QuentinChaumont suggested, I was able to generate big PDF using thecodingmachine/gotenberg:6.2 which normally fails on gotenberg:8.

@Dhopal not yet

Yes Gotenberg 6 successfully worked to convert to pdf using /convert/html. (Thanks for the memory leaks details, we’ll monitoring it, but no other choice now). Same html is not converting on Gotenberg 7 using /forms/libreoffice/convert or /forms/chromium/convert/html (with or without using format A-2B).

@QuentinChaumont so Gotenberg 6´s Chrome version works for big file 🤔 please note it’s a long running process in v6; there are memory leaks.

Not sure what’s the fix here, but to wait for a new version of Chrome that fixes the issue.

Update: We managed to generate big pdf (over 2000 pages) using Gotenberg 6. Gotenberg 7 failed for big pdf. No Update for big pdf conversion on format A-2B using gotenberg. Waiting for a fix.

Hello @QuentinChaumont

Actually, Chromium does the first conversion (HTML to “standard” PDF format), then LibreOffice converts the resulting file to the PDF/A-2B format.

Are you sure it works if the pdfFormat form field is not filled? As mentioned previously, it’s two separate processes 😄