fix(browser): run camoufox fetch as root so geoip mmdb write succeeds — RED build-browser (#905) #908

Merged
lekss361 merged 1 commit from fix/905-camoufox-geoip-mmdb into main 2026-05-31 14:53:05 +00:00

1 commit

Author SHA1 Message Date
393ecea458 fix(browser): run camoufox fetch as root so geoip mmdb write succeeds (#905)
CI build-browser (and the deploy) went red on #907's browser image:
  PermissionError: [Errno 13] Permission denied:
  '/usr/local/lib/python3.12/site-packages/camoufox/GeoLite2-City.mmdb'

camoufox fetch with geoip=True downloads TWO things: the Firefox build (→
$HOME/.cache, correctly routed to /home/app via ENV HOME, the #899 fix) AND the
GeoLite2 mmdb, which it writes INTO the camoufox package dir in site-packages.
Since the browser image pip-installs camoufox as root, that dir is root-owned, so
running fetch as the app user can't write the mmdb → build fails.

Fix: run fetch as root (writes both the mmdb and — via ENV HOME — Firefox into
/home/app/.cache), then chown the Firefox cache to app. The mmdb stays root-owned
in site-packages but world-readable, which is all the runtime app user needs.

Verified by a real local image build (camoufox fetch now completes, image exports).
The deploy was gated off by the failed build-browser job (not partially applied),
so prod was never broken.

Refs #905, #883, #899
2026-05-31 17:51:43 +03:00