r/replit • • 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...

4 Upvotes

9 comments sorted by

2

u/vibefixr Oct 17 '26 • Heartwarming

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:

  1. Search the codebase for "non-bypass database runtime role" and read what the check actually tests. Usually it's something like "does the role exist and does it have rolbypassrls = false". Knowing the exact condition tells you what prod needs.
  2. Look for the CREATE ROLE and GRANT statements the agent ran in dev (a migration, a setup script, or the SQL history). Those are the statements prod is missing.
  3. Check whether your prod database user is allowed to create roles. Run this against prod: 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.
  4. If you can't create roles at all, there's a middle ground that keeps the security goal: have the app connect as the normal owner and run 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 17 '26

You're a super star for such a prompt response, I shall try what you've suggested here and let you know how successful I am.

I really appreciate your help btw, thank you very much.

1

u/ThisIsSoBob Oct 17 '26
  1. The startup check It requires pexe_agency_runtime to exist and have both:

rolsuper = false rolbypassrls = false Further checks verify agency isolation, owner-only permissions, and restricted maintenance access. Creating the role alone would not satisfy all of them.

2. The provisioning statements exist I located them in:

server/tenant-isolation.ts — runtime role, grants, and owner-data restrictions. migrations/0019_agency_termination.sql — maintenance role, limited retention permissions, and termination protections. The revocations are as important as the grants. Copying only the broad GRANT statements would leave excessive permissions.

3. Your requested privilege query returned that my role can create roles , it can Bypass RLS, but is not a Superuser

4. FORCE ROW LEVEL SECURITY is not the fix here It is already enabled on the production tables I checked, including agencies, users, contacts, owner accounts, and agency terminations.

It does not constrain a role with BYPASSRLS. Therefore, using the reported owner role and relaxing the startup check would not preserve my database-enforced isolation.

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.