Docs

Error codes

Every refusal and every failure carries a stable upper-case code. The SDKs raise it (ConnectivitizerError.code in TypeScript and Python, ConnectivitizerException.code on the JVM, ErrorCode of PlatformException, TunnelException and PathException in .NET), cz prints it after code:, the ESP32 library returns it from lastError(), and the web app shows it under Connections and Activity. A session that is relayed instead of direct is not an error; its reason is explained in Troubleshooting.

The common ones

CodeMeaningWhat to do
DEVICE_OFFLINEThe device's agent is not connected to the platform.Start the device's agent (or the device); on a device run by cz, cz agent run. Check that the device's key is valid and not revoked.
DEVICE_NOT_FOUNDNo device of that name in the application's workspace.Use the device's name as it appears under Devices (the name it logged in with, not its alias).
SERVICE_NOT_EXPOSEDThe device has not declared that service.Expose it on the device (expose(…), services: {…}, cz service add), then restart the agent.
TARGET_UNREACHABLEThe device could not connect to its own local service.Check that the service runs and listens on the address and port the device exposes.
FORBIDDENThe application's credential has no access rule for the device or service, or the device lists other clients as the only ones allowed to connect. For a device that opens a session: its device key does not allow that, or the key's access rules do not cover the other device.Check the key under Credentials and Clients allowed to connect on the device's page in the web app.
UNAUTHENTICATEDThe key or token presented is not valid.Check the API key, device key or link; create a new one in the web app if it was revoked.
CREDENTIAL_REVOKED, DEVICE_REVOKEDThe credential or device was revoked in the web app.Create a new key, or a new device.
E2E_SHARED_KEY_MISMATCHThe two endpoints hold different shared keys.Put the same czs_… key on both sides.
E2E_NO_COMMON_METHODOne endpoint has only certificates, the other only a shared key.Give both the same shared key (on a cz device: cz key add default czs_…), or pair them.
E2E_TRUST_MISSING, E2E_PEER_UNTRUSTEDWith certificates: an endpoint has no pin for the other side, or a different one.Pair the two (cz pair create / accept / complete).
LINK_DENIED, LINK_EXPIREDThe request to link an app was refused, or nobody approved it within ten minutes.Start linking again from the app or tool (for cz: cz link).
DIRECT_UNAVAILABLEThe service's policy demands a direct path, and none could be found.Set the service's path policy back to direct-preferred, or see Troubleshooting.
RELAY_QUOTA_EXCEEDEDThe plan's relay allowance for this month is used up, over all workspaces of the account that owns this one. Direct sessions still work.Plan in the web app.
PLAN_LIMIT_REACHEDThe plan allows no more workspaces, devices (counted over all workspaces of the account) or members.Remove unused ones, or change the plan.
PLAN_FEATURE_UNAVAILABLEThe workspace's plan does not include the feature.Plan in the web app.
SERVICE_DISABLEDThe service is switched off in the web app.Switch it on under the device's services.
COMPATIBILITY_NOT_ENABLEDCompatibility mode (through the gateway, not end-to-end) lacks one of its two opt-ins.Enable it for the service in the web app and on the device (cz service add … --allow-compatibility).
ENROLLMENT_TOKEN_INVALIDThe enrollment token is unknown, expired, revoked or used up.Create a new one under Devices → Enroll a device.
PROTOCOL_UNSUPPORTEDThe Connectivitizer library is older than the platform accepts (the error names the revision it needs, minProtocol). The device stops trying; its page in the web app says too old: update.Update the library: the SDK package, cz, the Connectivitizer app, or the ESP32 library in the firmware (build and flash it again).
RATE_LIMITEDToo many requests of one kind in a short time. The error's message says which, and how long to wait (HTTP Retry-After, retryAfter in the SDKs).Wait that long and try again. The SDKs and cz already wait and retry a few times by themselves. For enrollment see below.

Enrollment refused with RATE_LIMITED

To stop anyone guessing tokens, the platform counts failed enrollments per enrollment token (a mistyped or wrong token counts too). After about 20 failures within a minute it refuses every enrollment with that token for a short while, even with the correct token, with the message "Too many failed enrollment attempts with this enrollment token in the last minute. Wait n seconds and try again, and check the token for typos." Nothing is broken and the token is still valid: wait the seconds given, check that the token is copied completely (it starts with cze_), and enroll again. A script that enrolls many devices should stop on ENROLLMENT_TOKEN_INVALID instead of retrying, so that a wrong token does not lock out the right one. Successful enrollments are limited separately and far higher, so that a fleet can enroll with one token; the message then says the token was used for too many enrollments in the last minute.

Connectivity

These usually mean the network or the other side went away; retrying later is reasonable.

CodeMeaning
SIGNALING_TIMEOUT, SIGNALING_UNAVAILABLEThe platform or the peer did not answer in time.
RELAY_UNREACHABLE, RELAY_REJECTEDThe relay could not be reached, or refused the connection.
RELAY_PEER_TIMEOUTThe peer did not connect to the relay in time.
PATH_CLOSEDThe path ended: the peer left or the connection dropped.
PATH_IDLE_TIMEOUTNothing was received on a direct path for too long.
SESSION_CLOSEDThe session was closed in an orderly way.
LEASE_EXPIREDThe session was not renewed in time.
SESSION_REVOKEDThe platform ended the session (for example because a key was revoked).

Rare

CodeMeaning
E2E_HANDSHAKE_FAILED, E2E_PROTOCOL_MISMATCH, E2E_SESSION_BIND_MISMATCHThe end-to-end handshake did not complete, or the endpoints disagree about the session. Usually two incompatible versions; update both sides.
E2E_PEER_NO_CERTIFICATE, E2E_PEER_CERTIFICATE_EXPIREDWith certificates: the peer presented none, or an expired one.
GRANT_INVALID, GRANT_EXPIREDThe session's grant from the platform is not valid; often a clock that is far off.
DENIED_BY_GRANT, DENIED_BY_LOCAL_POLICY, DEVICE_REJECTED, NO_PERMITTED_MODEThe platform's policies or the device's own settings leave no way to connect.
IDENTITY_NOT_REGISTERED, PROOF_INVALID, PRIVATE_KEY_REJECTEDAn enrolled endpoint's identity or proof did not verify.
MUX_PROTOCOL_ERRORThe peer violated the protocol; update both sides.
INVALID_REQUEST, NOT_FOUND, CONFLICTThe request was malformed, names nothing the caller may see, or collides with existing state.