Cannot Connect To Databases

database-connect-forbidden · 403

The caller's seat in the workspace can't connect to databases, so the API opened no tunnel.

role is the seat that was judged and allowedRoles the seats that would pass. When viaKey is true, an API key made the call with its creator's seat, and email names that person. The CLI exits with code 3.

Besides the members every error carries, this type adds permission, role, viaKey, email, workspaceName and allowedRoles.

Common causes

  • The caller's seat is viewer, and viewers can't open a tunnel to a database.
  • The API key was made by someone whose seat is now viewer: a key acts with its creator's seat as it is today.

How to fix the call

  • Tell the user exactly what is missing, quoting detail and, for a key, email.
  • A seat change is for an admin of the workspace to make. Once it is made, run the same command again.
  • Don't retry unchanged: every way to a database makes the same check.

Example response

json
{
  "type": "database-connect-forbidden",
  "title": "Cannot Connect To Databases",
  "detail": "Your seat in this workspace is 'viewer'; connecting to databases needs admin or developer",
  "permission": "databases:connect",
  "role": "viewer",
  "viaKey": false,
  "email": "[email protected]",
  "workspaceName": "Acme",
  "allowedRoles": [
    "admin",
    "developer"
  ],
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/services/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/tunnels",
  "method": "POST",
  "instance": "POST /v1/services/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/tunnels",
  "status": 403,
  "docs": "https://ghaym.me/docs/errors/database-connect-forbidden"
}