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.

32000-2-2020-amd1.zip

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

Most upvoted comments

@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-terms

internal mn2pdf command 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:

[mn2pdf] Caused by: java.io.FileNotFoundException: /tmp/_32000-2-2020-amd1_attachments/ISO32000-2_AnnexL_matrix-version072024.pdf (No such file or directory)

Local run

bundle exec metanorma site generate --agree-to-terms

internal mn2pdf command 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:

[mn2pdf] Element "pdf:embedded-file" is missing required property "name"! (No context info available)
[mn2pdf] org.apache.fop.fo.ValidationException: Element "pdf:embedded-file" is missing required property "name"! (No context info available)
[mn2pdf] javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Element "pdf:embedded-file" is missing required property "name"! (No context info available)

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 😰 )