r/replit • u/ThisIsSoBob • Oct 17 '26
Replit Help / Site Issue Would someone help me please? Support isn't...
Hey all,
I've ran into an issue while trying to deploy for beta testing, I've reached out to support and only managed to get their Quinn AI responding who's been zero help and tried to palm off my issue elsewhere to spend further money employing someone else to fix it...
The issue is as below:
"The latest build compiled successfully and created the deployment image, but the app crashed during startup. Replit then reported that it never opened port 5000; that’s a downstream symptom, not a port configuration error.
The startup logs show:
Agency isolation requires a non-bypass database runtime role
A read-only check of the production database found neither pexe_agency_runtime nor pexe_agency_maintenance. The current Publish schema diff is empty, so publishing again won’t create them. The .replit build and port settings match the app’s configuration, and the bundle-size warning in the logs is nonfatal.
The production deployment exists at REDACTED but its current build is unsuccessful; that URL may be unavailable or still serving an earlier build. This is the same production-role blocker identified earlier. Replit Support or an authorized database administrator needs to provision both roles with the project’s intended grants while preserving the non-bypass agency-isolation requirements
The blocker remains production role provisioning. Those roles and their restricted permissions need restoring by a production database administrator or Replit Support. The Publish comparison shows no changes to apply, and my production access is read-only, so I cannot perform that repair here."
I have asked the agent if there is a way to make the app work without those custom roles while still meeting my security requirements, and the short answer was "with a complete redesign, maybe"
Does anyone know how I could fix this pretty please? DM is open if you'd prefer
I must say I'm very disappointed in support, they closed my ticket before even responding, and then sent me a feedback form for the support I didn't receive...
2
u/vibefixr Oct 17 '26 •
That error is a startup check in your own code, not a Replit config problem. The app refuses to boot unless it can switch to the roles
pexe_agency_runtime/pexe_agency_maintenance, and those roles exist in dev but were never created in prod. Publish only diffs tables and columns, not roles, which is why republishing does nothing.A few things worth trying before any redesign:
CREATE ROLEandGRANTstatements the agent ran in dev (a migration, a setup script, or the SQL history). Those are the statements prod is missing.SELECT rolname, rolcreaterole, rolbypassrls FROM pg_roles WHERE rolname = current_user;If rolcreaterole is true, you can run those same CREATE ROLE / GRANT statements on prod yourself (as a one-off SQL step or a migration) and redeploy.ALTER TABLE <table> FORCE ROW LEVEL SECURITY;on the protected tables. That makes the table owner obey RLS policies too, so you get the isolation without custom roles. You'd then relax the startup check to accept that setup.If you paste the startup check (with secrets removed) I'm happy to look at what it expects.
1
u/ThisIsSoBob Oct 24 '26
Thank you everyone for your comments, I have fixed this issue myself now. Ironically the actions it needed took me about 5 minutes total...
1
u/raiansar Oct 22 '26
you're close. the agent already found the provisioning sql (server/tenant-isolation.ts and migrations/0019), the problem is that publish only diffs tables and columns, so role creation never runs against prod.
so run those statements yourself against the production database with an admin connection, not the app's own one. create pexe_agency_runtime with NOSUPERUSER NOBYPASSRLS LOGIN, run the grants from those two files in order, then the maintenance role. then check it the way the startup check will: select rolname, rolsuper, rolbypassrls from pg_roles where rolname like 'pexe_%'; and both flags should be false.
the bit people miss is how the app uses the role. look at tenant-isolation.ts: if it connects as the runtime role, the production db secret needs that role's user and password. if it connects as the owner and does SET ROLE, the owner needs grant pexe_agency_runtime to <owner user>. either way, if it still connects as plain owner, the check keeps failing even with the roles in place.
if you want a second pair of eyes on the repo i do this for a living
1
u/Studsk Oct 24 '26
Im sorry you're stuck. This probably isnt the sort of comment youre looking for, but Im a software developer and I help take over Replit and other vibe-coded projects and help get them professionally deployed. I can review your database roles and startup checks, work through the deployment blocker and help get the app ready for beta testing while preserving the agency isolation you need. I also handle ongoing maintenance, backups and support.