View Issue Details

IDProjectCategoryView StatusLast Update
0011076Talermerchant backendpublic2026-03-06 21:34
ReporterFlorian Dold Assigned ToChristian Grothoff  
PriorityhighSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version1.5Fixed in 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
Tagsdiscussion-needed

Relationships

related to 0010588 resolvedChristian Grothoff After installing taler-merchant (Deb/trixie-testing): /var/lib/taler-merchant missing, instead /var/lib/taler-exchange is there 

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-03-04 23:01

manager   ~0027989

I've now packaged the *exchange* typst resources. Next: same for merchant.

Christian Grothoff

2026-03-06 15:18

manager   ~0028012

Merchant modified, next need to test the Debian packages.

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-22 14:27 Christian Grothoff Target Version 1.5 => 1.6
2026-02-22 15:15 Christian Grothoff Relationship added related to 0010588
2026-02-26 20:02 Christian Grothoff Tag Attached: discussion-needed
2026-02-26 20:02 Christian Grothoff Priority normal => high
2026-02-26 20:04 Christian Grothoff Relationship added related to 0011072
2026-02-26 20:04 Christian Grothoff Relationship deleted related to 0011072
2026-03-04 23:00 Christian Grothoff Status feedback => assigned
2026-03-04 23:01 Christian Grothoff Note Added: 0027989
2026-03-06 15:18 Christian Grothoff Note Added: 0028012
2026-03-06 21:34 Christian Grothoff Status assigned => resolved
2026-03-06 21:34 Christian Grothoff Resolution open => fixed
2026-03-06 21:34 Christian Grothoff Fixed in Version => 1.5
2026-03-06 21:34 Christian Grothoff Target Version 1.6 => 1.5