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
| Code | Meaning | What to do |
|---|---|---|
DEVICE_OFFLINE | The 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_FOUND | No 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_EXPOSED | The device has not declared that service. | Expose it on the device (expose(…), services: {…}, cz service add), then restart the agent. |
TARGET_UNREACHABLE | The device could not connect to its own local service. | Check that the service runs and listens on the address and port the device exposes. |
FORBIDDEN | The 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. |
UNAUTHENTICATED | The 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_REVOKED | The credential or device was revoked in the web app. | Create a new key, or a new device. |
E2E_SHARED_KEY_MISMATCH | The two endpoints hold different shared keys. | Put the same czs_… key on both sides. |
E2E_NO_COMMON_METHOD | One 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_UNTRUSTED | With 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_EXPIRED | The 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_UNAVAILABLE | The 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_EXCEEDED | The 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_REACHED | The plan allows no more workspaces, devices (counted over all workspaces of the account) or members. | Remove unused ones, or change the plan. |
PLAN_FEATURE_UNAVAILABLE | The workspace's plan does not include the feature. | Plan in the web app. |
SERVICE_DISABLED | The service is switched off in the web app. | Switch it on under the device's services. |
COMPATIBILITY_NOT_ENABLED | Compatibility 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_INVALID | The enrollment token is unknown, expired, revoked or used up. | Create a new one under Devices → Enroll a device. |
PROTOCOL_UNSUPPORTED | The 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_LIMITED | Too 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.
| Code | Meaning |
|---|---|
SIGNALING_TIMEOUT, SIGNALING_UNAVAILABLE | The platform or the peer did not answer in time. |
RELAY_UNREACHABLE, RELAY_REJECTED | The relay could not be reached, or refused the connection. |
RELAY_PEER_TIMEOUT | The peer did not connect to the relay in time. |
PATH_CLOSED | The path ended: the peer left or the connection dropped. |
PATH_IDLE_TIMEOUT | Nothing was received on a direct path for too long. |
SESSION_CLOSED | The session was closed in an orderly way. |
LEASE_EXPIRED | The session was not renewed in time. |
SESSION_REVOKED | The platform ended the session (for example because a key was revoked). |
Rare
| Code | Meaning |
|---|---|
E2E_HANDSHAKE_FAILED, E2E_PROTOCOL_MISMATCH, E2E_SESSION_BIND_MISMATCH | The 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_EXPIRED | With certificates: the peer presented none, or an expired one. |
GRANT_INVALID, GRANT_EXPIRED | The 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_MODE | The platform's policies or the device's own settings leave no way to connect. |
IDENTITY_NOT_REGISTERED, PROOF_INVALID, PRIVATE_KEY_REJECTED | An enrolled endpoint's identity or proof did not verify. |
MUX_PROTOCOL_ERROR | The peer violated the protocol; update both sides. |
INVALID_REQUEST, NOT_FOUND, CONFLICT | The request was malformed, names nothing the caller may see, or collides with existing state. |