Error codes
Every error from the Console API carries a stable code. The code does not change between releases, so you can build alerts and scripts on it.
The error envelope
{
"error": {
"code": "MI-1002",
"class": "config",
"message": "configuration failed validation",
"details": {}
}
}
The class groups codes by where to look:
| Class | Codes | Look at |
|---|---|---|
config | MI-1xxx | The request or the setup |
transport | MI-2xxx | Network and TLS to devices, brokers and services |
protocol | MI-3xxx | The device protocol, addresses and types |
permission | MI-4xxx and MI-5003 | Sign-in, roles, rate limits, edition features |
license | MI-5001, MI-5002 | Licence limits and expiry |
internal | MI-6xxx | The Console itself |
The Console also serves this catalogue in code. Each entry has code, class, HTTP status, message and description.
Catalogue
| Code | Class | HTTP | Meaning | What to do |
|---|---|---|---|---|
MI-1001 | config | 400 | Request body is invalid: the JSON could not be decoded or contained unknown fields. | Check the JSON syntax and field names against the API reference. Do not send fields the route does not define. |
MI-1002 | config | 400 | Configuration failed validation: a name, interval or other field failed normalization. | Read the message; fix the named field (length, characters, range). |
MI-1003 | config | 404 | Resource was not found: the device, uplink, stream, rule or related object does not exist. | Check the id. It may have been deleted, or it is outside your scoped access. |
MI-1004 | config | 409 | Resource already exists: a uniqueness constraint would be violated, such as a duplicate subscription. | Use another name or id, or edit the existing object. |
MI-1005 | config | 422 | Protocol is not selectable: the catalogue entry exists but is planned or not hosted by this runtime. | Choose a protocol that this Site Runtime hosts. See Protocol reference. |
MI-1006 | config | 422 | Required capability is not hosted: a plugin, stream source or sink is not available. | Use a runtime version that includes the plugin, or choose another type. |
MI-1007 | config | 400 | Rule SQL is invalid: the restricted SQL parser rejected the rule. | Fix the statement. You can check it first with POST /api/v2/rules/validate. See Rules. |
MI-1008 | config | 400 | Configuration is invalid: a required key is missing or out of range. | Set the missing or out-of-range setting named in the message. |
MI-1009 | config | 500 | Database schema does not match this binary: the database has a migration the binary does not know, or a required migration is missing. | Run the migration of the matching version, or use matching Console and database versions. See Upgrade. |
MI-1010 | config | 400 | TLS configuration is invalid: certificate or key files are missing, mismatched or unreadable. | Check MI_CONSOLE_TLS_CERT_FILE, MI_CONSOLE_TLS_KEY_FILE and file permissions. |
MI-1011 | config | 500 | Secrets master key is missing, shorter than 32 characters, or cannot open stored secrets. | Set MI_MASTER_KEY (32 or more characters). If a secret was sealed with an older key, set MI_MASTER_KEY_PREVIOUS to rotate. |
MI-1012 | config | 503 | The Windows site runtime EXE is not installed on this Console. | Install the Windows runtime pack and set MI_WINDOWS_RUNTIME_EXE, or use a Linux or Docker runtime. |
MI-1013 | config | 413 | Request body is too large. | Split large tag writes into batch upserts. |
MI-1020 | config | 400 | A renamed environment variable from 1.x is still set. | Remove the old variable and use the MI_ name shown in the error details. |
MI-2001 | transport | 502 | Connection failed: a device, uplink or control-plane connection could not be established. | Check address, port, firewall and that the target is up. For devices see the protocol page. |
MI-2002 | transport | 504 | Operation timed out: a protocol or HTTP operation exceeded its deadline. | Raise the timeout, reduce load on the device, or check the network. |
MI-2003 | transport | 502 | TLS handshake failed with a broker, device or API. | Check the certificate chain, the host name and the clock on both sides. See Certificates. |
MI-3001 | protocol | 502 | The device returned a protocol exception, such as a Modbus exception code. | Check the address map, unit id and the device manual for the exception. |
MI-3002 | protocol | 400 | The driver does not implement the requested protocol function. | Use a supported function, or another protocol. |
MI-3003 | protocol | 400 | Device address is invalid: it could not be parsed or is outside the device map. | Check the address form on the protocol page, for example 1!40002. |
MI-3004 | protocol | 400 | Data type is not valid for this address area. | Choose a data type the area allows. See Data types. |
MI-4001 | permission | 401 | Authentication is required: the bearer token is missing or invalid. | Sign in again, or send a valid token, key or credential. |
MI-4002 | permission | 403 | Permission denied: the signed-in principal may not do this. | Ask an administrator for a role with the needed capability. See Users and roles. |
MI-4003 | permission | 429 | Too many attempts or requests; retry later. | Wait for the Retry-After seconds. At sign-in this is separate from the account lockout. |
MI-5001 | license | 422 | Licence limit reached: a licensed node or tag limit would be exceeded. | Remove objects or upgrade the licence. See Licensing. |
MI-5002 | license | 422 | Licence has expired, or is missing or invalid. | Upload a valid licence file in Settings → License. |
MI-5003 | permission | 402 | This feature is not included in the current licence edition (it is Enterprise-only). | Upgrade the edition. The class is permission, not license. |
MI-6001 | internal | 500 | Internal error: an unexpected failure. | Check the Console log with the X-Request-ID. Do not retry blindly if the operation is not idempotent. |
MI-6002 | internal | 500 | Configuration store unavailable: PostgreSQL or the store failed during a request. | Check that mi-db is running and reachable. See Health and logs. |
Codes by range: MI-1001 to MI-1013 and MI-1020 are configuration, MI-2001 to MI-2003 transport, MI-3001 to MI-3004 protocol, MI-4001 to MI-4003 permission, MI-5001 to MI-5003 licence and edition, MI-6001 and MI-6002 internal.
MI-4001 is also returned when an API key or agent credential is missing, wrong, expired or revoked, or its owner is disabled.
Details you may see
- For approval policy refusals,
details.reasonisapprovals,window,clock,role,approved,emergencyorunavailable. See Approvals and safe write. - For fleet joins,
details.reasoncan bereplay,identity_conflict,identity_revoked,identity_unknown,schema_unsupported,payload_rejected,wrong_fleet,wrong_mode,token_invalid,already_enrolledornot_licensed.
MCP error codes
AI assistants on the MCP endpoint get their own codes, in the error text and in _meta["com.makeitintelligent/error"].
| Code | Meaning | What to do |
|---|---|---|
MI-MCP-400 | An argument is missing, unknown or has the wrong type. | Correct it and call again. |
MI-MCP-403 | The credential may not use the tool or see the object. | Do not repeat; ask for access. |
MI-MCP-404 | Unknown id or name, or out of scope. | Look it up with mii_find. |
MI-MCP-409 | The object is not in a state that allows this. | Read its state, then decide again. |
MI-MCP-413 | The result is too large. | Narrow the query or time range. |
MI-MCP-429 | Too many calls. | Wait for Retry-After. |
MI-MCP-500 | The call failed. | Try once more, then tell the person. |
MI-MCP-502 | Console, historian or Site Runtime error. | Try once more, then tell the person. |
MI-MCP-503 | A part is unavailable, or MCP is switched off. | Do not retry in a loop. |
MI-MCP-504 | The plant did not answer in time. | Try a smaller range once. |
Write reject reasons
A tag write that the runtime refuses reports one of these reasons (see Approvals and safe write): out_of_limits, step_too_large, read_bad, read_stale, expected_required, changed_since_approval, request_expired, pulse_active, held, request_id_reused, journal_unavailable, policy_required, scaled_tag, unsupported_type, bad_value.
Troubleshooting by symptom
| Symptom | Likely code | First step |
|---|---|---|
| Console does not start, mentions the master key | MI-1011 | Set MI_MASTER_KEY. |
| Console does not start, mentions an old variable | MI-1020 | Rename it to the MI_ name. |
| Console does not start, TLS error | MI-1010 | Check certificate and key paths. |
| Cannot sign in, "too many attempts" | MI-4003 | Wait. |
| Device offline | MI-2001, MI-2002 | Check network and address. |
| Tag shows an error | MI-3003, MI-3004 | Check the address and type. |
| Cannot save LDAP or approval policies | MI-5003 | Enterprise licence needed. |
| "Licence limit" when adding tags | MI-5001 | Check usage under Settings → License. |