pub enum ResponseError {
Show 108 variants Unknown(i16), UnknownServerError, OffsetOutOfRange, CorruptMessage, UnknownTopicOrPartition, InvalidFetchSize, LeaderNotAvailable, NotLeaderOrFollower, RequestTimedOut, BrokerNotAvailable, ReplicaNotAvailable, MessageTooLarge, StaleControllerEpoch, OffsetMetadataTooLarge, NetworkException, CoordinatorLoadInProgress, CoordinatorNotAvailable, NotCoordinator, InvalidTopicException, RecordListTooLarge, NotEnoughReplicas, NotEnoughReplicasAfterAppend, InvalidRequiredAcks, IllegalGeneration, InconsistentGroupProtocol, InvalidGroupId, UnknownMemberId, InvalidSessionTimeout, RebalanceInProgress, InvalidCommitOffsetSize, TopicAuthorizationFailed, GroupAuthorizationFailed, ClusterAuthorizationFailed, InvalidTimestamp, UnsupportedSaslMechanism, IllegalSaslState, UnsupportedVersion, TopicAlreadyExists, InvalidPartitions, InvalidReplicationFactor, InvalidReplicaAssignment, InvalidConfig, NotController, InvalidRequest, UnsupportedForMessageFormat, PolicyViolation, OutOfOrderSequenceNumber, DuplicateSequenceNumber, InvalidProducerEpoch, InvalidTxnState, InvalidProducerIdMapping, InvalidTransactionTimeout, ConcurrentTransactions, TransactionCoordinatorFenced, TransactionalIdAuthorizationFailed, SecurityDisabled, OperationNotAttempted, KafkaStorageError, LogDirNotFound, SaslAuthenticationFailed, UnknownProducerId, ReassignmentInProgress, DelegationTokenAuthDisabled, DelegationTokenNotFound, DelegationTokenOwnerMismatch, DelegationTokenRequestNotAllowed, DelegationTokenAuthorizationFailed, DelegationTokenExpired, InvalidPrincipalType, NonEmptyGroup, GroupIdNotFound, FetchSessionIdNotFound, InvalidFetchSessionEpoch, ListenerNotFound, TopicDeletionDisabled, FencedLeaderEpoch, UnknownLeaderEpoch, UnsupportedCompressionType, StaleBrokerEpoch, OffsetNotAvailable, MemberIdRequired, PreferredLeaderNotAvailable, GroupMaxSizeReached, FencedInstanceId, EligibleLeadersNotAvailable, ElectionNotNeeded, NoReassignmentInProgress, GroupSubscribedToTopic, InvalidRecord, UnstableOffsetCommit, ThrottlingQuotaExceeded, ProducerFenced, ResourceNotFound, DuplicateResource, UnacceptableCredential, InconsistentVoterSet, InvalidUpdateVersion, FeatureUpdateFailed, PrincipalDeserializationFailure, SnapshotNotFound, PositionOutOfRange, UnknownTopicId, DuplicateBrokerRegistration, BrokerIdNotRegistered, InconsistentTopicId, InconsistentClusterId, TransactionalIdNotFound, FetchSessionTopicIdError,
}
Expand description

Error kinds for Kafka error codes.

This enum type contains all the kafka client-server errors, those errors that must be sent from the server to the client. These are thus part of the protocol. The names can be changed but the error code cannot.

Note that client library will convert an unknown error code to the non-retriable variant if the client library version is old and does not recognize the newly-added error code. Therefore when a new server-side error is added, Kafka server may need extra logic to convert the new error code to another existing error code before sending the response back to the client if the request version suggests that the client may not recognize the new error code.

Read Kafka Protocol Guide and Errors.java for more details.

Variants§

§

Unknown(i16)

Client-side unknown error code.

§

UnknownServerError

The server experienced an unexpected error when processing the request.

§

OffsetOutOfRange

The requested offset is not within the range of offsets maintained by the server.

§

CorruptMessage

This message has failed its CRC checksum, exceeds the valid size, has a null key for a compacted topic, or is otherwise corrupt.

§

UnknownTopicOrPartition

This server does not host this topic-partition.

§

InvalidFetchSize

The requested fetch size is invalid.

§

LeaderNotAvailable

There is no leader for this topic-partition as we are in the middle of a leadership election.

§

NotLeaderOrFollower

For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition.

§

RequestTimedOut

The request timed out.

§

BrokerNotAvailable

The broker is not available.

§

ReplicaNotAvailable

The replica is not available for the requested topic-partition. Produce/Fetch requests and other requests intended only for the leader or follower return NOT_LEADER_OR_FOLLOWER if the broker is not a replica of the topic-partition.

§

MessageTooLarge

The request included a message larger than the max message size the server will accept.

§

StaleControllerEpoch

The controller moved to another broker.

§

OffsetMetadataTooLarge

The metadata field of the offset request was too large.

§

NetworkException

The server disconnected before a response was received.

§

CoordinatorLoadInProgress

The coordinator is loading and hence can’t process requests.

§

CoordinatorNotAvailable

The coordinator is not available.

§

NotCoordinator

This is not the correct coordinator.

§

InvalidTopicException

The request attempted to perform an operation on an invalid topic.

§

RecordListTooLarge

The request included message batch larger than the configured segment size on the server.

§

NotEnoughReplicas

Messages are rejected since there are fewer in-sync replicas than required.

§

NotEnoughReplicasAfterAppend

Messages are written to the log, but to fewer in-sync replicas than required.

§

InvalidRequiredAcks

Produce request specified an invalid value for required acks.

§

IllegalGeneration

Specified group generation id is not valid.

§

InconsistentGroupProtocol

The group member’s supported protocols are incompatible with those of existing members or first group member tried to join with empty protocol type or empty protocol list.

§

InvalidGroupId

The configured groupId is invalid.

§

UnknownMemberId

The coordinator is not aware of this member.

§

InvalidSessionTimeout

The session timeout is not within the range allowed by the broker (as configured by group.min.session.timeout.ms and group.max.session.timeout.ms).

§

RebalanceInProgress

The group is rebalancing, so a rejoin is needed.

§

InvalidCommitOffsetSize

The committing offset data size is not valid.

§

TopicAuthorizationFailed

Topic authorization failed.

§

GroupAuthorizationFailed

Group authorization failed.

§

ClusterAuthorizationFailed

Cluster authorization failed.

§

InvalidTimestamp

The timestamp of the message is out of acceptable range.

§

UnsupportedSaslMechanism

The broker does not support the requested SASL mechanism.

§

IllegalSaslState

Request is not valid given the current SASL state.

§

UnsupportedVersion

The version of API is not supported.

§

TopicAlreadyExists

Topic with this name already exists.

§

InvalidPartitions

Number of partitions is below 1.

§

InvalidReplicationFactor

Replication factor is below 1 or larger than the number of available brokers.

§

InvalidReplicaAssignment

Replica assignment is invalid.

§

InvalidConfig

Configuration is invalid.

§

NotController

This is not the correct controller for this cluster.

§

InvalidRequest

This most likely occurs because of a request being malformed by the client library or the message was sent to an incompatible broker. See the broker logs for more details.

§

UnsupportedForMessageFormat

The message format version on the broker does not support the request.

§

PolicyViolation

Request parameters do not satisfy the configured policy.

§

OutOfOrderSequenceNumber

The broker received an out of order sequence number.

§

DuplicateSequenceNumber

The broker received a duplicate sequence number.

§

InvalidProducerEpoch

Producer attempted to produce with an old epoch.

§

InvalidTxnState

The producer attempted a transactional operation in an invalid state.

§

InvalidProducerIdMapping

The producer attempted to use a producer id which is not currently assigned to its transactional id.

§

InvalidTransactionTimeout

The transaction timeout is larger than the maximum value allowed by the broker (as configured by transaction.max.timeout.ms).

§

ConcurrentTransactions

The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing.

§

TransactionCoordinatorFenced

Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer.

§

TransactionalIdAuthorizationFailed

Transactional Id authorization failed.

§

SecurityDisabled

Security features are disabled.

§

OperationNotAttempted

The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest.

§

KafkaStorageError

Disk error when trying to access log file on the disk.

§

LogDirNotFound

The user-specified log directory is not found in the broker config.

§

SaslAuthenticationFailed

SASL Authentication failed.

§

UnknownProducerId

This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer’s records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer’s metadata is removed from the broker, and future appends by the producer will return this exception.

§

ReassignmentInProgress

A partition reassignment is in progress.

§

DelegationTokenAuthDisabled

Delegation Token feature is not enabled.

§

DelegationTokenNotFound

Delegation Token is not found on server.

§

DelegationTokenOwnerMismatch

Specified Principal is not valid Owner/Renewer.

§

DelegationTokenRequestNotAllowed

Delegation Token requests are not allowed on PLAINTEXT/1-way SSL channels and on delegation token authenticated channels.

§

DelegationTokenAuthorizationFailed

Delegation Token authorization failed.

§

DelegationTokenExpired

Delegation Token is expired.

§

InvalidPrincipalType

Supplied principalType is not supported.

§

NonEmptyGroup

The group is not empty.

§

GroupIdNotFound

The group id does not exist.

§

FetchSessionIdNotFound

The fetch session ID was not found.

§

InvalidFetchSessionEpoch

The fetch session epoch is invalid.

§

ListenerNotFound

There is no listener on the leader broker that matches the listener on which metadata request was processed.

§

TopicDeletionDisabled

Topic deletion is disabled.

§

FencedLeaderEpoch

The leader epoch in the request is older than the epoch on the broker.

§

UnknownLeaderEpoch

The leader epoch in the request is newer than the epoch on the broker.

§

UnsupportedCompressionType

The requesting client does not support the compression type of given partition.

§

StaleBrokerEpoch

Broker epoch has changed.

§

OffsetNotAvailable

The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing.

§

MemberIdRequired

The group member needs to have a valid member id before actually entering a consumer group.

§

PreferredLeaderNotAvailable

The preferred leader was not available.

§

GroupMaxSizeReached

The consumer group has reached its max size.

§

FencedInstanceId

The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.

§

EligibleLeadersNotAvailable

Eligible topic partition leaders are not available.

§

ElectionNotNeeded

Leader election not needed for topic partition.

§

NoReassignmentInProgress

No partition reassignment is in progress.

§

GroupSubscribedToTopic

Deleting offsets of a topic is forbidden while the consumer group is actively subscribed to it.

§

InvalidRecord

This record has failed the validation on broker and hence will be rejected.

§

UnstableOffsetCommit

There are unstable offsets that need to be cleared.

§

ThrottlingQuotaExceeded

The throttling quota has been exceeded.

§

ProducerFenced

There is a newer producer with the same transactionalId which fences the current one.

§

ResourceNotFound

A request illegally referred to a resource that does not exist.

§

DuplicateResource

A request illegally referred to the same resource twice.

§

UnacceptableCredential

Requested credential would not meet criteria for acceptability.

§

InconsistentVoterSet

Indicates that the either the sender or recipient of a voter-only request is not one of the expected voters

§

InvalidUpdateVersion

The given update version was invalid.

§

FeatureUpdateFailed

Unable to update finalized features due to an unexpected server error.

§

PrincipalDeserializationFailure

Request principal deserialization failed during forwarding. This indicates an internal error on the broker cluster security setup.

§

SnapshotNotFound

Requested snapshot was not found

§

PositionOutOfRange

Requested position is not greater than or equal to zero, and less than the size of the snapshot.

§

UnknownTopicId

This server does not host this topic ID.

§

DuplicateBrokerRegistration

This broker ID is already in use.

§

BrokerIdNotRegistered

The given broker ID was not registered.

§

InconsistentTopicId

The log’s topic ID did not match the topic ID in the request

§

InconsistentClusterId

The clusterId in the request does not match that found on the server

§

TransactionalIdNotFound

The transactionalId could not be found

§

FetchSessionTopicIdError

The fetch session encountered inconsistent topic ID usage

Implementations§

source§

impl ResponseError

source

pub fn try_from_code(code: i16) -> Option<Self>

Try to convert an i16 Kafka error code to an ResponseError variant.

Returns None if the error code is 0. Otherwise, the Some(ResponseError) is returned.

source

pub fn code(&self) -> i16

Get the corresponding error code to the error

source

pub fn is_retriable(&self) -> bool

Check if is it a retriable error.

Whether an error is retriable or not is defined by the Kafka protocol.

Trait Implementations§

source§

impl Clone for ResponseError

source§

fn clone(&self) -> ResponseError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ResponseError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ResponseError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ResponseError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for ResponseError

source§

fn eq(&self, other: &ResponseError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ResponseError

source§

impl Eq for ResponseError

source§

impl StructuralPartialEq for ResponseError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.