Fresh install on Fly Managed Postgres fails: `REVOKE ALL ON FUNCTION … FROM PUBLIC` is rejected ("MPG system roles cannot be modified")
Summary
A fresh qm up on the Fly target with Fly Managed Postgres cannot start core. Database initialization runs REVOKE ALL ON FUNCTION qm_self_serve_tenant(text, text, text), qm_self_serve_provisioned(uuid, text) FROM PUBLIC, and Fly Managed Postgres rejects it:
error: MPG system roles cannot be modified
Core exits on boot and the deploy is rolled back.
docs/upgrading-runtime.md already notes that Fly Managed Postgres rejects grants to PUBLIC, and the boot and serving tenant functions were changed to avoid them. The self-serve tenant functions still revoke from PUBLIC. On main (3f5a322), db/schema.sql lines 5489–5495 contain the same pattern for four functions (qm_external_org_account_check, qm_external_org_account_differs, qm_self_serve_provisioned, qm_self_serve_tenant), so I expect a fresh install from main to fail the same way (I have not run main itself).
Steps to reproduce
npm i @yc-software/[email protected],qm init --target fly(regionnrt),qm setup,qm secrets pushqm up— creates a new Fly Managed Postgres cluster (Basic) and stages itsdirect_uriasDATABASE_URL- Core logs
error: MPG system roles cannot be modifiedduring initialization and never passes health checks
Environment
- QM 0.1.20 (
next), Fly target, regionnrt, fresh database - Fly Managed Postgres, Basic plan, new cluster created by
qm up - 0.1.18 fails earlier on the same database with the migration-ownership check (#3379, fixed on
main)
Workaround
Pointing DATABASE_URL at an unmanaged Fly Postgres app (full superuser) works.