MPBX-VERSION-MISMATCH | conflict | Optimistic locking: the row changed since you read it (the message gives the expected and current version). | Reload the object and apply your change again. |
MPBX-PG-DUPLICATE | conflict | A unique rule rejected the write, for example an extension number already used in this company. The message names the constraint. | Pick another value. |
MPBX-PG-REFERENCE | invalid_argument | A reference points to a row that does not exist in this company, or a row is still referenced and cannot be deleted. | Check the referenced id and tenant; delete dependants first. |
MPBX-PG-CONSTRAINT | invalid_argument | A value breaks a CHECK or NOT NULL rule (bad slug, bad number format), or a published call-flow version was modified. | Fix the value. Published flow versions are immutable: publish a new version. |
MPBX-PG-RETRY | conflict | Serialization failure or deadlock between concurrent transactions. Retryable. | Retry the operation. |
MPBX-PG-UNAVAILABLE | unavailable | Postgres is unreachable, restarting, or the pool had no free connection within 5 s. Retryable. | Check Postgres health and postgres.max_connections. |
MPBX-PG-TENANT-DENIED | permission_denied | Row-level security or a table privilege refused the statement (SQLSTATE 42501): a company transaction tried to write a row of another company, move a row to another company, or touch an install-wide table (install settings, the company list). Also raised when the login role may not switch to mpbx_tenant/mpbx_system. | A bug or an attack in the calling code: company code must only use TenantTx repositories. If it appears at start-up, grant the roles: GRANT mpbx_tenant, mpbx_system TO <login role>; (as a superuser). |
MPBX-PG-QUERY | internal | Any other database error. The message carries the SQLSTATE. | Report it with the log line. |
MPBX-PG-URL-INVALID | config | postgres.url does not parse as a postgres:// URL. The URL itself is never printed. | Fix MPBX__POSTGRES__URL or mpbx.toml. |
MPBX-PG-LOGIN-SCOPE-UNSAFE | config | At start-up, a per-scope login (postgres.tenant_url / postgres.system_url, FU-PBX10-M1) has more rights than its scope allows: the tenant login is a superuser, has BYPASSRLS, is a member of mpbx_system or not of mpbx_tenant; or the system login is a superuser, has BYPASSRLS or is not a member of mpbx_system. | Use the roles mpbx_tenant_login / mpbx_system_login from the migrations unchanged (docs/guides/database-logins.md). |
MPBX-PG-MIGRATION-FAILED | internal | A migration failed and its transaction was rolled back; the schema is unchanged. | Read the cause in the log, fix the database state or report a bug. |
MPBX-PG-MIGRATION-MODIFIED | config | A migration that is already applied was edited after release (checksum differs). Migrations are append-only. | Ship the change as a new migration and restore the original file. |
MPBX-PG-SCHEMA-AHEAD | config | The database has migrations this binary does not know: an older binary was started against a newer schema. Nothing is changed. | Run the newer release, or roll back with the pre-upgrade database snapshot (mpbx rollback). |
MPBX-PG-MIGRATION-DIRTY | internal | A previous run stopped half way through a non-transactional migration. | Restore from backup. (All shipped migrations are transactional, so this should not happen.) |