Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error codes

error.code is the stable value to branch on. error.message is the fixed sentence shown here; do not match on it. Each command’s schema lists the subset it can emit (see the command pages and the matrix below).

Catalogue

CodeExitMessageMeaning and what to do
invalid_arguments2The command arguments are invalid.A missing, unknown or malformed option; an out-of-range value; a removed spelling; a write in JSON mode without --yes. Nothing was done. Fix the call. The offending value is never echoed.
output_not_supported2This command does not support JSON output.A human-only command was asked for JSON. Nothing ran.
configuration_missing1Required node configuration is missing.MOSTRO_PUBKEY or RELAYS (or their options) unset or empty.
configuration_invalid1The node configuration is invalid.Unparsable node key or relay URL, bad --pow or --transport.
relay_connection_failed1A configured relay could not be connected.Within 10 s. Check the network and relay list; safe to retry.
relay_read_failed1A configured relay failed during the public order read.A relay closed or dropped the subscription. For a read: retry. After publishing a write, this comes as uncertain. The message mentions “public order read” for every command.
read_timeout1The public order read did not complete before its deadline.Not every relay sent EOSE within 15 s. No partial data is returned. Retry, maybe with fewer or faster relays.
read_limit_exceeded1The public order read exceeded its event limit.More than 10 000 matching events. Narrow the read (--since).
internal_error1An internal error occurred.A bug or an output that could not be written. Report it.
identity_missing1No local identity exists.No data directory, mcli.db or user row. Create one (see Getting started) or point MCLI_DIR at the right place.
identity_unreadable1The local identity store cannot be read.The database exists but cannot be opened or holds no valid mnemonic.
protocol_unsupported1The node speaks a protocol version this program does not support.The node advertises protocol v1 (gift wrap). Nothing sent.
pow_required1The node requires more proof of work than is configured.Raise --pow / POW to the node’s value. Usually found before sending (error); when found only after a timeout, it is uncertain.
request_rejected1No relay confirmed accepting the request.publication: not_attempted ⇒ every relay refused the event, provably nothing sent (error). publication: unknown ⇒ a relay failed ambiguously; for a write this is uncertain.
reply_timeout1The node did not answer before the deadline.Published, no correlated reply within 15 s. For order info an error (repeatable); for writes uncertain.
node_refused1The node refused the request.The node answered cant-do. error.reason carries its reason when it is a snake_case word. The node did not act.
reply_malformed1The reply from the node could not be used.A correlated reply with an unexpected action or payload. For writes uncertain.
order_declined1The order was not confirmed, so nothing was sent.The user answered no at the human prompt. A JSON caller cannot get it (JSON requires --yes).
order_not_saved1The node created the order but it could not be saved locally.Always uncertain. The node accepted; data holds what it answered; the local row is missing. For order sync: some rows were saved, one failed.
store_unwritable1The local store cannot be written, so nothing was sent.The trade index cannot be reserved or the row cannot be updated. Fix permissions/disk; nothing happened on the network.
order_unknown1No local order has this id, so nothing was sent.The order is not in the local orders table (wrong id, another data directory, a range child not yet synced, a restored mnemonic without the database). Try order sync.
store_unreadable1The local store cannot be read.The orders table cannot be read.

Refusal reasons

With node_refused, error.reason is the node’s cant-do reason. It comes from the Mostro daemon, so the set can grow; treat unknown values generically. Reasons seen in the CLI’s tests and probes:

reasonTypical cause
too_many_requestsRate limited; wait and retry later
invalid_parametersThe request was not acceptable
invalid_amountAmount outside the node’s limits, or not in the range
invalid_order_statusThe order is not in a status that allows this step (already taken, canceled…)
invalid_peerYou are not a party of this order / not the right party for this step
invalid_pubkeyThe trade key does not match the order
invalid_invoiceThe invoice was rejected (amount, expiry, network)
order_already_canceledNothing to cancel
not_foundOnly order info: turned into a success with every id in not_returned

The protocol book has the daemon’s full list of cant-do reasons.

Which command emits which code

E = as error, U = as uncertain, E/U = either, depending on the stages.

Codelistinfonewtake-*add-invoicebondfiat-sent / release / cancelsyncmessage listschema
invalid_argumentsEEEEEEEEEE
configuration_missingEEEEEEEEE
configuration_invalidEEEEEEEEE
relay_connection_failedEEEEEEEEE
relay_read_failedEEE/UE/UE/UE/UE/UEE
read_timeoutEEE
read_limit_exceededEEE
internal_errorEEEEEEEEEE
identity_missingEEEEEEEE
identity_unreadableEEEEEEEE
protocol_unsupportedEEEEEE
pow_requiredEE/UE/UE/UE/UE/U
request_rejectedEE/UE/UE/UE/UE/U
reply_timeoutEUUUUU
node_refusedEEEEEE
reply_malformedEUUUUU
order_declinedEEEEE
order_not_savedUUU
store_unwritableEEEEE
order_unknownEEEE
store_unreadableEE

output_not_supported is emitted only for human-only commands.