Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandoc failure during local rendering #1911

Open
henrif75 opened this issue Mar 10, 2024 · 9 comments
Open

Pandoc failure during local rendering #1911

henrif75 opened this issue Mar 10, 2024 · 9 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@henrif75
Copy link
Collaborator

Following the build procedures listed in the README.md page results in pandoc failure:

mdbook serve
2024-03-10 09:56:02 [INFO] (mdbook::book): Book building has started
2024-03-10 09:56:02 [INFO] (mdbook::book): Running the exerciser backend
2024-03-10 09:56:02 [INFO] (mdbook::renderer): Invoking the "exerciser" renderer
2024-03-10 09:56:03 [INFO] (mdbook::book): Running the html backend
2024-03-10 09:56:04 [INFO] (mdbook::book): Running the pandoc backend
2024-03-10 09:56:04 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
[2024-03-10T16:56:07Z INFO  mdbook_pandoc] Processing redirects in [output.html.redirect]
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: why-rust/an-example-in-c.html => ../hello-world/example.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/why-rust/../hello-world/example.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-2/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-2/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-3/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-3/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: testing/mockall.html => ../android/testing/mockall.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/testing/../android/testing/mockall.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: traits/iterator.html => ../iterators/iterators.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/traits/../iterators/iterators.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-1/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-1/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: basic-syntax/static-and-const.html => ../unsafe-rust/static-and-const.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/basic-syntax/../unsafe-rust/static-and-const.html: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Unable to normalize link 'comprehensive-rust.pdf' in chapter 'Welcome to Comprehensive Rust 🦀': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/comprehensive-rust.pdf: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../comprehensive-rust-exercises.zip' in chapter 'Compass': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/exercises/bare-metal/../../comprehensive-rust-exercises.zip: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../comprehensive-rust-exercises.zip' in chapter 'RTC Driver': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/exercises/bare-metal/../../comprehensive-rust-exercises.zip: No such file or directory (os error 2)
[2024-03-10T16:56:07Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../borrowing/interior-mutability' in chapter 'Mutex': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/concurrency/shared_state/../../borrowing/interior-mutability: No such file or directory (os error 2)
[WARNING] Could not convert image /private/var/folders/nk/38dlc4z527143grzs9b12cnw0034vl/T/tex2pdf.-6bf89262faae817a/d907026615712cd13ce7e4e5023eb47711d8122f.svg: check that rsvg-convert is in path.
  rsvg-convert: createProcess: posix_spawnp: does not exist (No such file or directory)
[WARNING] Could not convert image /private/var/folders/nk/38dlc4z527143grzs9b12cnw0034vl/T/tex2pdf.-6bf89262faae817a/5180f1968cb395680acc12835345595cdedd9550.svgz: check that rsvg-convert is in path.
  rsvg-convert: createProcess: posix_spawnp: does not exist (No such file or directory)
[WARNING] Could not convert image /private/var/folders/nk/38dlc4z527143grzs9b12cnw0034vl/T/tex2pdf.-6bf89262faae817a/aedd0ef191cf2e1f37d81b92916a869810082d7e.svgz: check that rsvg-convert is in path.
  rsvg-convert: createProcess: posix_spawnp: does not exist (No such file or directory)
lualatex not found. Please select a different --pdf-engine or install lualatex
pandoc exited unsuccessfully
2024-03-10 09:56:10 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-03-10 09:56:10 [ERROR] (mdbook::utils): Error: Rendering failed
2024-03-10 09:56:10 [ERROR] (mdbook::utils): 	Caused By: The "pandoc" renderer failed
@henrif75 henrif75 added the bug Something isn't working label Mar 10, 2024
@djmitche
Copy link
Collaborator

It looks like the issue is that rsvg-convert is not installed? I suspect installing that will fix the immediate issue, and perhaps an README update or the like is required to help the next person who encounters this.

I wonder if pandoc just has too many dependencies to expect folks to build locally. Maybe we should be suggesting building the PDF using a docker invocation of some sort?

@henrif75
Copy link
Collaborator Author

henrif75 commented Mar 11, 2024

I had to install librsvg and lualatex on Mac, but I'm getting another error now:

2024-03-11 14:27:54 [INFO] (mdbook::book): Book building has started
2024-03-11 14:27:55 [INFO] (mdbook::book): Running the exerciser backend
2024-03-11 14:27:55 [INFO] (mdbook::renderer): Invoking the "exerciser" renderer
2024-03-11 14:27:55 [INFO] (mdbook::book): Running the html backend
2024-03-11 14:27:56 [INFO] (mdbook::book): Running the pandoc backend
2024-03-11 14:27:56 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
[2024-03-11T21:27:57Z INFO  mdbook_pandoc] Processing redirects in [output.html.redirect]
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-1/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-1/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-3/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-3/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: why-rust/an-example-in-c.html => ../hello-world/example.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/why-rust/../hello-world/example.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: testing/mockall.html => ../android/testing/mockall.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/testing/../android/testing/mockall.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: basic-syntax/static-and-const.html => ../unsafe-rust/static-and-const.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/basic-syntax/../unsafe-rust/static-and-const.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: traits/iterator.html => ../iterators/iterators.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/traits/../iterators/iterators.html: No such file or directory (os error 2)
[2024-03-11T21:27:57Z WARN  mdbook_pandoc::preprocess] Failed to resolve redirect: exercises/day-2/soluções-tarde.html => solutions-afternoon.html: Unable to normalize redirect destination: Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/book/pandoc/pdf/src/exercises/day-2/solutions-afternoon.html: No such file or directory (os error 2)
[2024-03-11T21:28:00Z WARN  mdbook_pandoc::preprocess] Unable to normalize link 'comprehensive-rust.pdf' in chapter 'Welcome to Comprehensive Rust 🦀': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/comprehensive-rust.pdf: No such file or directory (os error 2)
[2024-03-11T21:28:00Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../comprehensive-rust-exercises.zip' in chapter 'Compass': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/exercises/bare-metal/../../comprehensive-rust-exercises.zip: No such file or directory (os error 2)
[2024-03-11T21:28:00Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../comprehensive-rust-exercises.zip' in chapter 'RTC Driver': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/exercises/bare-metal/../../comprehensive-rust-exercises.zip: No such file or directory (os error 2)
[2024-03-11T21:28:00Z WARN  mdbook_pandoc::preprocess] Unable to normalize link '../../borrowing/interior-mutability' in chapter 'Mutex': Unable to canonicalize path: /Users/henrif/Documents/comprehensive-rust/src/concurrency/shared_state/../../borrowing/interior-mutability: No such file or directory (os error 2)
	Error producing PDF.
!  ==> Fatal error occurred, no output PDF file produced!

pandoc exited unsuccessfully
2024-03-11 14:28:27 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-03-11 14:28:27 [ERROR] (mdbook::utils): Error: Rendering failed
2024-03-11 14:28:27 [ERROR] (mdbook::utils): 	Caused By: The "pandoc" renderer failed

It worked once, then no more.
Could we have some sort of config to turn off the PDF generation?

@henrif75 henrif75 added documentation Improvements or additions to documentation bug Something isn't working and removed bug Something isn't working labels Mar 11, 2024
@mgeisler
Copy link
Collaborator

@max-heller, do you have experience with building the course on Mac?

@henrif75, you should be able to turn this off by removing the mdbook-pandoc binary you have installed. I get

2024-03-24 21:04:55 [WARN] (mdbook::renderer): The command `mdbook-pandoc` for backend `pandoc` was not found, but was marked as optional.

on my machine because I haven't installed it here.

@max-heller
Copy link
Contributor

max-heller commented Apr 6, 2024

@max-heller, do you have experience with building the course on Mac?

Yes, I primarily develop on a Mac.

@henrif75 could you try enabling verbose logging for Pandoc in book.toml and see what it spits out?

[output.pandoc.profile.pdf]
output-file = "comprehensive-rust.pdf"
pdf-engine = "lualatex"
verbosity = "INFO" # ADD THIS LINE

@mgeisler mgeisler changed the title Pandoc failure during Pandoc failure during local rendering Apr 7, 2024
@henrif75
Copy link
Collaborator Author

henrif75 commented Apr 8, 2024

Here is the output:
mdbook.log.gz

@max-heller
Copy link
Contributor

Here is the output:
mdbook.log.gz

Do you have Noto fonts installed? The end of the log suggests missing fonts might be the fatal error:

  luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "NotoSansMonoCJKSC" not found.
  luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate....texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua:50: attempt to inde
  x a nil value (local 'f').
  <to be read again> 
  relax 
  l.154 \begin{document}
                      
   515 words of node memory still in use:
     5 hlist, 1 vlist, 2 rule, 1 dir, 4 kern, 1 glyph, 7 attribute, 60 glue_spec,
   7 attribute_list, 3 if_stack, 1 write, 1 user_defined, 1 pdf_colorstack nodes
     avail lists: 1:1,2:10,3:3,4:1,5:7,7:2,9:4
  !  ==> Fatal error occurred, no output PDF file produced!
  Transcript written on input.log.
Error producing PDF.
!  ==> Fatal error occurred, no output PDF file produced!

pandoc exited unsuccessfully
2024-04-07 17:51:17 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-04-07 17:51:17 [ERROR] (mdbook::utils): Error: Rendering failed
2024-04-07 17:51:17 [ERROR] (mdbook::utils): 	Caused By: The "pandoc" renderer failed

I have the following installed through homebrew, although I'm not sure they're all needed:

$ brew list --casks | grep noto
font-noto-color-emoji
font-noto-emoji
font-noto-sans
font-noto-sans-cjk
font-noto-sans-math
font-noto-sans-symbols
font-noto-serif
font-noto-serif-cjk
font-noto-serif-cjk-tc

@henrif75
Copy link
Collaborator Author

henrif75 commented Apr 9, 2024

It worked when I installed the fonts, but I couldn't find a casket so I manually installed them.
Would you have the brew command to fetch these fonts? I'll update the documentation.

@max-heller
Copy link
Contributor

It worked when I installed the fonts, but I couldn't find a casket so I manually installed them. Would you have the brew command to fetch these fonts? I'll update the documentation.

brew tap homebrew/cask-fonts (see here)

@kashopi
Copy link

kashopi commented May 27, 2024

In my Silicon laptop I fixed it by using "tectonic" as a PDF renderer (changing it in the book.toml file) and installing the Noto fonts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants