agnes-the-ai-analyst/infra/modules/customer-instance
ZdenekSrotyr fc6de77e06
fix(infra): pre-create /data/uploads in customer-instance startup script (#351)
* fix(infra): pre-create /data/uploads in customer-instance startup script

v50/0.55.0 introduced marketplace cover-image uploads mounted under
${DATA_DIR}/uploads; app/main.py eagerly mkdirs the directory at boot
for the StaticFiles mount. On host-bind deploys where /data root is
root-owned, the container's non-root agnes user (UID 999) can't create
that directory and crashloops with PermissionError: '/data/uploads'.

Add 'uploads' to the existing mkdir + chown block in
infra/modules/customer-instance/startup-script.sh.tpl so the dir is
pre-created with the correct ownership at provision time — same way
state/analytics/extracts have been since infra-v1.7.0. The block runs
inside the [ -b $DATA_DEV ] guard, so it only fires when the data
disk is attached (idempotent on reboot, no-op when disk missing).

Fresh VMs provisioned at infra-v1.9.0+ get the dir at first boot. For
existing instances, bump the module pin + terraform apply (rewrites
the instance startup-script metadata) and reboot the VM so the
refreshed block replays — or run a one-off:
  sudo mkdir -p /data/uploads && sudo chown 999:999 /data/uploads

* release: 0.55.2 — pre-create /data/uploads in customer-instance startup script
2026-05-19 13:59:39 +00:00
..
main.tf infra(customer-instance): allow stopping VMs for in-place updates (#211) 2026-05-07 06:58:10 +02:00
outputs.tf chore(oss): isolate customer-specific deploy bits from scripts/grpn/ (#88, wave 1) (#94) 2026-04-27 20:24:34 +02:00
startup-script.sh.tpl fix(infra): pre-create /data/uploads in customer-instance startup script (#351) 2026-05-19 13:59:39 +00:00
variables.tf refactor(ops): bake all host artifacts into image, drop every curl-from-main (#149) 2026-04-30 21:40:25 +02:00