Errors
DSAR-BE-1410: PERSISTENCE_TENANT_SCOPE_MISSING
Alpha
DSAR is currently in alpha. APIs, package surfaces, configuration, and documentation may change as the project evolves.
Meaning
A backend persistence operation was attempted without the required tenant scope. Every database query must be scoped to a tenant to enforce data isolation.
Probable Causes
- The request pipeline did not resolve or inject a tenant ID.
- Middleware that sets tenant scope was bypassed or misconfigured.
- A background job or internal service call omitted the tenant context.
How to Fix
- Ensure all persistence calls are wrapped with
withTenant(tenantId). - Verify tenant resolution middleware is active in the request pipeline.
- For background jobs, explicitly provide the tenant ID from the job payload.
Retryable
No. The tenant scope must be provided before retrying.
Response Shape
Minimal Trigger Example
Any persistence query executed outside a withTenant scope.