ka2a documentation

Error reference

Developer preview. Not yet production ready. This page is rendered from docs/error-reference.md of the ka2a repository at revision 96fb45e5e5f6693e779837998c3aa9581d6a37f2. It describes the behavior of that revision.

Contents

This reference lists every error code, failure class, hint and reason token that ka2a reports. Each token is stable: a later revision does not change its meaning. A later revision can add tokens, so treat an unknown token as a failure that needs attention.

A test (TestErrorReferenceListsEveryCodeAndReason, internal/cli) keeps this reference complete: it reads the constants and the reason literals from the source and fails when a token is missing from its section.

"Retry" tells what a caller does with the same request:

  • yes: try the same call again later, with a backoff.
  • same key: submit again with the same operation key (SubmitOptions.OperationID). The node returns the original operation and sends no new request. This is always safe.
  • no: the same call fails again. Change the input, the configuration or the state first.

Library error codes

ka2a.CodeOf(err) returns one of these codes. errors.Is(err, ka2a.ErrHeld) and the other sentinel errors match them too. The command line prints the same code in its message and in the code member of ka2a.error/1.

CodeMeaningRetryAction
invalid_argumentThe profile refuses an argument, for example an operation ID that is not a lowercase UUIDv4.noFix the call.
invalid_configA configuration, catalog, key file or mailbox topic cannot be used.noFix the configuration. Run ka2a doctor and ka2a catalog validate.
unsupported_operationThe operation is outside the declared profile.noUse an operation of the profile.
unsupported_featureAn optional A2A feature is outside the profile, for example push notifications.noRemove the feature from the request.
identity_conflictThe operation ID names another logical request.noUse a new operation ID for a new request. See identity_conflict.
unauthorizedThe trusted catalog has no grant for this source, target and operation.noAdd the grant to the catalog and restart the nodes.
unknown_peerThe trusted catalog does not list the peer.noAdd the peer to the catalog and restart the node.
storage_pressureNew work would exceed the retained-state budget. Nothing is stored.yesResolve held work, let retention run or raise Limits.RetainedBytes. See Storage pressure.
storage_unavailableAn I/O, lock or capacity failure of the local store. Nothing is admitted.yesRetry with a backoff. If it stays, check the disk and the file system of the state directory.
store_busyAnother process owns the state directory.yes, after the owner stopsStop the other owner, or use the running node. The command line exits with 5.
state_invalidThe state directory cannot be used safely: unsafe permissions, another endpoint, a foreign schema, or lost or damaged state.noFix the permissions or the path. Restore from a backup when the state is lost.
quarantinedThe store waits for operator reconciliation after a restore. No handler starts.noReconcile and run ka2a quarantine release. See Quarantine after a restore.
not_readyThe call came before the node finished its start.yesWait for Node.Ready or the ready event.
closedThe call came after Close.noOpen a new node.
already_runningA second Run call on one node.noCall Run once per node.
unknown_outcomeA wait or a call ended before its outcome was known. This is an observation, not a remote failure: the admitted work continues.same keyWait again, or read the operation with Client.Lookup. Do not send a new request with a new key. See Unknown outcomes and exit code 6.
heldThe node holds the exchange because its outcome is unknown and needs attention.noAn operator decides with ka2a held release or ka2a held abandon. See Held work.
abandonedAn operator abandoned the exchange. Its outcome stays unknown.noCheck the remote effect out of band before a new request.
expiredA record expired, or retention purged the identity. An expired identity is never refreshed.noSend a new request with a new operation ID.
not_foundThe operation or task is unknown.noCheck the ID. Retention can have purged it.
publish_rejectedThe broker refused the request permanently, for example a missing Write ACL or a record that is too large. The exchange is held.noFix the cause (see Publish reasons), then decide on the held exchange.
invalid_transitionThe state change is not permitted, for example a change of a terminal task.noRead the current state first.
internalA defect or an unclassified failure.yes, onceReport it with the log line. The detail never holds a body or a key.

Command-line error codes

The command line prints a library code when the failure has one. Otherwise it prints one of these codes, or a code of the store, snapshot and catalog.

CodeMeaningExit
usageUnknown command, flag or argument.2
problemsThe checks of the command found problems. The report names them.3
not_availableThe command is not available in this build.4
store_busyA running node owns the state directory.5
canceledThe command was interrupted or its deadline passed.1
failedAn unclassified failure. The message explains it.1

Request outcomes

ka2a send, task get, tasks list and task cancel print an outcome and exit with its code. The request stays admitted after exit code 6.

OutcomeMeaningExit
resultThe peer answered with a result.0
errorThe peer answered with an A2A error.1
pendingNo response arrived within --wait. The request can still complete.6
heldThe exchange is held: its outcome is unknown and needs an operator.6
expiredThe request expired before a response.1
publish_rejectedThe broker refused the request permanently.1
abandonedAn operator abandoned the exchange.1

Exit codes

CodeMeaning
0Success.
1The command failed. The message names the error code.
2Usage error: unknown command, flag or argument.
3The checks found problems.
4The command is not available in this build.
5A running node owns the state directory.
6A request is admitted, but its outcome is not known yet. It is not a failure.

Store, snapshot and catalog error codes

The command line can print these codes of the local store, of pkg/observe (snapshots) and of the catalog and key checks. pkg/ka2a maps them to a library code.

CodeMeaningAction
invalid_inputA malformed or out-of-bounds argument.Fix the argument.
store_busyAnother owner holds the state directory.Stop the other owner.
unsafe_storageUnsafe permissions, links or file system type of the state directory.Give the directory to the service user with mode 0700, without links.
pragma_mismatchA SQLite connection setting did not take effect.Report it. The file system can be unsupported.
schema_too_newThe store comes from a newer ka2a binary.Use the newer binary. See the upgrade notes.
schema_too_oldOnly the owner can migrate this store.Start the owner (ka2a run) once with the new binary.
schema_mismatchThe database is not a ka2a store.Check the path.
identity_mismatchThe store belongs to another endpoint.Check --state-dir, --domain and --endpoint.
state_missingThe endpoint state is lost or incomplete, or the directory has no store.Run ka2a init, or restore from a backup.
quarantinedThe store waits for operator reconciliation.See Quarantine after a restore.
recovery_pendingDispatch before the restart recovery ran.Internal ordering. Report it.
identity_conflictAn identity is reused with other content.See identity_conflict.
correlation_mismatchA response for another peer or parent.The response is rejected. Check the peer.
response_conflictA second, different final response.The first response stays. Check the peer.
expiredAn expired record or a purged identity.Use a new operation.
storage_pressureNew admission would exceed the budget.See Storage pressure.
storage_fullSQLite or the file system is full.Free disk space. The node retries.
storage_unavailableAn I/O, lock or other storage failure.Retry. Check the disk.
not_foundAn absent row, operation or task.Check the ID.
invalid_transitionA state change that is not permitted.Read the current state.
read_onlyA write through a read-only store.Use a command that owns the store.
closedUse after Close.Open the store again.
corruptDamaged or inconsistent stored data.Restore from a backup.
invalid_snapshotA snapshot file that is not valid ka2a.snapshot/1 JSON.Read the file with the ka2a revision that wrote it, or a newer one. See the output formats.
invalid_catalogThe catalog file is malformed or unsafe.Run ka2a catalog validate. See Catalog check fails.
invalid_key_fileThe signing key file is malformed.Generate the key again with ka2a keys generate.
unsafe_fileA file with an unsafe type, owner or permissions.Make the file a regular file of the service user, not group or other writable.
unknown_keyThe catalog does not list the key ID.Add the key to the catalog.
revoked_keyThe key is revoked.Use another key.
key_not_validThe key is outside its validity window.Use a key with a current window. See Signing key expires soon.
key_mismatchThe private key does not match the catalog.Check --key and the catalog entry.
source_mismatchThe claimed source differs from the source bound to the key.Check the catalog entry of the key.
unknown_endpointThe catalog does not list the endpoint.Add the endpoint to the catalog.
unsupported_operationAn operation outside the profile.Use an operation of the profile.
not_authorizedThe catalog denies the request.Add the grant.

Broker contact failure classes

The node status (Status.Broker.FailureClass), the log, ka2a doctor and the result of a credential reload name the class of the last failed broker contact. A class never holds an address. See Refused broker connection.

ClassMeaningAction
connection_refusedThe broker host refused the TCP connection.Check that the broker runs and listens on the port of --brokers.
timeoutThe contact attempt timed out.Check the network path and the broker load.
address_unresolvedDNS cannot resolve the broker name.Check the name in --brokers and the resolver.
network_unreachableNo route to the broker network.Check the routing and the firewall.
tls_failedTLS refused the connection. The hint names the cause.See Connection hints.
authentication_failedSASL authentication failed.Check the user name, the password file and the mechanism. See Rotated SASL password.
disconnectedThe broker closed the connection.Usually transient. If it stays, check the listener security.
request_failedAnother request failure.Read the log line.
authorization_failedThe broker answered and denied the request: the principal lacks an ACL. It is not a contact failure; the scope names the ACL.Add the ACL of the scope. See Missing broker ACL.

Authorization scopes

ScopeMissing ACL
topic_writeWrite on a peer mailbox topic (produce).
topic_readRead on the own mailbox topic (fetch, offsets).
topic_describeDescribe or DescribeConfigs on a topic (metadata, the mailbox check).
group_readRead on the consumer group (join, commit).
clusterA cluster or transactional ID permission, for example IdempotentWrite on a broker before Kafka 3.0.

ka2a topics acl-plan prints the minimal ACLs of an endpoint.

Connection hints

A refused TLS or SASL connection has one of these fixed hints (Status.Broker.FailureHint, the doctor detail and the reload result). A hint never holds a credential, a certificate field or broker text.

HintAction
"the broker certificate does not chain to a trusted CA"Give the CA of the broker in --tls-ca.
"the broker certificate is not valid for the server name"Set --tls-server-name, or use a broker name of the certificate.
"the broker certificate is not valid (for example expired or not yet valid)"Renew the broker certificate. Check the clock of the host.
"the broker listener needs TLS, and the client connected without TLS"Give --tls-ca (TLS on).
"the broker listener does not speak TLS"Use the TLS listener port, or remove the TLS flags.
"the TLS handshake failed (for example no common TLS version or cipher, or a missing or refused client certificate)"Check the TLS versions, the ciphers and the client certificate.
"SASL authentication failed (user name, password or mechanism)"Check --sasl-username, --sasl-password-file and --sasl-mechanism.
"the broker does not enable this SASL mechanism"Use a mechanism that the listener enables.
"the broker closed the connection at once (SASL is missing, or TLS is used against a listener without TLS)"Match the client security to the listener.
"the broker refused the client certificate (untrusted CA, expired, revoked or not valid for client authentication)"See Refused or expiring client certificate.
"the broker listener needs a client certificate (mutual TLS), and the client sent none that a CA trusted by the broker issued"Give --tls-cert and --tls-key.
"a certificate of the broker chain is revoked by the revocation list of the client (--tls-crl)"Replace the broker certificate. See Revocation list due.

Publish reasons

The publisher classifies each publish attempt. A record that the broker refused for sure gets the outbox state error with the reason publish_<reason>, for example publish_record_too_large, and its exchange becomes held. A retried attempt keeps the record queued.

ReasonOutcomeMeaning
record_too_largerefusedThe record exceeds max.message.bytes of the topic or the broker.
invalid_recordrefusedThe broker refused the record or the batch as invalid, or a topic policy refused it.
invalid_partitionrefusedThe partition does not exist.
topic_not_foundrefusedThe topic does not exist. Provision the peer mailbox.
unauthorizedrefusedThe principal lacks Write on the topic (scope topic_write) or a cluster permission.
authentication_failedunknown, retriedSASL refused the connection. A credential reload fixes it.
cancelednot sent or unknown, retriedA stop or a deadline ended the attempt.
closedunknown, retriedThe client was closed during the attempt.
buffer_fullnot sent, retriedThe client buffer was full.
timeoutunknown, retriedThe broker did not answer in time.
not_enough_replicasunknown, retriedFewer in-sync replicas than min.insync.replicas.
disconnectedunknown, retriedThe connection broke during the attempt.
broker_errorunknown, retriedAnother broker error.
not_sentretriedOutbox reason: the record was not sent. The publisher tries again.
publish_outcome_unknownretriedOutbox reason: the outcome is unknown. The publisher sends the same bytes again.
publish_rejectedrefusedOutbox reason: the broker refused the record without a specific reason.

Rejection reasons

The node records a bounded rejection disposition for each received record that it does not accept (ka2a_input_rejected_total, ka2a_responses_rejected_total, the rejections list of ka2a observe). A rejected record never reaches a handler. The disposition holds only syntactically valid claims of the headers; they are not authenticated.

ReasonDirectionMeaningAction
malformedrequest, responseFraming, header, JSON or canonical form that does not agree with KA2A-WIRE-1.Check the sender version.
too_largerequest, responseA value, a header, the depth or the node count exceeds a bound.Check the sender.
signature_invalidrequest, responseThe signature is missing, malformed or incorrect.Check the sender key and the catalog. A forged record has this reason.
unknown_keyrequest, responseThe catalog does not know the signing key.Add the key of the sender to the catalog and restart.
revoked_keyrequest, responseThe signing key is revoked.The sender must use another key.
key_not_validrequest, responseThe signing key is outside its validity window.Check the key window and the clocks.
unauthorizedrequest, responseThe key is not bound to the claimed source, or the catalog has no grant.Fix the catalog grant.
route_mismatchrequest, responseThe record names another destination or came on another topic.Check the routing of the sender.
expiredrequest, responseThe record is at or after its signed expiry.Check the clocks and the delivery delay.
future_timerequest, responseThe creation time is later than the local clock plus the allowed skew.Synchronize the clocks (NTP).
horizon_exceededrequest, responseThe expiry is farther from creation than the horizon of the record kind.Check the sender.
unknown_schemarequest, responseThe schema digest is not in the embedded catalog.Check the sender version.
schema_invalidrequest, responseThe document does not agree with its schema.Check the sender.
semantic_invalidrequest, responseThe document breaks a semantic rule of A2A 1.0 or of the profile.Check the sender.
unsupported_operationrequest, responseThe operation is outside the profile.Check the sender.
unsupported_featurerequest, responseAn optional feature is outside the profile.Check the sender.
session_mismatchrequest, responseThe session header does not mirror the A2A contextId.Check the sender.
identity_conflictrequestThe operation identity is reused for another request.See identity_conflict.
replay_after_purgerequestA request whose identity retention purged arrived again.None. The node does not run it again.
late_responseresponseA response for an operation that retention purged.None.
orphan_responseresponseA verified response for an operation that the store does not know. The log warns that local sender state can be lost.Check for a restore of an old backup.
correlation_mismatchresponseThe response comes from another peer or names another parent.Check the peer.
response_conflictresponseA second, different final response. The first response stays.Check the peer.

Hold reasons

A held dispatch row or a held exchange has a reason. See Held work.

ReasonWhereMeaning
ambiguous_after_restartdispatchThe handler had started before a crash or a stop, so its effect is unknown.
restart_retrydispatchAn idempotent_with_key handler is queued again after a restart with the same key.
store_quarantineddispatchA restore quarantine held the row.
handler_errordispatchThe handler returned an error whose effect is unknown.
handler_panicdispatchThe handler panicked.
handler_timeoutdispatchThe handler did not return before its deadline.
invalid_resultdispatchThe handler returned a result that the profile refuses.
task_conflictdispatchThe result conflicts with the stored task.
response_build_faileddispatchThe node could not build the response record.
send_failedexchangeThe broker refused the request record. An earlier attempt can have reached the receiver.
send_expiredexchangeThe request record expired before a publication.
operator_abandonedoutboxAn operator abandoned the exchange of the record.

ka2a held release and ka2a held abandon record the reason token that the operator gives.

Quarantine reasons

A restore quarantine has one of these reasons. Each one is a recovery incident. See Quarantine after a restore.

ReasonMeaning
restore_markerThe state directory has a recovery marker.
restored_backupThe database is a backup copy.
epoch_witness_missingThe database exists, but the epoch witness does not.
epoch_witness_node_mismatchThe witness names another node.
generation_mismatchThe witness names another store generation.
epoch_behindThe database epoch is behind the witness.
epoch_witness_behindThe witness is more than one epoch behind.
broker_aheadThe broker committed input that the store never accounted for.

Protocol codes

pkg/protocol classifies a failure of the wire codec with these codes. The receiver maps them to the rejection reasons.

CodeMeaning
malformedFraming, header syntax, JSON syntax, JSON encoding or canonical form that does not agree with KA2A-WIRE-1.
too_largeA value, header, depth or node bound that the input exceeds.
unknown_headerA header key that is not in the profile table.
duplicate_headerA header key that occurs more than once.
bad_signatureA missing, malformed or incorrect signature.
unknown_keyA signing key that the trusted catalog does not know or no longer accepts.
unauthorized_sourceA verified key that is not bound to the asserted source endpoint.
unauthorizedA verified principal that may not send this record kind and operation to the destination.
wrong_destinationA record that names another destination or arrived on another topic.
expiredA record at or after its signed expiry.
future_timeA creation time later than the verifier clock plus the allowed skew.
horizon_exceededAn expiry farther from creation than the horizon of the record kind.
schema_unknownA schema digest that is not in the embedded catalog.
schema_invalidA document that does not agree with its structural schema or the pinned A2A types.
semantic_invalidA structurally valid document that breaks a semantic rule.
unsupported_operationAn operation that is not in the declared profile.
unsupported_featureAn optional A2A feature that the profile does not support.
session_mismatchA session header that does not mirror the A2A contextId.
parent_mismatchA response parent that is not the expected request event ID.
peer_mismatchA response from another verified endpoint than the expected peer.
operation_mismatchA record that does not belong to the expected operation exchange.
identity_conflictOne operation identity with two different logical requests or frozen records.
invalid_argumentBuilder input that does not agree with the profile.
invalid_configA configuration that fails validation.
signing_failedA signer that failed or returned a signature that does not verify.

Topic check results

ka2a topics verify and ka2a topics provision print a result.

ResultMeaningExit
verifiedEvery check passed.0
unverifiedThe broker did not let the command read a setting. --strict makes it a problem.0
mismatchA setting differs from the profile.3
authorization_failedThe broker denied a request of the check.3
connection_failedTLS, SASL or the network refused the connection.3

All ka2a documents