104001: Session subscription failed

session_subscription_failed

An AI Transport session could not subscribe to and attach its channel while connecting. The channel may have been rejected, unreachable, or in a failed state, so the session can neither send nor receive.

What you should do

What to do depends on the cause. A transient failure, such as the Ably client being briefly disconnected, clears on a retry: call connect() again, which starts a fresh attempt rather than returning the earlier failure. A non-retryable cause, such as a capability or auth rejection, keeps failing until you fix it.

Nothing sends or receives until the attach succeeds, and sends attempted in the meantime are not queued: each rejects with this same code, carrying the connect failure as its cause and telling you to connect again.

Why it happens

Connecting a session subscribes to its channel and attaches it. This error is raised when either step is rejected; common reasons are the Ably client not being connected, the token lacking the channel's capabilities, or the channel being in a failed state. The originating error is preserved as the cause.

What you'll see

The error is reported with code 104001 and status 500. Messages take the form unable to subscribe and attach channel; .... It rejects the connect() call and is also delivered to the session's error handler.