7.1.5 Error handling

When a protocol level error occurs that cannot be recovered, the Server shall send an Error Message to the Client and closes the TransportConnection gracefully. When the Client receives an Error Message it reports the error to the application and closes the TransportConnection gracefully. If a Client encounters a fatal error, it shall report the error to the application and send a CloseSecureChannel Message. The Server shall close the TransportConnection gracefully when it receives the CloseSecureChannel Message.

The possible OPC UA Connection Protocol errors are defined in Table 79.

Table 79 – OPC UA Connection Protocol error codes
NameDescription
Bad_TcpServerTooBusy

The Server cannot process the request because it is too busy.

It is up to the Server to determine when to return this Message.

A Server can control the how frequently a Client reconnects by waiting to return this error.

Bad_TcpMessageTypeInvalid

The type of the Message specified in the header invalid.

Each Message starts with a 4-byte sequence of ASCII values that identifies the Message type.

The Server returns this error if the Message type is not accepted.

Some of the Message types are defined by the SecureChannel layer.

Bad_TcpSecureChannelUnknown

The SecureChannelId and/or TokenId are not currently in use.

This error is reported by the SecureChannel layer.

Bad_TcpMessageTooLarge

The size of the MessageChunk specified in the header is too large.

The Server returns this error if the MessageChunk size exceeds its maximum buffer size or the receive buffer size negotiated during the Hello/Acknowledge exchange.

Bad_Timeout

A timeout occurred while accessing a resource.

It is up to the Server to determine when a timeout occurs.

Bad_TcpNotEnoughResources

There are not enough resources to process the request.

The Server returns this error when it runs out of memory or encounters similar resource problems.

A Server can control the how frequently a Client reconnects by waiting to return this error.

Bad_TcpInternalError

An internal error occurred.

This should only be returned if an unexpected configuration or programming error occurs.

Bad_TcpEndpointUrlInvalidThe Server does not recognize the EndpointUrl specified.
Bad_SecurityChecksFailedThe Message was rejected because it could not be verified.
Bad_RequestInterruptedThe request could not be sent because of a network interruption.
Bad_RequestTimeoutTimeout occurred while processing the request.
Bad_SecureChannelClosedThe secure channel has been closed.
Bad_SecureChannelTokenUnknownThe SecurityToken has expired or is not recognized.
Bad_CertificateUntrustedThe sender Certificate is not trusted by the receiver.
Bad_CertificateTimeInvalidThe sender Certificate has expired or is not yet valid.
Bad_CertificateIssuerTimeInvalidThe issuer for the sender Certificate has expired or is not yet valid.
Bad_CertificateUseNotAllowedThe sender’s Certificate shall not be used for establishing a secure channel.
Bad_CertificateIssuerUseNotAllowedThe issuer Certificate shall not be used as a Certificate Authority.
Bad_CertificateRevocationUnknownCould not verify the revocation status of the sender’s Certificate.
Bad_CertificateIssuerRevocationUnknownCould not verify the revocation status of the issuer Certificate.
Bad_CertificateRevokedThe sender Certificate has been revoked by the issuer.
Bad_IssuerCertificateRevokedThe issuer Certificate has been revoked by its issuer.
Bad_SequenceNumberInvalidThe sequence number on the message was not valid.
Bad_ServiceUnsupportedThe Service Request contained in the body of the message is not supported. This error is only returned when the Request represents a security risk and it is necessary to immediately close the SecureChannel. For example, calling CreateSession on a SecureChannel that does not allow Sessions.

The numeric values for these error codes are defined in A.2.

NOTE: The ‘Tcp’ prefix for some of the error codes in Table 79 was chosen when TCP/IP was the only implementation of the OPC UA Connection Protocol. These codes are used with any implementation of the OPC UA Connection Protocol.