[nu-demo] hero_books PDF export needs Chromium — Ubuntu 24 ships chromium-browser as snap-wrapper which fails on TF Grid VMs #177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Clicking 'Generate PDF' inside a book in the hero_books UI returns:
hero_books uses the
headless_chromeRust crate to render book pages into a single PDF. It expects a Chromium binary somewhere on PATH.Root cause
On Ubuntu 24.04 (TF Grid flist),
apt install chromium-browserinstalls a snap wrapper (package version2:1snap1-0ubuntu2). When invoked, it prints:But snapd doesn't work cleanly on TF Grid flists — they don't have a systemd user session to run snap confinement. Even if snap install succeeds, the sandbox fails at runtime.
Debian's
chromiumpackage (non-snap) also isn't in Ubuntu 24 Noble's archive.Options (ordered by pragmatism)
1. Install Google Chrome direct .deb
Google publishes
.debfor Chrome Stable. Adds a repo key + adds chrome to apt, installs cleanly, no snap:Then configure hero_books to use
/usr/bin/google-chrome-stable(via env var — check headless_chrome crate for how to override).2. Bundle a Chromium binary at install time
hero_skills installer downloads a static Chromium build (e.g. from Thorium or Puppeteer's bundled Chromium) into
/data/opt/chromium/and sets PATH. ~150 MB download, no apt coupling.3. Replace hero_books PDF generation with a non-Chromium path
Use weasyprint, wkhtmltopdf, or typst to render book pages → PDF. Each has tradeoffs (weasyprint needs Cairo + Pango, wkhtmltopdf needs Qt/WebKit, typst is fast but different from HTML rendering — book may not look identical).
Note: home#161 already installed typst on herodemo for pandoc. Reusing it for hero_books is a natural extension.
4. Drop PDF export entirely
hero_books' web UI can already show pages HTML one at a time. 'Export whole book as PDF' is a nice-to-have, not blocking the demo. Remove the button + endpoint until Chromium or a replacement lands.
Demo impact
hero_books works for browsing/reading (Knowledge World → library cards → pages). Only the 'PDF' button fails.
The Office archipelago's PDF island has a DIFFERENT missing dep — OnlyOffice Document Server — which is tracked separately in home#174. Don't conflate: hero_books PDF export = Chromium; Office PDF viewing = OnlyOffice.
Related
Signed-off-by: mik-tf
Resolved by
lhumina_code/hero_skills@7c823d1(PR lhumina_code/hero_skills#126).Part of Phase 2 tracker #185.