Skip to main content
Version: 2.12

System Errors

This page documents all non-JetStream errors that the NATS server can return to clients, routes, gateways, and leafnode connections.

Authentication and Authorization Errors

ErrorConstantDescription
Authentication expiredErrAuthExpiredAn expired authorization due to timeout.
Proxy is not trustedErrAuthProxyNotTrustedAn error condition on failed authentication due to a connection from a proxy not in the list of trusted proxies.
Proxy connection requiredErrAuthProxyRequiredAn error condition on failed authentication due to a connection not coming from a proxy.
Authentication timeoutErrAuthTimeoutAn error condition on failed authorization due to timeout.
Authentication errorErrAuthenticationAn error condition on failed authentication.
Credentials have been revokedErrRevocationReturned when a credential has been revoked.
Service import not authorizedErrServiceImportAuthorizationReturned when a service import is not authorized.
Stream import not authorizedErrStreamImportAuthorizationReturned when a stream import is not authorized.
Authorization ViolationAuthorization ViolationClient attempted an operation that violates configured permissions
User Authentication ExpiredUser Authentication ExpiredUser JWT or credentials have expired
Account Authentication ExpiredAccount Authentication ExpiredAccount authentication has expired
User Authentication RevokedUser Authentication RevokedUser credentials have been revoked
Permissions Violation for PublishPermissions Violation for PublishClient attempted to publish to a subject without permission
Permissions Violation for SubscriptionPermissions Violation for SubscriptionClient attempted to subscribe to a subject without permission

Connection Limit Errors

ErrorConstantDescription
Maximum account active connections exceededErrTooManyAccountConnectionsThat an account has reached its maximum number of active connections.
Maximum connections exceededErrTooManyConnectionsA client that the maximum number of connections supported by the server has been reached.
Maximum subscriptions exceededErrTooManySubsA client that the maximum number of subscriptions per connection has been reached.
Connection Throttling Is ActiveConnection Throttling Is ActiveServer is actively throttling new connections
Maximum Clients ExceededMaximum Clients ExceededServer has reached its maximum number of allowed clients

Protocol and Payload Errors

ErrorConstantDescription
Invalid client protocolErrBadClientProtocolA client requested an invalid client protocol.
Bad message header detectedErrBadMsgHeaderThe parser detected a bad message header
Maximum control line exceededErrMaxControlLineAn error condition when the control line is too big.
Maximum payload exceededErrMaxPayloadAn error condition when the payload is too big.
Message headers not supportedErrMsgHeadersNotSupportedThe parser detected a message header but they are not supported on this server.
No responders requires headers supportErrNoRespondersRequiresHeadersThat a client needs to have headers on if they want no responders behavior.
Maximum Payload ViolationMaximum Payload ViolationPublished message exceeds the configured maximum payload size
Protocol ViolationProtocol ViolationClient violated the NATS protocol
Parser ErrorParser ErrorServer encountered an error parsing client protocol

Subject and Publishing Errors

ErrorConstantDescription
Invalid publish subjectErrBadPublishSubjectAn error condition for an invalid publish subject.
Bad qualifierErrBadQualifierUsed to error on a bad qualifier for a transform.
Invalid subjectErrBadSubjectAn error condition for an invalid subject.
Invalid mapping destinationErrInvalidMappingDestinationUsed for all subject mapping destination errors
Invalid transformErrInvalidMappingDestinationSubjectUsed to error on a bad transform destination mapping
Malformed subjectErrMalformedSubjectReturned when a subscription is made with a subject that does not conform to subject rules.
Wildcard index out of rangeErrMappingDestinationIndexOutOfRangeReturned when the mapping destination function is passed an out of range wildcard index value for one of it's arguments
Function argument is invalid or in the wrong formatErrMappingDestinationInvalidArgReturned when the mapping destination function is passed and invalid argument
Not enough arguments passed to the functionErrMappingDestinationNotEnoughArgsReturned when the mapping destination function is not passed enough arguments
The only mapping function allowed for import transforms is {{Wildcard()}}ErrMappingDestinationNotSupportedForImportReturned when you try to use a mapping function other than wildcard in a transform that needs to be reversible (i.e. an import)
Not using all of the token wildcard(s)ErrMappingDestinationNotUsingAllWildcardsUsed to error on a transform destination not using all of the token wildcards
Too many arguments passed to the functionErrMappingDestinationTooManyArgsReturned when the mapping destination function is passed too many arguments
No matching transforms availableErrNoTransformsNo subject transforms are available to map this subject.
Reserved accountErrReservedAccountA reserved account that can not be created.
Reserved internal subjectErrReservedPublishSubjectAn error condition when sending to a reserved subject, e.g. _SYS.>
Subject has exceeded number of tokens limitErrTooManySubTokensA client that the subject has too many tokens.
Unknown functionErrUnknownMappingDestinationFunctionReturned when a subject mapping destination contains an unknown mustache-escaped mapping function.
Invalid SubscriptionInvalid SubscriptionSubscription request is invalid

TLS and Security Errors

ErrorConstantDescription
Certificate not pinnedErrCertNotPinnedReturned when pinned certs are set and the certificate is not in it
Secure Connection - TLS RequiredSecure Connection - TLS RequiredServer requires TLS but client attempted non-TLS connection
TLS Handshake ErrorTLS Handshake ErrorTLS handshake with client failed

Account Errors

ErrorConstantDescription
Account existsErrAccountExistsReturned when an account is attempted to be registered but already exists.
Account expiredErrAccountExpiredReturned when an account has expired.
Account resolver no new claimsErrAccountResolverSameClaimsReturned when same claims have been fetched.
Account resolver update too soonErrAccountResolverUpdateTooSoonReturned when we attempt an update too soon to last request.
Account validation failedErrAccountValidationReturned when an account has failed validation.
Bad accountErrBadAccountA malformed or incorrect account.
Bad sampling percentage, should be 1-100ErrBadSamplingReturned when the sampling for latency tracking is not 1 >= sample <= 100.
Bad service response typeErrBadServiceTypeReturned when latency tracking is being applied to non-singleton response types.
Import forms a cycleErrImportFormsCycleReturned when an import would form a cycle.
Account missingErrMissingAccountReturned when an account does not exist.
Service missingErrMissingServiceReturned when an account does not have an exported service.
Account resolver missingErrNoAccountResolverReturned when we attempt an update but do not have an account resolver.
System account not setupErrNoSysAccountReturned when an attempt to publish or subscribe is made when there is no internal system account defined.
Stream import prefix can not contain wildcard tokensErrStreamImportBadPrefixReturned when a stream import prefix contains wildcards.
Stream import already existsErrStreamImportDuplicateReturned when a stream import is a duplicate of one that already exists.
Failed Account RegistrationFailed Account RegistrationFailed to register client with account

Server Name and Cluster Errors

ErrorConstantDescription
Cluster name conflicts between cluster and gateway definitionsErrClusterNameConfigConflictThat the options for cluster name in cluster and gateway are in conflict.
Cluster name cannot contain spacesErrClusterNameHasSpacesThat the cluster name contains spaces, which is not allowed.
Cluster name from remote server conflictsErrClusterNameRemoteConflictThat a remote server has a different cluster name.
Duplicate server nameErrDuplicateServerNameReturned when processing a server remote connection and the server reports that this server name is already used in the cluster.
Gateway name cannot contain spacesErrGatewayNameHasSpacesThat the gateway name contains spaces, which is not allowed.
Remote leafnode has same cluster nameErrLeafNodeHasSameClusterNameAn error condition when a leafnode is a cluster and it has the same cluster name as the hub cluster.
Server name cannot contain spacesErrServerNameHasSpacesThat the server name contains spaces, which is not allowed.

Wrong Port Connection Errors

ErrorConstantDescription
Attempted to connect to leaf node portErrClientConnectedToLeafNodePortAn error condition when a client attempted to connect to the leaf node listen port.
Attempted to connect to route portErrClientConnectedToRoutePortAn error condition when a client attempted to connect to the route listen port.
Attempted to connect to gateway portErrClientOrRouteConnectedToGatewayPortAn error condition when a client or route attempted to connect to the Gateway port.
Attempted to connect to wrong portErrConnectedToWrongPortAn error condition when a connection is attempted to the wrong listen port (for instance a LeafNode to a client port, etc...)

Gateway-Specific Errors

ErrorConstantDescription
Wrong gatewayErrWrongGatewayAn error condition when a server receives a connect request from a remote Gateway with a destination name that does not match the server's Gateway's name.
Connection to Gateway RejectedConnection to Gateway RejectedGateway rejected the connection

Leafnode-Specific Errors

ErrorConstantDescription
Leafnodes disabledErrLeafNodeDisabledWhen we disable leafnodes.
Leafnode loop detectedErrLeafNodeLoopA leafnode is trying to register for a cluster we already have registered.

Connection State Errors

ErrorConstantDescription
Connection closedErrConnectionClosedAn error condition on a closed connection.
Server is not runningErrServerNotRunningUsed to signal an error that a server is not running.
Stale ConnectionStale ConnectionConnection is stale and will be closed

Other Errors

ErrorConstantDescription
Search cycle depth exhaustedErrCycleSearchDepthReturned when we have exceeded our maximum search depth..
Minimum version requiredErrMinimumVersionRequiredReturned when a connection is not at the minimum version required.
Subscribe permission violationErrSubscribePermissionViolationReturned when processing of a subscription fails due to permissions.

Route-Specific Errors

ErrorConstantDescription
Route Authorization ViolationRoute Authorization ViolationRoute connection failed authorization
Duplicate RouteDuplicate RouteRoute connection already exists to this server

Slow Consumer and Flow Control

ErrorConstantDescription
Slow Consumer DetectedSlow Consumer DetectedServer detected a slow consumer that is not keeping up with message delivery
Consumer Is SlowConsumer Is SlowConsumer is processing messages too slowly
Write Deadline ExceededWrite Deadline ExceededWrite operation to client exceeded the configured deadline

Connection Close Reasons

These are the reasons a client connection may be closed by the server. They appear in monitoring data and disconnect events.

ErrorConstantDescription
Client ClosedClientClosedClient Closed
Authentication TimeoutAuthenticationTimeoutAuthentication Timeout
Authentication FailureAuthenticationViolationAuthentication Failure
TLS Handshake FailureTLSHandshakeErrorTLS Handshake Failure
Slow Consumer (Pending Bytes)SlowConsumerPendingBytesSlow Consumer (Pending Bytes)
Slow Consumer (Write Deadline)SlowConsumerWriteDeadlineSlow Consumer (Write Deadline)
Write ErrorWriteErrorWrite Error
Read ErrorReadErrorRead Error
Parse ErrorParseErrorParse Error
Stale ConnectionStaleConnectionStale Connection
Protocol ViolationProtocolViolationProtocol Violation
Bad Client Protocol VersionBadClientProtocolVersionBad Client Protocol Version
Incorrect PortWrongPortIncorrect Port
Maximum Account Connections ExceededMaxAccountConnectionsExceededMaximum Account Connections Exceeded
Maximum Connections ExceededMaxConnectionsExceededMaximum Connections Exceeded
Maximum Message Payload ExceededMaxPayloadExceededMaximum Message Payload Exceeded
Maximum Control Line ExceededMaxControlLineExceededMaximum Control Line Exceeded
Maximum Subscriptions ExceededMaxSubscriptionsExceededMaximum Subscriptions Exceeded
Duplicate RouteDuplicateRouteDuplicate Route
Route RemovedRouteRemovedRoute Removed
Server ShutdownServerShutdownServer Shutdown
Authentication ExpiredAuthenticationExpiredAuthentication Expired
Wrong GatewayWrongGatewayWrong Gateway
Missing AccountMissingAccountMissing Account
Credentials RevokedRevocationCredentials Revoked
Internal ClientInternalClientInternal Client
Message Header ViolationMsgHeaderViolationMessage Header Violation
No Responders Requires HeadersNoRespondersRequiresHeadersNo Responders Requires Headers
Cluster Name ConflictClusterNameConflictCluster Name Conflict
Duplicate Remote LeafNode ConnectionDuplicateRemoteLeafnodeConnectionDuplicate Remote LeafNode Connection
Duplicate Client IDDuplicateClientIDDuplicate Client ID
Duplicate Server NameDuplicateServerNameDuplicate Server Name
Minimum Version RequiredMinimumVersionRequiredMinimum Version Required
Cluster Names IdenticalClusterNamesIdenticalCluster Names Identical
KickedKickedKicked
Proxy Not TrustedProxyNotTrustedProxy Not Trusted
Proxy RequiredProxyRequiredProxy Required