Skip to Content
Gnomon Docs
Reference

Errors

Every error gnomon raises ends its hint with a stable code, [gnomon:<slug>]. The CLI, the MCP server and the SDKs also append what gnomon.explain_error(sqlstate, message) says about it. The common ones first:

CodeWhat happened, and what to do
upsert_on_branchINSERT ... ON CONFLICT on a branch in the SQL core: a view has no unique index for PostgreSQL to match. Load the C module, or write it as an UPDATE then an INSERT ... WHERE NOT EXISTS.
not_trackedA write on a branch to a table gnomon does not track: reads see main's rows, writes are refused. gnomon.track('t'), or write it on main.
unknown_branchNo such branch; the message lists open branches with a similar name. gnomon branch list.
branch_closedThe branch is closed or merged and takes no writes. gnomon.reopen_branch(name), or a new branch.
writes_refused_while_as_ofgnomon.as_of is set: the past is read-only. gnomon.use(branch) without a time.
confined, permissionThe role is confined (it reads and writes its branches only, never main) or lacks a grant.
serialization40001: another transaction changed the row since this statement read it. Retry the transaction (the SDKs do for single statements).
undo_conflict, cherry_pick_conflict40001: rows changed after the transactions being undone or picked; nothing was applied. Undo the later changes too, or resolve by hand. (A merge with conflicts is not an error: it returns with status conflicts; gnomon conflicts <merge>, gnomon resolve, then resume.)
approval_staleThe branch changed after it was approved: review it again (stale_approvals = keep restores counting old approvals).
over_quotaThe branch passed a quota: merge or drop work on it, or raise the quota (gnomon.set_quota).
ddl_on_branchPlain DDL from a branch session: use gnomon.ddl(...) for the branch, or gnomon.use('main') for main.
volatile_default, key_column, branch_constraint, unique_index, unsafe_expression, rename_constrained, drop_table_referencedA schema change gnomon.ddl does not take on a branch (a volatile default, a key column renamed, dropped or retyped, a primary key or exclusion constraint, an expression outside pg_catalog, a rename of a column a branch constraint uses, a table others reference): do it on main, or another way.
not_null_violated, check_violated, unique_violated, fk_violatedA constraint added on a branch does not hold for the branch's rows (when added) or for a write. Fix the rows, then add it again.
dropped_on_branchThe branch's schema version dropped the table.
retype_historyA type change on main whose values do not cast: history keeps every past value. Change the type on a branch with gnomon.ddl(..., up => ...).
cold_scansHistory in an archive read in place, with cold_scans = refuse: set it to allow or thaw, or gnomon restore.
thawing, archivedThe read needs archived history: the daemon is restoring it (gnomon.thaw_status()), or run gnomon restore.
standby_behindThe standby has not replayed to the coordinate: gnomon.use(branch, coordinate) waits for it.
no_heartbeatNo clock tick in the last minute: reads by timestamp land on an older moment. Run gnomon daemon, the C worker or pg_cron.
sql_only_dmlSELECT ... FOR UPDATE takes no row lock on a branch in the SQL core.
run_boundThe runs login's transaction is bound to another run: one run per transaction.

All codes, with the SQLSTATE and message they come with (generated from src/sql; "…" stands for a value filled in at run time):

CodeSQLSTATEMessage
access_list_branches_mainP0001the access list is for branches; main is governed by table grants
adding_checks_requires_gnomon_admin42501adding checks requires gnomon_admin
admin_required42501… requires gnomon_admin
agent_exists42710agent "…" exists
agent_stopped55000agent "…" is stopped
agg_must_count_sumP0001agg must be count or sum
approval_stale42501change request … was approved, but its branch changed after the approval
archive_engine42704no archive engine …
archived55000history of … at this coordinate is archived in …
archiving_requires_gnomon_admin42501archiving requires gnomon_admin
as_of_futureP0001gnomon.as_of … is in the future
author_change_request_cannot42501the author of change request … cannot approve it
bad_expression42804the expression … does not work for a … column …: …
bad_key22023a row key of … is a JSON object of its key columns (…)
batch_must_leastP0001batch must be at least 1
between_attemptsP0001between 1 and 100 attempts
branch_can_merged_intoP0001branch "…" can be merged into its parent "…" only
branch_cannot_merged_intoP0001a branch cannot be merged into itself
branch_child_branchP0001branch "…" has child branch "…"
branch_closed25006branch "…" is …; it no longer accepts writes
branch_constraint0A000exclusion and primary key constraints cannot be added on a branch
branch_did_not_existP0001branch "…" did not exist at …
branch_kind_must_loggedP0001branch kind must be logged or scratch
branch_lineage_too_deepP0001branch lineage too deep
branch_not_manageable42501role … may not manage branch "…"
branch_not_readable42501role … may not read branch "…"
branch_not_runP0001branch "…" is not a run
branch_not_writable42501role … may not write branch "…"
branches_share_no_ancestorP0001branches "…" and "…" share no ancestor
cannot_merge_main_intoP0001cannot merge main into another branch; rebase the branch instead
cannot_resolve_coordinateP0001cannot resolve "…" to a coordinate
cannot_track_schemaP0001cannot track … in schema …
change_request_required42501merges into main require an approved change request
check_fails_good_referenceP0001the check fails at the good reference already
check_passes_bad_referenceP0001the check passes at the bad reference
check_violated23514check constraint "…" of relation "…" is violated by some row on the branch
checkpoint_belongs_another_branchP0001checkpoint "…" belongs to another branch
checks_fail_branch23514checks fail on the branch
cherry_pick_conflict40001cherry-pick would overwrite changes to … row(s) on "…"; nothing was applied
cherry_pick_onto_branchP0001cherry-pick onto the branch it came from
choice_must_ours_theirsP0001choice must be ours, theirs, base or value
cold_scans55000history of … at this coordinate is in archives read in place, and cold_scans is refuse
column_does_not_existP0001column … of … does not exist
column_uses_prefix_gnP0001column "…" of … uses the prefix gn_, which gnomon reserves for its storage columns
confined(explain_error)a confined role named a tracked table by its qualified name: it reads and writes through its branch only
confined_role_cannot_approve42501confined role … cannot approve change requests
could_not_lock_withinP0001could not lock … within … after … attempts
create_table_exists42P07relation ….… exists on main
create_table_key0A000a table created on a branch needs a primary key (tracking does): …
ddl_main0A000gnomon.ddl prepares branch changes only
ddl_not_prepared55000no gnomon.ddl in progress in this session
ddl_nothing0A000the statement changed nothing gnomon.ddl understands
ddl_on_branch0A000… on a branch session changes main for every branch
ddl_outside_branch42501the statement changed real tables, not the branch: name tables without a schema in gnomon.ddl
diff_needs_second_referenceP0001diff(main) needs a second reference
direction_both_outP0001direction is both, in or out
drop_not_null_column0A000dropping ….…: main's NOT NULL column without a default could not be filled by inserts on the branch
drop_table_parent_version0A000table … was created by the version this branch stands on: drop it there
drop_table_referenced2BP01table … is referenced by another table's foreign key: drop that first
dropped_on_branch42P01relation "…" does not exist on this branch (its schema version dropped it)
erasure_requires_gnomon_admin42501erasure requires gnomon_admin
feed_consumer_belongs_role42501feed consumer "…" belongs to role …
feed_poll_needs_limit_leastP0001feed_poll needs a limit of at least 1
fk_outside0A000a foreign key on a branch references a table of the schema, by its name without a schema
fk_violated23503foreign key "…" is violated by some row on the branch
graph_view_missing42704no graph view "…"
graph_view_owner42501graph view "…" belongs to …
graph_view_table42501role … may not read …
history_before_retention_horizon22023history of … before the retention horizon has been dropped
history_checkpoints_known_time0A000history checkpoints are for known-time tables
images_must_none_new22023images must be none, new or both, not …
index_function0A000an index on a branch may call pg_catalog functions only
invalid_coordinateP0001invalid gnomon coordinate "…"
key_column0A000a key column cannot be dropped on a branch: ….…
key_columns_cannot_erasedP0001key columns cannot be erased; delete the row and erase its other columns
logged_branch_cannot_createdP0001a logged branch cannot be created from scratch branch "…"
main_cannot_closedP0001main cannot be closed
main_cannot_droppedP0001main cannot be dropped
main_constraint0A000main's NOT NULL on ….… stays on the branch's writes: drop it on main
main_does_not_expireP0001main does not expire
main_no_baseP0001main has no base
managing_needs_gnomon_admin_ownership42501managing … needs gnomon_admin and ownership of the table
masked_roles_write_branches42501masked roles write branches only
mergeP0001merge … is …
merge_carriesP0001branch "…" forked later than "…" and would carry its parent's changes in between
merge_not_appliedP0001merge … is not applied
merge_not_fully_appliedP0001merge … is not fully applied
merge_not_incremental_mergeP0001merge … is not an incremental merge
merge_not_merge_branchP0001merge … is not a merge of branch "…"
merge_rolled_back_checks23514merge … rolled back: checks failed on the merged state: …
merge_window55000merges into main run between … and … only
merge_window_must_look_likeP0001merge_window must look like 09:00-17:00, not …
merger_required42501undo on main requires membership in gnomon_merger
merging_into_main_requires42501merging into main requires membership in gnomon_merger
mode_must_atomic_incrementalP0001mode must be atomic or incremental
mode_must_known_bitemporalP0001mode must be known or bitemporal
mode_off_clean_alwaysP0001mode is off, clean or always
mode_routing_searchP0001mode is routing or search
must_tracked_act_heldP0001… must be tracked to act as a held outbox
no_agent42704no agent "…"
no_change_requestP0001no change request …
no_checkpoint42704no checkpoint "…"
no_column42703column … does not exist in …
no_comment42704no comment …
no_conflictP0001no conflict …
no_heartbeat(status)no tick in the last minute: reads by timestamp resolve to an older moment
no_history_before_tracked22023gnomon has no history of … before it was tracked at …
no_partitionP0001no partition … of …
no_pending_scheduled_mergeP0001no pending scheduled merge … of yours
no_runs_role55000no runs login: set gnomon.set('runs_role', ) first
no_scenario42704no scenario "…"
no_sink42704no sink "…"
no_subject22023… has no data subject (gnomon.set_subject)
no_tick_beforeP0001no gnomon tick at or before …
not_approved42501change request … for this branch is not approved
not_archived55000partition … of … is not archived and dropped
not_attemptP0001"…" is not an attempt of …
not_bitemporalP0001… is not bitemporal
not_null_violated23502column "…" of relation "…" contains null values on the branch
not_null_without_default0A000a NOT NULL column needs a default on a branch: ….…
not_on_branchP0001gnomon.done() is called on a branch
not_routed55000session is on branch "…" but its search_path does not route there
not_run_login42501not a run of this login
not_tableP0001… is not a table
not_tracked42501….… is not tracked, so a branch cannot write it (reads on a branch see main's rows)
open_change_requests_branchP0001open change requests from a branch
other_tables_reference_truncate0A000other tables reference …; truncate them with it or delete
over_quota53400branch "…" is over its quota: …
partition_emptyP0001partition … of … is empty
permission(explain_error)the role lacks a grant, or is confined
permission_denied_table42501permission denied for table …
policy_refused42501merge of "…" refused by policy …: …
protected_table_changes_through42501protected table … changes only through merges
read_only(explain_error)gnomon.as_of is set, or the branch is closed or merged
reads_tracked_branchesP0001reads are tracked on branches
rename_constrained0A000column ….… is named by a constraint this branch added: drop the constraint first
requires_gnomon_admin42501this requires gnomon_admin
restoring_requires_gnomon_admin42501restoring requires gnomon_admin
retype_history(the cause's)gnomon cannot convert the history of a column to …: …
revert_needs_moment_goP0001revert needs a moment to go back to
revert_works_known_time0A000revert works on known-time tables; bitemporal tables are corrected with gnomon.correct
rewind_branches_main_revertedP0001rewind is for branches; main is reverted with gnomon.revert
role_confined_may_not42501role … is confined and may not write branch "…"
role_does_not_existP0001role … does not exist
role_exists_already42710role … exists already
role_may_not_branch42501role … may not branch from "…"
role_may_not_change42501role … may not change branch "…"
role_may_not_close42501role … may not close branch "…"
role_may_not_drop42501role … may not drop branch "…"
role_may_not_end42501role … may not hand out run "…"
role_may_not_manage42501role … may not manage branch "…"
role_may_not_move42501role … may not move agent "…"
role_may_not_read42501role … may not read branch "…"
role_may_not_rebase42501role … may not rebase branch "…"
role_may_not_record42501role … may not record agent calls
role_may_not_reopen42501role … may not reopen branch "…"
role_may_not_write42501role … may not write branch "…"
role_privileged_superuser_assigns42501role … is privileged; only a superuser assigns it
role_who_scheduled_no42501role … who scheduled it is no longer a merger
row_changed_concurrently40001row changed concurrently
row_key_requiredP0001a row key is required
run_bound42501this transaction is bound to another run
run_ended55000run "…" has ended
run_summary_branchP0001run_summary is for a branch
runner_required42501starting a run requires gnomon_runner
runs_role_unconfined55000the runs login … must be confined (gnomon.confine)
sample_fractionP0001sample is a fraction from 0 to 1
scd2_views_known_time0A000scd2 views are for known-time tables; bitemporal tables already have both axes
schedule_merge_branchP0001schedule the merge of a branch
schema_not_allowed42501role … may not change the schema of branch "…"
schema_one_schema0A000schema changes on a branch need the tracked tables in one schema
schema_scratch0A000schema changes are for logged branches
schema_version_main25006branch-only columns are written on their branch
schema_version_owner0A000branch "…" stands on schema changes made on "…": merge that branch first
schema_version_routing0A000(C module) branch "…" is on schema version …, which SET gnomon.branch alone does not route
schema_version_target0A000branch "…" is on schema version … and "…" is not: merge it into main
scope_must_default_roleP0001scope must be default, role or branch
scratch_branch_lost_server55000scratch branch "…" was lost in a server restart
scratch_branch_not_replicated0A000scratch branch "…" is not replicated: its tables are unlogged
scratch_branch_read_through55000scratch branch "…" is read through the gnomon_r___s routing schemas
search_checkpoint0A000search views do not read through history checkpoints
search_confined42501search views are for logged branches and for roles that may read the tables themselves
sequence_grant(explain_error)the role cannot draw from a sequence behind a column default
serialization(explain_error)another transaction changed the row since the statement read it
session_branch_write_names25006this session is on branch "…": a write to … names main's table and would change main
sink_config22023a kafka sink needs config.brokers (host:port, comma separated) and config.topic
sql_only_dml(status, MCP)upserts and FOR UPDATE on a branch in the SQL core
standby_behind55000this standby may not have replayed coordinate … yet
standby_not_replayed_within55000standby has not replayed to … within …
status_active_pausedP0001status is active or paused
subject_columns22023encrypted columns must exist and be neither key columns nor the subject column
sum_needs_columnP0001a sum needs a column
table_named_gnomon_run_bind_does42501a table named gnomon_run_bind that gnomon does not own is in the way
table_no_primary_keyP0001table … has no primary key
table_protected_changes_reach42501table ….… is protected: changes reach it only through gnomon.merge
tag_belongs_role42501tag "…" belongs to role …
target_branchP0001target branch "…" is …
thaw_failed55000thawing partition … of … failed: …
thaw_too_large54000a read at … needs … archived row(s) thawed, more than thaw_max_rows (…)
thawing55000history of … at this coordinate is being thawed from the archive: … partition(s), … row(s); retry shortly
thawing_requires_gnomon_admin42501thawing requires gnomon_admin
there_no_historyP0001there is no history of … at …
token_lookups_s_server42501token lookups are for gnomon's server
too_many_points54000more than … points from … to … by …
tracking_key_columns_mustP0001tracking key columns of … must exist and be NOT NULL
tracking_key_not_coveredP0001tracking key (…) of … is not covered by a unique index
truncate_bitemporal_table_delete0A000TRUNCATE of a bitemporal table: delete its rows
truncate_refused_tracked_table0A000TRUNCATE is refused on gnomon-tracked table …
undo_conflict40001undo would overwrite later changes to … row(s); nothing was undone
unexpanded_template_tokenP0001unexpanded template token …
unique_index0A000a unique index on a branch takes plain columns
unique_violated23505could not add unique constraint "…": the branch has duplicate values
unknown_branch42704unknown gnomon branch "…"
unknown_branch_coordinateP0001unknown branch or coordinate "…"
unknown_feed_consumerP0001unknown feed consumer "…"
unknown_mask_profileP0001unknown mask profile "…"
unknown_merge_strategyP0001unknown merge strategy "…"
unknown_tagP0001unknown gnomon tag "…"
unsafe_expression42501… on a branch may use pg_catalog functions and operators only, not …
upsert_on_branch(explain_error)INSERT ... ON CONFLICT on a branch in the SQL core
valid_to_must_after_valid_fromP0001valid_to must be after valid_from
volatile_default0A000column ….… has a default that cannot be copied to every row: …
writes_refused_while_as_of25006writes are refused while gnomon.as_of is set (reading the past is read-only): … would change main now