metanorma: mn2pdf crashes in Docker container when creating attachments
mn2pdf crashes when using the latest Metanorma Docker container when attempting to create PDF with attachments using >docker run -v "%cd%":/metanorma/ -w /metanorma metanorma/metanorma metanorma site generate --agree-to-terms.
See attached console log output (starts with a Docker pull to ensure latest updates): mn2pdf-crash-docker.txt. It appears the attachment files are not in the correct location inside the Docker container.
I’m unable to add you to our repo so for now here is a ZIP of the repo, including _site output. Note that both the HTML and HTML-alt flavour outputs are good and the attachments work fine. Issue appears to be only the PDF generation using mn2pdf.
The MN output type is for an ISO Amendment-style PDF with 2 attachments (a PDF and an XLSX)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 34 (20 by maintainers)
Commits related to this issue
- process unembedded attachments: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/metanorma-standoc by opoudjis 2 years ago
- prioritise attachment URLs over citation URLs in attachment linking: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/isodoc by opoudjis 2 years ago
- signal attachment hyperlinks in Presentation XML: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/isodoc by opoudjis 2 years ago
- Pass baseassetpath to PDF generation if not explicit in arguments but inferred from filepath: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/isodoc by opoudjis 2 years ago
- baseasset path processing updated, metanorma/metanorma#407 — committed to metanorma/mn2pdf by Intelligent2013 2 years ago
- common xslt updated for attachments, metanorma/metanorma#407 — committed to metanorma/mn-native-pdf by Intelligent2013 2 years ago
- Merge pull request #737 from metanorma/fix/attachments common xslt updated for attachments, metanorma/metanorma#407 — committed to metanorma/mn-native-pdf by Intelligent2013 2 years ago
- relative path in attachments URL: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/metanorma-standoc by opoudjis 2 years ago
- unembedded attachments are found relative to input not output file location: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/metanorma-standoc by opoudjis 2 years ago
- consistent attachment name and eref target: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/metanorma-standoc by opoudjis 2 years ago
- consistent attachment name and eref target: https://github.com/metanorma/metanorma/issues/407 — committed to metanorma/metanorma-standoc by opoudjis 2 years ago
@CAMOBAP doesn’t the Docker container to work with Git gems? i.e. we don’t need to re-build the Docker container to work with the latest Gemfile?
@petervwyatt yes we would certainly wish to adopt your suggestions: perhaps this is something we can discuss in a separate ticket?
I’m able to repeat the issue.
Docker
docker run -v "%cd%":/metanorma/ -w /metanorma metanorma/metanorma metanorma site generate --agree-to-termsinternal
mn2pdfcommand line:java -Xss10m -Xmx3g -Djava.awt.headless=true -Duser.home=/root -jar /usr/local/bundle/gems/mn2pdf-1.96/lib/../bin/mn2pdf.jar --xml-file "/tmp/32000-2-2020-amd120240827-1-51ye2y.xml" --xsl-file "/usr/local/bundle/gems/metanorma-iso-2.8.4/lib/isodoc/iso/iso.amendment.xsl" --pdf-file "/metanorma/_site/documents/source/32000-2-2020-amd1.pdf" --param baseassetpath="/metanorma/source" --syntax-highlight --font-manifest "/tmp/fontist_locations20240827-1-ri9kqm.yml"Error:
Local run
bundle exec metanorma site generate --agree-to-termsinternal
mn2pdfcommand line:java -Xss10m -Xmx3g -Djava.awt.headless=true -Duser.home=C:/Users/TestUser -jar C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/mn2pdf-1.97/bin/mn2pdf.jar --xml-file "C:/Users/TestUser/AppData/Local/Temp/32000-2-2020-amd120240827-4956-5u8a7c.xml" --xsl-file "C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/iso.amendment.xsl" --pdf-file "D:/Work/Metanorma/XML/ISO/ISO210_Docker/_site/documents/source/32000-2-2020-amd1.pdf" --param baseassetpath="D:/Work/Metanorma/XML/ISO/ISO210_Docker/source" --syntax-highlight --font-manifest "C:/Users/TestUser/AppData/Local/Temp/fontist_locations20240827-4956-4pb97k.yml"Another error:
I’ll investigate it.
Thanks @petervwyatt for the report.
(I can’t believe that someone already tried to hijack this ticket with an malware advertisement 😰 )