View Issue Details

IDProjectCategoryView StatusLast Update
0011076Talermerchant backendpublic2026-02-15 00:13
ReporterFlorian Dold Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
Target Version1.5 
Summary0011076: merchant report PDF generation fails with permission error on Debian trixie
DescriptionThe report generation works locally on my system, but on the server we run into a permission problem. See logs below.
Additional InformationFeb 14 21:55:57 betel taler-merchant-httpd[329291]: error: failed to load package (failed to create temporary package directory: Permission denied (os error 13))
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: ┌─ usr/share/taler-merchant/typst-forms/transactions.typ:1:8
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: │
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: 1 │ #import "@preview/cetz:0.4.2": canvas, draw, palette
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: │ ^^^^^^^^^^^^^^^^^^^^^
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: help: error occurred while importing this module
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: ┌─ tmp/taler-typst-zXYooV/0/input.typ:1:8
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: │
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: 1 │ #import "/usr/share/taler-merchant/typst-forms/transactions.typ": form
Feb 14 21:55:57 betel taler-merchant-httpd[329291]: │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 14 21:55:57 betel taler-merchant-httpd[329227]: (SQABCVGPAAJK7MQH63Y4WKY51R) ERROR typst exited with status 1
TagsNo tags attached.

Activities

Florian Dold

2026-02-14 23:09

manager   ~0027722

Note that running it as root *works*:

$ typst compile --root / /tmp/taler-typst-zXYooV/0/input.typ

Running it via `sudo -u taler-merchant-httpd ...` results in the same error message we see above.

Florian Dold

2026-02-14 23:12

manager   ~0027723

Note that typst does try to download packages while building (!), so it might be that downloading the packages causes the permission issues. We either need to accommodate for this somehow or download the packages beforehand / during installation if possible.

Florian Dold

2026-02-14 23:18

manager   ~0027724

The folder that typst wants to write to is: /var/lib/taler-merchant/.cache/typst/packages/

Florian Dold

2026-02-14 23:19

manager   ~0027725

While typst does't have an official way to download packages for "offline use", we should either hack around this or not use the package.

Florian Dold

2026-02-14 23:22

manager   ~0027726

We fixed it manually by creating the .cache directory and setting the permissions.

We should still discuss how to properly solve this / what to do about the dynamic package downloads.

Florian Dold

2026-02-14 23:44

manager   ~0027727

Last edited: 2026-02-15 00:01

IMO, the proper way is to use local packages (https://github.com/typst/packages?tab=readme-ov-file#local-packages).

TL;DR: Typst can load packages from $XDG_DATA_HOME/typst/packages/local/$NAME/$VERSION.

It solves multiple problems:
* We don't need to rely on dynamically downloaded packages anymore
* You don't need to break the sandbox anymore. Common files (i.e. .typ files or images) just go into a local typst package (i.e. a taler-merchant or taler-exchange typst package) that is installed with whatever package we're installing.

Christian Grothoff

2026-02-15 00:13

manager   ~0027728

I don't like this. The '.typ' files we ship with right now are mere examples, and merchants might customize them a lot. Expecting them to use local typst packages seems like bad UX. Why not have /var/lib/taler-merchant/.cache/ be RW for the taler-merchant-httpd? that seems reasonably safe.

Issue History

Date Modified Username Field Change
2026-02-14 23:02 Florian Dold New Issue
2026-02-14 23:02 Florian Dold Status new => assigned
2026-02-14 23:02 Florian Dold Assigned To => Christian Grothoff
2026-02-14 23:09 Florian Dold Note Added: 0027722
2026-02-14 23:12 Florian Dold Note Added: 0027723
2026-02-14 23:18 Florian Dold Note Added: 0027724
2026-02-14 23:19 Florian Dold Note Added: 0027725
2026-02-14 23:22 Florian Dold Note Added: 0027726
2026-02-14 23:22 Florian Dold Status assigned => feedback
2026-02-14 23:44 Florian Dold Note Added: 0027727
2026-02-14 23:44 Florian Dold Status feedback => assigned
2026-02-14 23:45 Florian Dold Status assigned => feedback
2026-02-14 23:46 Florian Dold Note Edited: 0027727
2026-02-15 00:01 Florian Dold Note Edited: 0027727
2026-02-15 00:13 Christian Grothoff Note Added: 0027728