Troubleshooting

When a conversation doesn't happen, three places tell you where it stopped:

  • Your server: what POST /v1/sessions answered.
  • The browser's console on the page where the participant talks: what connectEngineSession rejected with.
  • Cullman: the session in the agent's Logs, with its status and how it ended.

Find what you see below.

Starting a session fails

Your server's POST /v1/sessions answers an error, and no session shows in Cullman. The answer's code says why; Sessions API lists every one. The usual ones:

You seeWhyWhat to do
409 nothing_promotedYou named no version, and the agent has nothing in production.Promote a version in Cullman, or name one in the request.
401 unauthorizedThe API key is missing, mistyped, revoked, or from another workspace.Create a key in the agent's workspace under Settings › API keys.
404 not_foundNo agent with that slug in the key's workspace, or it was archived.Check the slug on the agent's page, and that the key belongs to the same workspace.
400 invalid_variablesA variable the version needs is missing or has the wrong type.details names each one.

The page can't connect

The session was created, but the browser never joined it. In Cullman the session shows Connecting, has no transcript, and after 5 minutes ends with Never connected as its end reason.

"WebSocket connect timed out": your page's Content Security Policy blocks the engine

What you see. About 10 seconds after the page starts connecting, connectEngineSession rejects with EngineConnectError: WebSocket connect timed out. Earlier in the console there are lines like:

Refused to connect to 'wss://engine.cullman.ai/v1/sessions/…/ws' because it violates the following
Content Security Policy directive: "connect-src …"

Why. The page connects to the engine itself, at the engine_url your server got when it started the session: an HTTPS request for WebRTC first, then a WebSocket if WebRTC doesn't connect. Both fall under your page's connect-src. If your site sends a Content Security Policy that doesn't list the engine, the browser blocks both. A blocked WebSocket reports nothing at all, so the client only gives up when its own timer runs out.

What to do. The policy is your site's, so the fix is on your side: add the engine's origin to connect-src, once for https: and once for wss:.

connect-src 'self' https://engine.cullman.ai wss://engine.cullman.ai;

Use the origin of the engine_url you get back. If your app talks to more than one engine, for example one for testing, list each. Nothing else in the policy needs to change for the call.

To check from the page itself, run this in its console, with your engine's origin. A blocked engine prints blocked: … connect-src. An allowed one prints no blocked: line; the request itself fails with 401, since it carries no token, and that's expected.

document.addEventListener('securitypolicyviolation', (e) => console.log('blocked:', e.blockedURI, e.effectiveDirective));
fetch('https://engine.cullman.ai/v1/sessions/00000000-0000-0000-0000-000000000000/connect', { method: 'POST' });

"WebSocket closed" at once: the client token can't be used

What you see. connectEngineSession rejects right away with EngineConnectError: WebSocket closed (1006). With transport: 'webrtc' it's connect failed: 410 … or connect failed: 409 … instead. Unlike a blocked engine, the console shows no connect-src line, and the rejection comes at once rather than after 10 seconds.

Why. A client token works for one connection, and only for 5 minutes after the session starts. The engine refuses it with 410 when the token has expired or the session already ended, and with 409 when the session is already connected, for example from a second tab or a component that connected twice.

What to do. Start the session when the participant is about to talk, not when the page loads. Connect once per session; to try again, start a new session.

NotAllowedError: the participant refused the microphone

What to do. Serve the page over HTTPS, and call connectEngineSession from a click: browsers only open the mic and play audio after the participant did something on the page. See Browser client.

It connects, but slowly on some networks

Some networks block WebRTC. With transport: 'auto', the client waits up to backstopMs (8 seconds by default) for WebRTC, then connects over WebSocket, and the call works. Nothing needs fixing. If you know your participants are behind such a network, transport: 'websocket' skips the wait.

The call ends early

End reason on the session's page in Cullman, or end_reason from the API, says who closed it. Sessions API lists each one.

Cullman showsWhy
The connection droppedThe browser lost its connection: WebRTC stayed disconnected for 5 seconds, or a WebSocket stopped answering. The session can't be rejoined; start a new one.
Reached the maximum durationThe session hit its longest allowed length.
The engine restartedThe engine instance carrying the call stopped. Start a new session.
Ended by an errorSomething failed during the call.