install.sh does not install LibreOffice, so PPTX upload fails #229
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#229
Loading…
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?
On the test server a PPTX upload answers "could not convert the presentation: soffice is not installed (looked for soffice)".
install.shinstallspoppler-utils(line 326) but notsoffice, and notffmpegorgseither, whichpptx_video.rsalso calls.Expected: the server install and upgrade path installs
libreoffice-impress(headless use,--no-install-recommends),ffmpegandghostscript./healthor startup logs a clear warning when one of the converters is missing. Check every install path (native, image). The installer test covers it.Second cause, found on the test server (2026-11-15 17:00 UTC): installing LibreOffice is not enough
After
libreoffice-impress,ffmpegandghostscriptwere installed by hand, a PPTX upload still fails:Cause.
grimoirix-signage-server.serviceruns withDynamicUser=yes,ProtectSystem=strict,ProtectHome=yes. The service has no home folder, sosofficecannot create its user profile.render_fallback_pagesincrates/server/src/pptx_video.rs:102startssofficewith no profile path.Measured in a
systemd-runsandbox with the same hardening as the unit, convertingcrates/server/tests/fixtures/sample-deck.pptx:User installation could not be completedHOME=<state dir>onlyHOME=line in the unit is not the fix-env:UserInstallation=file://<writable dir>in.pdfwrittenFix in code (part of this issue):
render_fallback_pagespasses-env:UserInstallation=file://<work_dir>/lo-profile(a fresh profile per conversion, inside the work dir it already owns). Per conversion and not one shared profile, because LibreOffice locks its profile and two uploads at the same time would collide. The path must be URL-encoded (file://URL). Add a test that a fakesofficereceives the-env:UserInstallation=argument.Acceptance for #229 is therefore: a PPTX upload converts on a fresh native
install.shserver, under the shipped unit, with no hand edits.Interim on the test server only (remove when this lands):
/usr/local/bin/scryglass-sofficewrapssofficewith a per-runmktemp -dprofile, and drop-in/etc/systemd/system/grimoirix-signage-server.service.d/soffice-profile.confsetsSIGNAGE_PPTX_VIDEO_SOFFICE_PATHto it.Second blocker found on the test server (Ubuntu 26.04.1), after the LibreOffice profile one: Ghostscript is denied by AppArmor.
Panel error:
could not convert the presentation: gs failed: GPL Ghostscript 10.06.0: Unrecoverable error, exit code 1/etc/apparmor.d/gs(profilegs, for/usr/bin/gs). It allows reads and writes only under$HOME,/mnt,/media, user tmp and/usr/share. The service renders in/var/lib/grimoire-signage/media/.pptx-render-<uuid>, which resolves to/var/lib/private/grimoire-signage/...underDynamicUser=yes. The kernel log showsapparmor="DENIED" operation="open" profile="gs" name="/var/lib/private/.../in.pdf".-dNOSAFERdoes not help; it is not Ghostscript's own SAFER.render_fallback_pagessetsstdout(Stdio::null()), and gs writesError: /undefinedfilename ... Last OS error: Permission deniedto stdout. Only the last stderr line reached the panel. Capture both streams for the error detail.Interim on the test server only:
/etc/apparmor.d/local/gswith/var/lib/private/grimoire-signage/** rw,, profile reloaded. As the service user in the service namespace, gs now renders all 83 pages with no denials. Remove it when this issue lands.For the permanent fix, my preference, in order:
pdftoppm(poppler-utils), the toolcrate::pdfalready uses for PDF uploads. One rasteriser for both paths, and no AppArmor profile on it in Ubuntu. Keep the binary configurable (GRI-1884).PrivateTmp=yes, andabstractions/user-tmpallows it), then move the pages into the media dir.install.sh. It edits a system security profile on the customer's machine, and it is distro-specific.Also note for the test: soffice on that 4-core server takes over 5 minutes for this 83-slide deck (one core at 100%). That is slow, not hung; #233 (progress) makes it visible.
Done-when for #229 now also includes: a PPTX converts on a fresh Ubuntu 26.04 install, with AppArmor enabled, with nothing changed by hand.
Product owner decision, 2026-11-15 17:32 UTC (GRI-2051): use
pdftoppmfor both PDF and PPTX slide images. Ghostscript (gs) is no longer used for PPTX. So:soffice --convert-to pdf(own profile folder per conversion), thenpdftoppm, then the ffmpeg join. Same rasteriser code path as PDF uploads.gscall and theghostscriptpackage frominstall.sh, unless something else still needs it./etc/apparmor.d/local/gsrule and thescryglass-sofficewrapper from the test server.Fix is in PR #243, against
dev.Cause: the native install path only ever installed
poppler-utils. Adding the packages alone would not have fixed it either: the systemd unit runs the server with no writable home, andsofficethen exits 77 ("User installation could not be completed").What it does:
install.sh(install andupgrade server) and the container image both installpoppler-utils libreoffice-impress ghostscript ffmpeg, headless,--no-install-recommends.sofficegets its own profile for each conversion, so it works under the systemd sandbox and two uploads at once do not collide.warning:line for each converter it cannot find, and says what stops working.Measured: on this host's LibreOffice 24.2.7 with no writable home, the old call exits 77 and the new one exits 0 and writes the PDF. The installer test passes on the branch and fails on
dev. The local Rust gates pass.Still to do: forge CI on #243, then the merge into
dev. Once it is deployed, the test server needsinstall.sh upgrade serverto pick up the packages.CI on
05c0e69failedcargo test. Three tests incrates/server/tests/pptx_video_acceptance_integration.rsuse a fakesofficethat read the output folder as$5. With-env:UserInstallation=…now the first argument,$5is the literal--outdir, so the fake wrote to a path that does not exist and the upload returned 400.Fix (
4633fd8, formatted in69462aa): the fake now takes the argument after--outdir. That is the same pattern the unit-test fake inpptx_video.rsalready uses, and the fakegsalready finds its output by flag the same way.Why my local run said green: this repository's
scripts/local-gates.shdoes not setSIGNAGE_TEST_DATABASE_URL. These suites then print "skipping" and count as passed. I reran with the variable set against a local Postgres. Result:local-gates.sh --rust-onlyexit 0 on69462aa, 0 failures, and all 4 tests in that file pass.Pushed. PR #243 is now at
69462aa(dev merged in) and CI is running.Still needed after merge and deploy: run
install.sh upgrade serveron the test server so the packages get installed.Chief of staff, for the Monday demo: merge dev into #243, run the narrow tests in the foreground (no background job; local-gates.sh has no --start in this repo), push. I merge when CI is green.
Reopened (chief of staff, 2026-11-16). PR #243 fixed the packages and the LibreOffice profile, but not the second half of this issue:
gs:config.rs:207rasterizer_path: "gs",pptx_video.rs:164. The product owner's decision of 2026-11-15 17:32 UTC waspdftoppmfor both PDF and PPTX.install.shhas no AppArmor handling, so on a fresh Ubuntu 26.04 thegsprofile refuses the server's data folder and every PPTX upload fails with "gs failed: Unrecoverable error". The test server only works because of my hand-made/etc/apparmor.d/local/gs.Still needed: PPTX uses the
crate::pdf(pdftoppm) path,gsis dropped, and the full tool error reaches the panel. Done when a PPTX converts on a fresh Ubuntu 26.04 with AppArmor on and nothing changed by hand.The second half is in PR #288, against
dev. It follows the decision of 2026-11-15 17:32 UTC:pdftoppmfor both PDF and PPTX.soffice --convert-to pdfwith its own profile per conversion, thencrate::pdf::render_pages. That is the samepdftoppmcode as a PDF upload.gsis no longer called anywhere.ghostscriptis removed frominstall.shand from the container image. The installer test fails if either one lists it.sofficeorffmpegnow reports its exit status, stderr and stdout. Above 2 KB the end is kept, which is where both tools print the fatal line.Measured on the build host: the sample deck renders with the real LibreOffice 24.2 and the real pdftoppm 24.02, with no writable home, in 5.2 s. The narrow unit and integration tests, clippy and the installer test all pass. Forge CI is running.
Not measured yet: the acceptance condition. That is a fresh Ubuntu 26.04 with AppArmor on and nothing changed by hand. I cannot reach the test server. After merge and
install.sh upgrade serverthere, please remove/etc/apparmor.d/local/gsand thescryglass-sofficewrapper before the test upload, so the test measures the fix and not the workaround. A remaining denial shows asapparmor="DENIED"injournalctl -k, and the panel error now carries the tool's full output.PR #288 is merged into
dev(7c8e2e7, which containsa1fea0f). I checked this withfj landed GRI-2131, exit 0. The code side of this issue is done: PPTX goes through soffice (a fresh profile for each conversion) and then pdftoppm, Ghostscript is gone, errors keep the full text, and install.sh plus the image install the converters.I am leaving this issue open because the acceptance condition is not proven yet: a PPTX converting on a fresh Ubuntu 26.04 install with AppArmor on. Vivy has taken that run. Steps on the test server:
install.sh upgrade server/etc/apparmor.d/local/gsrule and thescryglass-sofficewrapper, so the test measures the fix and not the workaround.If it converts, this can be closed. If it fails, put the error text here and I will take it from there.