# Error codes

What the command, the editor or a migration reports ends with its code: `line 4: folder.owner: unknown type 'person' [AZ201]`. An error the app meets at run time carries its code in its HINT instead: `rowstile help AZ709`. `rowstile help AZ201` prints a code's page in the terminal.

## Reading the policy

- [AZ101](/errors/AZ101.md): A line the language doesn't read
- [AZ102](/errors/AZ102.md): An expression that doesn't parse
- [AZ103](/errors/AZ103.md): A relation written wrongly
- [AZ104](/errors/AZ104.md): A permission written wrongly
- [AZ105](/errors/AZ105.md): A rule written wrongly
- [AZ106](/errors/AZ106.md): A test or an invariant written wrongly
- [AZ107](/errors/AZ107.md): A name the policy can't use
- [AZ108](/errors/AZ108.md): An included file that can't be read
- [AZ109](/errors/AZ109.md): Declared twice
- [AZ110](/errors/AZ110.md): A dollar-quote tag in a condition
- [AZ111](/errors/AZ111.md): No app role
- [AZ112](/errors/AZ112.md): `this` where there is no row
- [AZ113](/errors/AZ113.md): A name rowstile keeps for itself
- [AZ114](/errors/AZ114.md): A quote that goes on to the next line

## Types and relations

- [AZ201](/errors/AZ201.md): Unknown type
- [AZ202](/errors/AZ202.md): No user type
- [AZ203](/errors/AZ203.md): A relation or permission that isn't there
- [AZ204](/errors/AZ204.md): anyone, link and type:*
- [AZ205](/errors/AZ205.md): A source that can't hold these subjects
- [AZ206](/errors/AZ206.md): A key written wrongly, or of the wrong shape
- [AZ207](/errors/AZ207.md): Sharing needs a permission
- [AZ208](/errors/AZ208.md): A relation nothing uses
- [AZ209](/errors/AZ209.md): A group made only of itself
- [AZ210](/errors/AZ210.md): Custom roles written where they can't be
- [AZ211](/errors/AZ211.md): Custom roles from a relation that can't name their owner
- [AZ212](/errors/AZ212.md): A subject shared two ways

## Permissions and inheritance

- [AZ301](/errors/AZ301.md): Following a relation that can't be followed
- [AZ302](/errors/AZ302.md): A permission that depends on itself
- [AZ303](/errors/AZ303.md): Inheritance with no starting point
- [AZ304](/errors/AZ304.md): Inheritance limited by something other than a condition
- [AZ305](/errors/AZ305.md): A condition inheritance can't store
- [AZ306](/errors/AZ306.md): A deny that doesn't fit its inheritance
- [AZ307](/errors/AZ307.md): A permission the runtime asks for, where it doesn't

## Rules, masks and scopes

- [AZ401](/errors/AZ401.md): Rules for a table no type maps to
- [AZ402](/errors/AZ402.md): Masks need a view
- [AZ403](/errors/AZ403.md): An update refinement without an update rule
- [AZ404](/errors/AZ404.md): A scope written wrongly

## Tests

- [AZ501](/errors/AZ501.md): A $name used before it is given
- [AZ502](/errors/AZ502.md): A test acting as a type that doesn't sign in
- [AZ503](/errors/AZ503.md): A test names a scope the policy doesn't have

## Applying and deploying

- [AZ601](/errors/AZ601.md): A table or column that isn't there
- [AZ602](/errors/AZ602.md): A key of another type
- [AZ603](/errors/AZ603.md): An inheritance condition that isn't the same for everyone at any time
- [AZ604](/errors/AZ604.md): An inheritance condition reading a view
- [AZ605](/errors/AZ605.md): Links used for inheritance can't expire
- [AZ606](/errors/AZ606.md): authz.uid() returns another type
- [AZ607](/errors/AZ607.md): The database holds the migration already, or isn't where it starts
- [AZ608](/errors/AZ608.md): A tree swapped in that wasn't built
- [AZ609](/errors/AZ609.md): No policy is applied
- [AZ610](/errors/AZ610.md): Not a development database
- [AZ611](/errors/AZ611.md): Masked columns still readable
- [AZ612](/errors/AZ612.md): A schema on the search path others may create in
- [AZ613](/errors/AZ613.md): A condition that doesn't run
- [AZ614](/errors/AZ614.md): Something uses a function this policy no longer makes
- [AZ615](/errors/AZ615.md): A migration run outside a transaction
- [AZ616](/errors/AZ616.md): An older command, a newer database
- [AZ617](/errors/AZ617.md): Something is built on a masked view that can't be replaced in place
- [AZ618](/errors/AZ618.md): The owner may not switch to the app role
- [AZ619](/errors/AZ619.md): A lock file rowstile can't read
- [AZ620](/errors/AZ620.md): No tables to draft a policy from
- [AZ621](/errors/AZ621.md): Which table holds the users?
- [AZ622](/errors/AZ622.md): A user table the draft can't use
- [AZ623](/errors/AZ623.md): Too many people for a snapshot
- [AZ624](/errors/AZ624.md): The app role is the policy's owner
- [AZ625](/errors/AZ625.md): A cascade line that names no foreign key
- [AZ626](/errors/AZ626.md): A policy applied by another version of rowstile
- [AZ627](/errors/AZ627.md): Shares whose ids the key can't read
- [AZ628](/errors/AZ628.md): A condition calls the app's code where its text doesn't show it
- [AZ629](/errors/AZ629.md): A key of a type that isn't Postgres's own
- [AZ630](/errors/AZ630.md): A key compared by a collation that isn't deterministic

## What apps see

- [AZ701](/errors/AZ701.md): Nobody signed in
- [AZ702](/errors/AZ702.md): Who is signed in was changed
- [AZ703](/errors/AZ703.md): Login refused
- [AZ704](/errors/AZ704.md): A read-only session
- [AZ705](/errors/AZ705.md): Not allowed
- [AZ706](/errors/AZ706.md): The policy doesn't allow this share
- [AZ707](/errors/AZ707.md): Not in the policy
- [AZ708](/errors/AZ708.md): No such thing
- [AZ709](/errors/AZ709.md): A write refused by a rule
- [AZ710](/errors/AZ710.md): A missing or wrong argument
- [AZ711](/errors/AZ711.md): The audit trail can't be changed
- [AZ712](/errors/AZ712.md): The change feed was trimmed
- [AZ713](/errors/AZ713.md): Moved inside itself
- [AZ714](/errors/AZ714.md): Sign in first
- [AZ715](/errors/AZ715.md): For users only
- [AZ716](/errors/AZ716.md): Signed in as someone else already
- [AZ717](/errors/AZ717.md): A share of yours is in the way
- [AZ718](/errors/AZ718.md): The review's deadline passed
- [AZ719](/errors/AZ719.md): A key set with no key to check tokens with
- [AZ720](/errors/AZ720.md): SCIM settings that don't hold
- [AZ721](/errors/AZ721.md): A SCIM request the endpoint doesn't serve
- [AZ722](/errors/AZ722.md): SCIM settings that no longer hold
- [AZ723](/errors/AZ723.md): The policy was applied while a write ran

## The sync index (a preview)

- [AZ801](/errors/AZ801.md): A sync line that names nothing to sync
- [AZ802](/errors/AZ802.md): Sync lines and no sync role, or a sync role and nothing synced
- [AZ803](/errors/AZ803.md): The sync role is the app role
- [AZ804](/errors/AZ804.md): A synced permission reads the clock
- [AZ805](/errors/AZ805.md): A synced permission reads who asks
- [AZ806](/errors/AZ806.md): A synced permission reads other rows
- [AZ807](/errors/AZ807.md): A nested group the sync index can't hold
- [AZ808](/errors/AZ808.md): The sync role isn't one of its own
- [AZ809](/errors/AZ809.md): The sync role may read a masked column
- [AZ810](/errors/AZ810.md): A sync line keyed by a type it can't be keyed by
- [AZ811](/errors/AZ811.md): A mirrored sync line that can't be mirrored

These pages are written from `core/authzlib/errors.py`; edit it, then `python3 core/tests/unit_test.py --update`.
