Errors

A call can fail because a definition is missing, a document is invalid, or the database refuses a change. The examples use the people data to show these results. Use the status and diagnostic fields to identify the failure.

Binding errors

LanguageFailure
CReturns a status. The owner that its operation names holds the diagnostic.
GoReturns *Error.
RustReturns Result<_, Error>.
ClojureThrows clojure.lang.ExceptionInfo with diagnostic data.
PythonRaises StardustError.
OdinReturns an Error beside its result.

Schema-constrained mutations return code schema_validation and message Schema validation failed.. Their violations list identifies each entity, schema and failed keyword. Each entry has entityPath and schemaPath arrays, such as [title] and [properties title minLength]. A token matching 0|[1-9][0-9]* within i64 is an integer, including when it names an object key. Other tokens are strings. The root is []; the empty-string key is [""]. Path arrays use decoded tokens, so / and ~ need no escaping. Constraint and actual values retain their data types. Missing required members report missingProperty instead of an actual value. Clojure uses kebab-case keys, such as :entity-path and :constraint-value.

The error record gives the fields in your language. Statuses gives the failure conditions of each operation.

error

This record describes a failure with its status and diagnostic. The binding copies the diagnostic before it releases the native owner.

FieldTypeUnitAbsentMeaning
violationsViolationsNone—The binding copies schema violations before the failed owner closes. Each entry contains entity and schema identities, entityPath and schemaPath arrays, and a keyword. Canonical decimal tokens within i64 are integers, including object keys. Other tokens are strings. An empty array selects the root. Entries include applicable constraintValue, actualValue, actualLength or missingProperty data. The error code remains schema_validation.
codeCopied-TextNone——
messageCopied-TextNone——
pathReported-TextNoneAn absent key—
fieldReported-TextNoneAn absent key—
entityReported-IntegerNoneAn absent key—
offsetReported-IntegerBytesAn absent key—
statusError-StatusNone——

Statuses

Each status names a class of failure. The table lists codes from the binding. Native diagnostic codes can differ.

:invalid-argument

Codes: time_out_of_range, invalid_argument, out_of_range, non_finite_number, cycle, unsupported_type, too_large, native_failure, live_children, wrong_kind, not_integral, inexact_number, missing_field, unknown_field, duplicate_field, too_deep, length_mismatch, malformed_tag, ambiguous_field, ambiguous_variant, invalid_value, hook_failed.

WhenOperations
the bundle, schemaPath or node is invalid or an input exceeds its limitvalidate-schema
the entity ID is outside the user entity range, max_depth is negative or above 32, or max_entities is negativeread-entity
the text is malformed, the format is unknown or a number is outside i64 or finite f64parse
the format is unknown or the width is negativeserialize
the text is malformed, a format is unknown or the width is negativeconvert
the value has a host type with no document form (one the language's standard JSON encoder also refuses), a number outside i64 or finite f64, a decimal or time with no exact native form, a failing conversion method, or a cyclefrom-value
the node breaks the preorder rules or has an invalid kind or numberadd
a node breaks the preorder rules or has an invalid kind or numberadd-many
the builder has no root or a container is still openseal
id is not a node of the documentread, pointer, children
start is past the last node or capacity is negativeread-many
id is not an object node of the documentmember, members
the path is not text or sequential, or a token is neither a string nor an integerpointer
the path is not sequential or a token is neither a string nor an integerpointer/format
the node is not an integer numberi64
the node is not a number or its value overflows f64f64
the arguments include an undeclared macro parameterbuild-macro, expand-macro
the file is not a database, an option is invalid, selected plugins are incompatible, or a plugin refuses its settings: the error carries the plugin's code (such as unknown_plugin_setting), the plugin's name as its path and the setting at fault as its field (nested settings as dotted member names, ambiguous when a name holds a dot)open
the parameters or run options are invalidrun
the parameters or subscription options are invalidsubscribe
max_wait is negativenext, indexes-sync
the parameters or run options are invalid, or a required parameter has no valuerun
the patch is not an entity-keyed object, or a link names an ID outside the user entity rangemerge-patch
the kind, action, revision or page limits are invalid, or the selected plan cannot run the current authored definitionplan
the kind or the pattern is invaliddefinitions
a bulk build is already in progress on the databasebulk-begin
no bulk build is in progressbulk-add, bulk-finish
a name is empty, the plugin has no call operation with the name, or the plugin refuses the requestplugin-call
a name is empty, the plugin has no stream operation with the name, or the plugin refuses the requestplugin-stream
the stream has finished or does not accept writeswrite
the stream does not support reads, or length is negativeread
the stream does not support seeks, whence is unknown, or the position is negative or past the i64 rangeseek
the stream has finished or has no finish stepfinish
the token is empty or longer than 4096 bytesactivate
entity is not a user entityobjects-get, objects-path
the parent or the name is invalid, or the parent is a fileobjects-lookup
the parent is invalid or is a fileobjects-children
the digest is not a native SHA-256 valueobjects-files, objects-manifest, objects-open
the array is empty or malformed, a name is invalid, or a parent is a fileobjects-create
the entity is a directory or invalid, the digest is malformed, or expected_revision is negativeobjects-update
the request is malformed, the destination is a file or inside the node, the kinds differ, or a replaced directory is not emptyobjects-move
the entity is invalid, the directory is not empty, or expected_revision is negativeobjects-remove
the request is not an object with only an integer ownerevents-close-owner
event is not an object with exactly subject and data, the subject is malformed (code invalid_subject), or data exceeds 1 MB (code too_large)events-publish
the request is malformed, or the pattern is empty or not a valid regular expression (code invalid_pattern)events-subscribe
options is not an object with owner and subscription (integers) and optionally a valid maxWait, or the subscription belongs to another owner (code wrong_owner)events-receive
the request is malformed, or the subscription belongs to another owner (code wrong_owner)events-unsubscribe
the request is malformed, the mode is unknown (code invalid_mode) or the pattern is empty or invalid (code invalid_pattern)events-register
the request is malformed, or the registration belongs to another owner (code wrong_owner)events-unregister
options is not an object with owner and registration (integers) and optionally a valid maxWait, or the registration belongs to another owner (code wrong_owner)events-accept
request is malformed, the mode or subject is invalid (codes invalid_mode and invalid_subject), data is missing for request or pull, present for push or duplex, or exceeds 1 MB, or data does not match the stored request schema (code invalid_payload)events-call
request is malformed, the side may not send now (code wrong_direction), the handle belongs to another owner (code wrong_owner), or data does not match its schema (code invalid_payload)events-send
the request is malformed, the side cannot finish in this mode (code wrong_direction), or the handle belongs to another owner (code wrong_owner)events-finish
the request is malformed, or the handle belongs to another owner (code wrong_owner)events-cancel
options is not an object with owner and handle (integers) and optionally a valid maxWait, or the handle belongs to another owner (code wrong_owner)events-read
the request is malformed, the parameters do not fit the query, a selected target is a reserved field or not a data entity, or rows disagree about one entity fieldblackholes-preview
the request is malformed, confirm is wrong, the parameters do not fit the query, a selected target is a reserved field or not a data entity, or rows disagree about one entity fieldblackholes-execute
options is not an object, or an option is invalid or unsupportedblackholes-audit
options is not an object, or an option is invalid, duplicated or unsupportedbackups-sync, sdk-sync, skills-sync

:invalid-json

WhenOperations
JSON text is malformedparse, convert

:compile-failed

WhenOperations
the expression does not compilebuild
the expansion does not compilebuild-macro
the expanded expression does not compileexpression

:evaluation-failed

WhenOperations
the validation work limit is exceededvalidate-schema
the expression fails on the inputevaluate
the query fails, exceeds max_cost or exceeds its automatic work limitrun
the page does not rendernext
a page does not renderpages, all-pages
a rerun of the query failed. Every later call reports this failurenext
the mutation failsrun
the plugin cannot read its stored stateplugin-call, plugin-stream
stored bytes do not match their digestread
stored tree metadata or the manifest of a named payload is corruptedobjects-get, objects-lookup, objects-children, objects-path
the stored manifest is corruptedobjects-manifest, objects-open
a replacement expression fails or exceeds its work limit. History stays unchangedblackholes-preview, blackholes-execute

:out-of-memory

Codes: out_of_memory.

:not-found

Codes: not_found.

WhenOperations
the object has no member with the keymember
the macro refers to an unknown macrobuild-macro, expand-macro
the parent directory is missing, or the file is missing and create is falseopen
no definition is stored at the pathquery, mutation, definition
no expression is stored at the pathexpression
the stored query definition was deletedrun
the definition or exact historical plan revision does not existplan
the plugin reports that the request names nothing it holdsplugin-call, plugin-stream
no object node has the entityobjects-get
the parent has no child with the name, or the parent does not existobjects-lookup
the parent does not existobjects-children
the node or one of its ancestors does not existobjects-path
no payload with the digest is publishedobjects-manifest, objects-open
a parent does not exist or a digest is not publishedobjects-create
the file does not exist or the digest is not publishedobjects-update
the node or the destination does not existobjects-move
the node does not existobjects-remove
the owner does not exist or endedevents-close-owner
the owner does not existevents-subscribe, events-register
the owner or the subscription does not existevents-receive
the owner or the subscription does not exist or endedevents-unsubscribe
the owner or the registration does not existevents-unregister, events-accept
the owner does not exist, or no registered worker matches (code no_worker)events-call
the owner or the side does not exist, or the exchange ended and the side drainedevents-send
the owner or the side does not existevents-finish, events-cancel
the owner or the side does not exist, or it drained after the exchange endedevents-read
no definition has the path (code not_found), or the selection has no assertion to rewrite (code no_match)blackholes-preview, blackholes-execute

:locked

WhenOperations
another process holds the lock after lock_timeoutopen

:conflict

WhenOperations
an enabled plugin finds the database inconsistent with its copies: backups refuse diverging copies with code backup_history_divergent, naming themopen
concurrent writes prevent the commitrun
an entity revision check fails or a concurrent writer prevents the commit; a revision mismatch reports the entity and expected and actual revisionsmerge-patch
the authored definition or accepted plan changed before the explicit control committedplan
another write committed to the database during the buildbulk-finish
the plugin's write lost to a concurrent change, or the database holds writesplugin-call
the database holds writesplugin-stream, finish, objects-upload
the database holds writes while the plugin stores the byteswrite
a name is already taken in its parent or appears twice, or the database holds writesobjects-create
expected_revision is stale, or the database holds writesobjects-update, objects-remove
the name is occupied without replace, expected_revision is stale, or the database holds writesobjects-move
the side already finished (code already_finished), or the other party's queue is full (code delivery_failed)events-send, events-finish
the definition, parameters, selection or history changed since the preview, or the digest names another requestblackholes-execute

:invalid-definition

WhenOperations
a schema cannot compile or a reference cannot resolvevalidate-schema
the macro is invalid or expands recursivelybuild-macro, expand-macro
the definition is invalidquery, mutation
a macro it calls is invalid or expands recursivelyexpression
the loaded query definition is invalidrun
the query or its callable definitions are invalidsubscribe
the mutation selection or definition is invalidrun
the patched definition is invalidpatch-definition

:schema-violation

WhenOperations
the selected instance does not match the schemavalidate-schema
the write breaks a schemarun

:invalid-commit-time

WhenOperations
the #_tx commit time is not later than the last commitmerge-patch

:closed

Codes: closed.

:rejected

WhenOperations
a mutation target or write guard refuses the writerun
the database refuses the patch; the code and diagnostic path name the reason and keymerge-patch
a validator of an enabled plugin refused the definition, such as an event definition outside a mode or with a schema that does not compilepatch-definition
the database refuses the patch; the build has failed and later adds report the same statusbulk-add
the database refuses a patch; an initial build publishes nothing and fallback keeps earlier commitsbulk-finish

:unsupported

Codes: abi_version, core_digest, unsupported_runtime, abi_layout, abi_symbol.

WhenOperations
found differs from the ABI version of the bindingcheck-version
a selected plugin has no implementation on this platform: the filesystem plugin on Windowsopen

:cancelled

Codes: cancelled.

WhenOperations
the subscription is cancelled or closednext

:timeout

WhenOperations
max_wait passed firstindexes-sync
the plugin's wait passed its limitplugin-call
maxWait passed before an event arrivedevents-receive
maxWait passed before an exchange arrivedevents-accept
maxWait passed before a notice arrivedevents-read
maxWait passed before every target confirmedbackups-sync
maxWait passed before the work finishedsdk-sync, skills-sync

:unavailable

WhenOperations
an enabled plugin cannot reach what the open needs: backups refuse with backup_targets_unreachable, backup_target_unreadable or backup_objects_required; filesystem refuses with filesystem_fuse_unavailable or filesystem_mount_failed, naming the mount point; the events plugin is required when the database stores event definitions (plugin_required)open
the patch sets stardust/history and no enabled plugin purges historyrun, merge-patch
the plugin is unknown or the database does not enable itplugin-call, plugin-stream
the database does not enable the objects pluginobjects-get, objects-lookup, objects-children, objects-path, objects-files, objects-manifest, objects-create, objects-update, objects-move, objects-remove, objects-upload, objects-open
the database does not enable the reactors pluginreactors-status
the database does not enable the events pluginevents-status, events-open-owner, events-close-owner, events-publish, events-subscribe, events-receive, events-unsubscribe, events-register, events-unregister, events-accept, events-call, events-send, events-finish, events-cancel, events-read
the database does not enable the blackholes pluginblackholes-preview, blackholes-audit, blackholes-status
the database does not enable the blackholes plugin, an earlier execution is still recovering, an index covers a selected field and cannot be repaired, or a backup target cannot take the blackholeblackholes-execute
the database does not enable the backups pluginbackups-status, backups-sync
the database does not enable the sdk pluginsdk-status, sdk-sync
the database does not enable the skills pluginskills-status, skills-sync

:failed

WhenOperations
a reactor fails; the initiating write and all derived changes are rolled backrun, merge-patch
a reactor fails; the definition and all derived changes are rolled backpatch-definition
a reactor fails while committing this patch; earlier fallback patches remain committedbulk-add
a reactor failed while adding a fallback patch; earlier patches remain committedbulk-finish
the plugin's work failedplugin-call
the plugin's work failed; status describes the failurebackups-sync, sdk-sync, skills-sync

:unlicensed

Codes: unlicensed.

WhenOperations
the token is refused; the error names the reasonactivate

:invalid-pointer

WhenOperations
the text is not a JSON Pointer or the array is not a canonical path arraypointer
the text is not empty and does not start with /, or holds ~ not followed by 0 or 1pointer/parse
a token is a negative or non-integral number, an index-shaped string such as "0", or neither a number nor a stringpointer/format

Refusal examples

The generator captured each result from the native library.

Describe the backup runtime

clojure22 B
(sd/backups-status db)
Result / 171 B
{violations null
 code       unavailable
 message    the plugin is not enabled
 path       null
 field      null
 entity     null
 offset     null
 status     unavailable}

Wait until every target stored the history

clojure103 B
(with-open [sync-options (sd/parse "{maxWait {#dur PT5S}}" :dust)]
  (sd/backups-sync db sync-options))
Result / 171 B
{violations null
 code       unavailable
 message    the plugin is not enabled
 path       null
 field      null
 entity     null
 offset     null
 status     unavailable}

convert

duplicate-text holds this document:

dust14 B
'{:a 1 :a 2}'
clojure112 B
(with-open [source (sd/parse duplicate-text :dust)]
  (sd/parse (:text (sd/read source (sd/root source))) :edn))
Result / 187 B
{violations null
 code       invalid_edn
 message    invalid EDN (Duplicate_Key) at offset 6
 path       null
 field      null
 entity     null
 offset     6
 status     invalid_argument}

Refuse a metadata-only transaction

patch-text holds this document:

dust16 B
#_tx {author x}
clojure75 B
(with-open [patch (sd/parse patch-text :dust)]
  (sd/merge-patch db patch))
Result / 203 B
{violations null
 code       transaction_only
 message    a patch of only #_tx is refused: #_tx annotates a write
 path       #_tx
 field      null
 entity     null
 offset     null
 status     rejected}

Refuse a repeated commit time

future-text holds this document:

dust67 B
#_d  {x 1}
#_tx {stardust/committedAt {#utc 2200-01-01T00:00:00Z}}

older-text holds this document:

dust67 B
#_e  {x 2}
#_tx {stardust/committedAt {#utc 2200-01-01T00:00:00Z}}
clojure152 B
(with-open [future (sd/parse future-text :dust)
            older (sd/parse older-text :dust)]
  (sd/merge-patch db future)
  (sd/merge-patch db older))
Result / 233 B
{violations null
 code       invalid_commit_time
 message    stardust/committedAt must be strictly newer than the latest commit time
 path       null
 field      null
 entity     null
 offset     null
 status     invalid_commit_time}

Refuse an invalid query definition

definition-text holds this document:

dust10 B
find [?x]
clojure84 B
(with-open [definition (sd/parse definition-text :dust)]
  (sd/query db definition))
Result / 174 B
{violations null
 code       unbound_variable
 message    Unbound_Variable
 path       null
 field      null
 entity     null
 offset     null
 status     invalid_definition}

Report a missing stored query

clojure30 B
(sd/query db "people/missing")
Result / 178 B
{violations null
 code       not_found
 message    no definition at this path
 path       people/missing
 field      null
 entity     null
 offset     null
 status     not_found}

Report a malformed byte at offset zero

malformed-text holds these bytes:

text1 B
]
clojure31 B
(sd/parse malformed-text :dust)
Result / 175 B
{violations null
 code       invalid_dust
 message    Invalid_Syntax at offset 0
 path       null
 field      null
 entity     null
 offset     0
 status     invalid_argument}

Report malformed DUST

malformed-text holds these bytes:

text1 B
[
clojure31 B
(sd/parse malformed-text :dust)
Result / 175 B
{violations null
 code       invalid_dust
 message    Unexpected_End at offset 2
 path       null
 field      null
 entity     null
 offset     2
 status     invalid_argument}

Refuse a duration beyond the native tick range

boundary-text holds this document:

dust20 B
9223372036854775807

query-text holds this document:

dust58 B
find    [?name]
where   [[?e name ?name]]
orderBy [?name]
clojure357 B
(with-open [boundary (sd/parse boundary-text :dust)
            definition (sd/parse query-text :dust)
            query (sd/query db definition)]
  (let [max-cost (java.time.Duration/ofSeconds (sd/i64 boundary (sd/root boundary)))
        options {:page-size 2 :max-cost max-cost :as-of 0}]
    (with-open [rows (sd/run query nil options)]
      options)))
Result / 234 B
{violations null
 code       time_out_of_range
 message    The instant is outside the host time range: duration exceeds the native range
 path       null
 field      null
 entity     null
 offset     null
 status     invalid_argument}

Refuse a positive sub-tick duration

boundary-text holds this document:

dust3 B
99

query-text holds this document:

dust58 B
find    [?name]
where   [[?e name ?name]]
orderBy [?name]
clojure355 B
(with-open [boundary (sd/parse boundary-text :dust)
            definition (sd/parse query-text :dust)
            query (sd/query db definition)]
  (let [max-cost (java.time.Duration/ofNanos (sd/i64 boundary (sd/root boundary)))
        options {:page-size 2 :max-cost max-cost :as-of 0}]
    (with-open [rows (sd/run query nil options)]
      options)))
Result / 239 B
{violations null
 code       inexact_number
 message    The number has no exact form in the target type: duration requires whole 100 ns ticks
 path       null
 field      null
 entity     null
 offset     null
 status     invalid_argument}