fix(tradein): camoufox fetch under app-user so runtime finds Firefox (#884) #899
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#899
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/884-camoufox-cache-path"
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?
Problem (found by real build-verify on the deploy host)
The #884 Dockerfile ran
RUN python -m camoufox fetchas root, so the ~960MB Firefox build landed in/root/.cache/camoufox. But the container runs asapp(uid 1000), and camoufox/platformdirs resolves its cache off$HOME→/home/app/.cache/camoufox. Result: the momentscraper_fetch_modeis flipped tobrowser, the runtime would not find the browser and would try to re-download 960MB on first scrape (or fail).Verified on the prod build host (2026-05-31)
docker build --target runner→ EXIT 0, image 3.15GB (content 1GB) — builds fine.docker run … /app/.venv/bin/python -m camoufox path(as app) →/home/app/.cache/camoufoxNo such file or directory;/root/.cache/camoufox→ exists butPermission deniedto app.Fix
Move the fetch after
USER appand set explicitENV HOME=/home/app(Docker does not auto-set$HOMEfromUSER, and the fetch needs the right$HOMEat build time). Now both the build-time fetch and the runtime resolve to/home/app/.cache/camoufox.Risk
Dormant —
scraper_fetch_modedefault stayscurl_cffi, so no runtime behavior change. This just makes the image correct for when browser-mode is enabled (Phase 1 #883). Note: merging rebuilds the camoufox image layer on deploy (the 960MB fetch re-runs once, now under app). Reviewer may want to time the merge off demo-eve, but the change itself is safe.Test plan
docker run … camoufox pathas app shows the dir populated, and a headlessAsyncCamoufoxlaunch returns real HTML — unblocks Phase 1.Refs #884, #883