# CLI error codes

Every code a nextly command can end with, the cause it stands for, and a page on how to fix it.

When a `nextly` command fails, it ends with the same four lines: what happened, why, what to run next, and a link to the page for its code.

```text
✗ <what happened, in one sentence>
  Why:  <the cause>
  Next: <the command or action that fixes it>
  Docs: <the page for this code>  (<CODE>)
```

Run the command again with `--verbose` to add the internal context and the stack below those lines. The exit code is 1.

Each code stands for one cause and keeps that meaning in later releases, so scripts and CI can match on it.

| Code                                                                                                                         | Cause                                                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`ADMIN_EMAIL_INVALID`](https://nextlyhq.com/docs/cli/errors/admin-email-invalid.md)                                         | `nextly users:create-admin` was given no email, or one that is not an email address.                                                                             |
| [`ADMIN_EMAIL_IN_USE`](https://nextlyhq.com/docs/cli/errors/admin-email-in-use.md)                                           | An account already uses the email given for the first administrator.                                                                                             |
| [`ADMIN_NAME_MISSING`](https://nextlyhq.com/docs/cli/errors/admin-name-missing.md)                                           | `nextly users:create-admin` was given no name for the administrator.                                                                                             |
| [`ADMIN_PASSWORDS_DIFFER`](https://nextlyhq.com/docs/cli/errors/admin-passwords-differ.md)                                   | The two passwords typed at the prompt differ.                                                                                                                    |
| [`ADMIN_PASSWORD_MISSING`](https://nextlyhq.com/docs/cli/errors/admin-password-missing.md)                                   | No password was given: `NEXTLY_ADMIN_PASSWORD` is not set and none was typed at a prompt.                                                                        |
| [`ADMIN_PASSWORD_TOO_WEAK`](https://nextlyhq.com/docs/cli/errors/admin-password-too-weak.md)                                 | The administrator's password does not meet the install's password rules.                                                                                         |
| [`BASELINE_LOCK_RELEASED`](https://nextlyhq.com/docs/cli/errors/baseline-lock-released.md)                                   | The schema lock was released before `nextly migrate:baseline` adopted the database, so nothing was written.                                                      |
| [`BLOCK_MANIFEST_STALE`](https://nextlyhq.com/docs/cli/errors/block-manifest-stale.md)                                       | The committed block manifest does not match what the configuration generates.                                                                                    |
| [`BLOCK_MANIFEST_UNREADABLE`](https://nextlyhq.com/docs/cli/errors/block-manifest-unreadable.md)                             | The block manifest exists but could not be read.                                                                                                                 |
| [`BLOCK_SCHEMA_DERIVATION_FAILED`](https://nextlyhq.com/docs/cli/errors/block-schema-derivation-failed.md)                   | The block document schema could not be derived, because something in the process extended `Object.prototype`.                                                    |
| [`BUILDER_MIGRATION_SNAPSHOT_MISSING`](https://nextlyhq.com/docs/cli/errors/builder-migration-snapshot-missing.md)           | A migration file the Schema Builder wrote has no snapshot beside it, so `nextly migrate` does not apply it.                                                      |
| [`BUILDER_RELATION_TARGET_UNKNOWN`](https://nextlyhq.com/docs/cli/errors/builder-relation-target-unknown.md)                 | A relationship field in `ui-schema.json` names a collection that neither file declares.                                                                          |
| [`BUILDER_SLUG_COLLISION`](https://nextlyhq.com/docs/cli/errors/builder-slug-collision.md)                                   | An entity in `ui-schema.json` has the slug of a collection in `nextly.config.ts`.                                                                                |
| [`BUILD_GENERATION_FAILED`](https://nextlyhq.com/docs/cli/errors/build-generation-failed.md)                                 | The build could not generate its type or Zod schema files.                                                                                                       |
| [`BUILD_MIGRATIONS_NOT_APPLIED`](https://nextlyhq.com/docs/cli/errors/build-migrations-not-applied.md)                       | `nextly build --strict` found migrations the database has not applied, or that failed.                                                                           |
| [`BUILD_STRICT_WARNINGS`](https://nextlyhq.com/docs/cli/errors/build-strict-warnings.md)                                     | `nextly build --strict` found validation warnings, and `--strict` fails the build on any warning.                                                                |
| [`CHECKSUM_MISMATCH`](https://nextlyhq.com/docs/cli/errors/checksum-mismatch.md)                                             | A migration file no longer matches the checksum `migrate:create` recorded in its snapshot.                                                                       |
| [`COMPONENT_MAP_OUT_OF_DATE`](https://nextlyhq.com/docs/cli/errors/component-map-out-of-date.md)                             | `nextly generate:types --check` found the committed component map out of step with the configuration.                                                            |
| [`CONFIG_IMPORT_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/config-import-not-found.md)                                 | The configuration file imports a file or package that could not be found.                                                                                        |
| [`CONFIG_INVALID`](https://nextlyhq.com/docs/cli/errors/config-invalid.md)                                                   | The configuration, or a definition it loads, declares something Nextly cannot use.                                                                               |
| [`CONFIG_INVALID_EXPORT`](https://nextlyhq.com/docs/cli/errors/config-invalid-export.md)                                     | The configuration file's default export is not a configuration object.                                                                                           |
| [`CONFIG_LOAD_FAILED`](https://nextlyhq.com/docs/cli/errors/config-load-failed.md)                                           | The configuration file compiled, but threw an error while it ran.                                                                                                |
| [`CONFIG_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/config-not-found.md)                                               | The configuration file named with `-c` or `--config` does not exist.                                                                                             |
| [`CONFIG_SYNTAX_ERROR`](https://nextlyhq.com/docs/cli/errors/config-syntax-error.md)                                         | The configuration file is not valid TypeScript, so it could not be compiled.                                                                                     |
| [`CONFIG_TOOLING_UNAVAILABLE`](https://nextlyhq.com/docs/cli/errors/config-tooling-unavailable.md)                           | Reading the configuration needs the optional `esbuild` package, which is not installed.                                                                          |
| [`CORE_DESTRUCTIVE_CHANGE_DECLINED`](https://nextlyhq.com/docs/cli/errors/core-destructive-change-declined.md)               | A destructive change to Nextly's own tables was not confirmed at the prompt, so none was made.                                                                   |
| [`CORE_SCHEMA_APPLY_FAILED`](https://nextlyhq.com/docs/cli/errors/core-schema-apply-failed.md)                               | The database refused a change to Nextly's own tables.                                                                                                            |
| [`CORE_TABLES_NOT_CREATED`](https://nextlyhq.com/docs/cli/errors/core-tables-not-created.md)                                 | The command could not create the core tables on a database that has none.                                                                                        |
| [`CORE_TABLES_NOT_RECONCILED`](https://nextlyhq.com/docs/cli/errors/core-tables-not-reconciled.md)                           | The database's existing core tables could not be brought up to date before the sync.                                                                             |
| [`DATABASE_ADAPTER_MISSING`](https://nextlyhq.com/docs/cli/errors/database-adapter-missing.md)                               | The database adapter package for the dialect `DATABASE_URL` names is not installed.                                                                              |
| [`DATABASE_CATALOG_UNREADABLE`](https://nextlyhq.com/docs/cli/errors/database-catalog-unreadable.md)                         | The database catalog could not be read, so the command could not tell which field-group registry table the database uses.                                        |
| [`DATABASE_DIALECT_INVALID`](https://nextlyhq.com/docs/cli/errors/database-dialect-invalid.md)                               | `DB_DIALECT` names a database Nextly does not support.                                                                                                           |
| [`DATABASE_DIALECT_UNKNOWN`](https://nextlyhq.com/docs/cli/errors/database-dialect-unknown.md)                               | The database type could not be told from `DATABASE_URL`, and `DB_DIALECT` is not set.                                                                            |
| [`DATABASE_NOT_BASELINED`](https://nextlyhq.com/docs/cli/errors/database-not-baselined.md)                                   | The database already has tables but no migration history, and the first migration starts from an empty database.                                                 |
| [`DATABASE_UNREACHABLE`](https://nextlyhq.com/docs/cli/errors/database-unreachable.md)                                       | The command could not connect to the database `DATABASE_URL` names.                                                                                              |
| [`DATABASE_URL_MISSING`](https://nextlyhq.com/docs/cli/errors/database-url-missing.md)                                       | `DATABASE_URL` is not set, so the command has no database to use.                                                                                                |
| [`DATABASE_VERSION_UNSUPPORTED`](https://nextlyhq.com/docs/cli/errors/database-version-unsupported.md)                       | The database server is older than the oldest version Nextly supports for its dialect.                                                                            |
| [`DATA_LOSS_CONSENT_MALFORMED`](https://nextlyhq.com/docs/cli/errors/data-loss-consent-malformed.md)                         | The data-loss consent names its targets in a form it cannot read, so the command changed nothing.                                                                |
| [`DATA_LOSS_CONSENT_NOT_COVERED`](https://nextlyhq.com/docs/cli/errors/data-loss-consent-not-covered.md)                     | The data-loss consent names what may be deleted, and leaves out something the command would delete.                                                              |
| [`DATA_LOSS_CONSENT_REQUIRED`](https://nextlyhq.com/docs/cli/errors/data-loss-consent-required.md)                           | The command would delete data, no consent covers it, and no terminal is attached to ask.                                                                         |
| [`DEMOTE_COLLECTION_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/demote-collection-not-found.md)                         | `db:sync --demote` names a collection that `nextly.config.ts` does not define.                                                                                   |
| [`DROP_OF_FOREIGN_TABLE`](https://nextlyhq.com/docs/cli/errors/drop-of-foreign-table.md)                                     | A migration would drop, rename or change a table, column or index that belongs to a different owner.                                                             |
| [`FIELD_GROUP_BACKUP_NOT_CONFIRMED`](https://nextlyhq.com/docs/cli/errors/field-group-backup-not-confirmed.md)               | `migrate:field-groups --apply` was run without `--backup-confirmed`, so it changed nothing.                                                                      |
| [`FIELD_GROUP_MIGRATION_IN_FLIGHT`](https://nextlyhq.com/docs/cli/errors/field-group-migration-in-flight.md)                 | A field-group storage migration is part-way through on this database, so the command refused to change its schema.                                               |
| [`FIELD_GROUP_STORAGE_REFUSED`](https://nextlyhq.com/docs/cli/errors/field-group-storage-refused.md)                         | The field-group storage on this database is in a shape the field-group migration will not proceed from.                                                          |
| [`I18N_RESTORE_COLLECTION_REQUIRED`](https://nextlyhq.com/docs/cli/errors/i18n-restore-collection-required.md)               | `i18n:restore` was run without `--collection`, so it has no entity to restore.                                                                                   |
| [`I18N_RESTORE_ENTITY_AMBIGUOUS`](https://nextlyhq.com/docs/cli/errors/i18n-restore-entity-ambiguous.md)                     | `i18n:restore --collection` names more than one kind of entity, and `--kind` does not say which.                                                                 |
| [`I18N_RESTORE_ENTITY_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/i18n-restore-entity-not-found.md)                     | `i18n:restore --collection` names no collection, single or field group in the configuration or `ui-schema.json`.                                                 |
| [`I18N_RESTORE_KIND_INVALID`](https://nextlyhq.com/docs/cli/errors/i18n-restore-kind-invalid.md)                             | `i18n:restore --kind` is not `collection`, `single` or `field-group`.                                                                                            |
| [`INPUT_REFUSED`](https://nextlyhq.com/docs/cli/errors/input-refused.md)                                                     | A command refused something it was given or read as not valid, for the reason its message names.                                                                 |
| [`INTERRUPTED_BEFORE_START`](https://nextlyhq.com/docs/cli/errors/interrupted-before-start.md)                               | The command was interrupted while it waited to take a schema lock, before it changed anything.                                                                   |
| [`INVALID_SNAPSHOT`](https://nextlyhq.com/docs/cli/errors/invalid-snapshot.md)                                               | A migration's snapshot file is not valid JSON, or not a snapshot this version of Nextly reads.                                                                   |
| [`LEGACY_BOOKKEEPING_FOUND`](https://nextlyhq.com/docs/cli/errors/legacy-bookkeeping-found.md)                               | The database still has the migration bookkeeping tables of an earlier Nextly release.                                                                            |
| [`LOCALIZATION_NOT_PROVISIONED`](https://nextlyhq.com/docs/cli/errors/localization-not-provisioned.md)                       | `db:sync` could not create the translation tables of a localized entity, so its translations cannot be written or read.                                          |
| [`MEDIA_APPLY_OUTSIDE_PROJECT`](https://nextlyhq.com/docs/cli/errors/media-apply-outside-project.md)                         | `nextly media orphans --apply` was run from outside the project `--cwd` names, so the database settings it read may be another project's.                        |
| [`MEDIA_CONFIG_OUTSIDE_PROJECT`](https://nextlyhq.com/docs/cli/errors/media-config-outside-project.md)                       | `nextly media orphans --apply` was given a configuration from outside the project, whose storage may be another project's.                                       |
| [`MEDIA_STORAGE_UNLISTABLE`](https://nextlyhq.com/docs/cli/errors/media-storage-unlistable.md)                               | The media storage cannot list its files, so it cannot be searched for left-behind thumbnails.                                                                    |
| [`MEDIA_THUMBNAILS_NOT_REMOVED`](https://nextlyhq.com/docs/cli/errors/media-thumbnails-not-removed.md)                       | Some left-behind thumbnails could not be removed, or could not be checked just before their removal.                                                             |
| [`MIGRATION_APPLY_FAILED`](https://nextlyhq.com/docs/cli/errors/migration-apply-failed.md)                                   | The database refused a statement of a migration or of a schema change.                                                                                           |
| [`MIGRATION_CHECKSUM_MISMATCH`](https://nextlyhq.com/docs/cli/errors/migration-checksum-mismatch.md)                         | A plugin's migration changed after it was generated or after it was applied.                                                                                     |
| [`MIGRATION_CREATE_CANCELLED`](https://nextlyhq.com/docs/cli/errors/migration-create-cancelled.md)                           | A prompt of `nextly migrate:create` was cancelled, so it wrote no migration.                                                                                     |
| [`MIGRATION_DRIFT`](https://nextlyhq.com/docs/cli/errors/migration-drift.md)                                                 | The database matches neither the state a migration starts from nor the state it produces.                                                                        |
| [`MIGRATION_IRREVERSIBLE`](https://nextlyhq.com/docs/cli/errors/migration-irreversible.md)                                   | A migration to roll back has no `-- DOWN` section.                                                                                                               |
| [`MIGRATION_MISSING`](https://nextlyhq.com/docs/cli/errors/migration-missing.md)                                             | A migration recorded as applied has no file in the migrations folder.                                                                                            |
| [`MIGRATION_NAME_REQUIRED`](https://nextlyhq.com/docs/cli/errors/migration-name-required.md)                                 | `nextly migrate:create` was given no name for a migration that is not blank.                                                                                     |
| [`MIGRATION_SQL_UNCHECKABLE`](https://nextlyhq.com/docs/cli/errors/migration-sql-uncheckable.md)                             | A migration's SQL is in a form the schema guard cannot read, so it cannot check the migration leaves other owners' tables alone.                                 |
| [`MIGRATION_TAMPERED`](https://nextlyhq.com/docs/cli/errors/migration-tampered.md)                                           | A migration recorded as applied has a file that no longer matches its recorded checksum.                                                                         |
| [`MISSING_MIGRATION`](https://nextlyhq.com/docs/cli/errors/missing-migration.md)                                             | A snapshot file in `meta/` has no migration file beside it.                                                                                                      |
| [`MISSING_SNAPSHOT`](https://nextlyhq.com/docs/cli/errors/missing-snapshot.md)                                               | A migration file has no snapshot file beside it in `meta/`.                                                                                                      |
| [`NEXTLY_CORE_DESTRUCTIVE_REFUSED`](https://nextlyhq.com/docs/cli/errors/nextly-core-destructive-refused.md)                 | Bringing Nextly's own tables up to date needs a destructive change, which `nextly migrate` makes only with `NEXTLY_ALLOW_CORE_DESTRUCTIVE=1`.                    |
| [`NEXTLY_MIGRATE_LOCK_BUSY`](https://nextlyhq.com/docs/cli/errors/nextly-migrate-lock-busy.md)                               | Another run holds the schema lock, so the command did not start and changed nothing.                                                                             |
| [`NEXTLY_MIGRATION_CONCURRENT_RUN`](https://nextlyhq.com/docs/cli/errors/nextly-migration-concurrent-run.md)                 | Another run recorded the same migration while this one was running it.                                                                                           |
| [`NEXTLY_MIGRATION_FOREIGN_KEY_VIOLATION`](https://nextlyhq.com/docs/cli/errors/nextly-migration-foreign-key-violation.md)   | On SQLite, a migration left rows that reference rows that do not exist, or foreign-key enforcement could not be switched off for it.                             |
| [`NEXTLY_MIGRATION_PARTIALLY_APPLIED`](https://nextlyhq.com/docs/cli/errors/nextly-migration-partially-applied.md)           | A migration that runs outside a transaction failed part-way, now or in its newest attempt, and the statements before the failure stayed applied.                 |
| [`NEXTLY_MIGRATION_SNAPSHOT_MISSING`](https://nextlyhq.com/docs/cli/errors/nextly-migration-snapshot-missing.md)             | `nextly migrate:resolve --applied` has no snapshot to compare the live schema with.                                                                              |
| [`NEXTLY_PERMISSION_COLLISION`](https://nextlyhq.com/docs/cli/errors/nextly-permission-collision.md)                         | A plugin's custom permission repeats another, targets a resource Nextly reserves, or repeats one Nextly creates itself.                                          |
| [`NEXTLY_ROUTE_COLLISION`](https://nextlyhq.com/docs/cli/errors/nextly-route-collision.md)                                   | Two plugin routes answer the same method and path.                                                                                                               |
| [`NEXTLY_ROUTE_INVALID_PATH`](https://nextlyhq.com/docs/cli/errors/nextly-route-invalid-path.md)                             | A plugin declares a route whose path does not start with `/`.                                                                                                    |
| [`NEXTLY_SCHEMA_CROSS_PLUGIN_RELATION`](https://nextlyhq.com/docs/cli/errors/nextly-schema-cross-plugin-relation.md)         | A plugin relates to another plugin's entity without declaring that plugin in `dependsOn`.                                                                        |
| [`NEXTLY_SCHEMA_EXTEND_FIELD_DUPLICATE`](https://nextlyhq.com/docs/cli/errors/nextly-schema-extend-field-duplicate.md)       | A plugin extends an entity with a field whose name the entity already has.                                                                                       |
| [`NEXTLY_SCHEMA_EXTEND_TARGET_UNKNOWN`](https://nextlyhq.com/docs/cli/errors/nextly-schema-extend-target-unknown.md)         | A plugin extends an entity that neither the configuration, a plugin nor the Schema Builder declares.                                                             |
| [`NEXTLY_SCHEMA_RELATION_TARGET_MISSING`](https://nextlyhq.com/docs/cli/errors/nextly-schema-relation-target-missing.md)     | A relationship field in the configuration or a plugin names a collection that does not exist.                                                                    |
| [`NEXTLY_SCHEMA_RENAME_UNKNOWN_TARGET`](https://nextlyhq.com/docs/cli/errors/nextly-schema-rename-unknown-target.md)         | A plugin's `.rename()` names an entity the plugin does not contribute.                                                                                           |
| [`NEXTLY_SCHEMA_SLUG_COLLISION`](https://nextlyhq.com/docs/cli/errors/nextly-schema-slug-collision.md)                       | A plugin contributes an entity whose slug the configuration or another plugin already uses.                                                                      |
| [`NO_TRANSACTION_NEEDS_BLANK`](https://nextlyhq.com/docs/cli/errors/no-transaction-needs-blank.md)                           | `--no-transaction` was given to `nextly migrate:create` without `--blank` or `--plugin`.                                                                         |
| [`OWNERSHIP_TAKEOVER_REFUSED`](https://nextlyhq.com/docs/cli/errors/ownership-takeover-refused.md)                           | A table or element recorded as one owner's would pass to another, so the change was refused.                                                                     |
| [`PACKAGE_INSTALL_FAILED`](https://nextlyhq.com/docs/cli/errors/package-install-failed.md)                                   | The package manager could not install the package `nextly add` was given.                                                                                        |
| [`PASSWORD_CLEAR_UNCONFIRMED`](https://nextlyhq.com/docs/cli/errors/password-clear-unconfirmed.md)                           | `nextly users:clear-plaintext-passwords --apply` was run without `--confirm-default-hasher`.                                                                     |
| [`PLUGIN_ADMIN_WIDGET_NOT_JSON`](https://nextlyhq.com/docs/cli/errors/plugin-admin-widget-not-json.md)                       | A plugin's admin widget holds a value that cannot be sent to the browser as JSON.                                                                                |
| [`PLUGIN_ADMIN_WIDGET_UNDRAWABLE`](https://nextlyhq.com/docs/cli/errors/plugin-admin-widget-undrawable.md)                   | A plugin's admin widget describes neither a component nor an archetype the admin can draw.                                                                       |
| [`PLUGIN_APPLIED_MIGRATION_REMOVED`](https://nextlyhq.com/docs/cli/errors/plugin-applied-migration-removed.md)               | A plugin no longer lists a migration the database records as applied.                                                                                            |
| [`PLUGIN_CLIENT_CONFIG_NOT_JSON`](https://nextlyhq.com/docs/cli/errors/plugin-client-config-not-json.md)                     | A plugin's `admin.clientConfig` holds a value that cannot be sent to the browser as JSON.                                                                        |
| [`PLUGIN_COLUMN_NOT_MIGRATED`](https://nextlyhq.com/docs/cli/errors/plugin-column-not-migrated.md)                           | A column a plugin contributes to a table is not in the database, because the migration that adds it has not been applied.                                        |
| [`PLUGIN_DEPENDENCY_NOT_INSTALLED`](https://nextlyhq.com/docs/cli/errors/plugin-dependency-not-installed.md)                 | A plugin to install depends on a plugin that is not installed on this database.                                                                                  |
| [`PLUGIN_DISABLED`](https://nextlyhq.com/docs/cli/errors/plugin-disabled.md)                                                 | The plugin to install or uninstall is disabled in the configuration, so its hooks would not run.                                                                 |
| [`PLUGIN_DOCUMENT_VIEW_COLLISION`](https://nextlyhq.com/docs/cli/errors/plugin-document-view-collision.md)                   | Two plugin document views answer the same address.                                                                                                               |
| [`PLUGIN_DOCUMENT_VIEW_FIELD_TYPE_UNOWNED`](https://nextlyhq.com/docs/cli/errors/plugin-document-view-field-type-unowned.md) | A plugin scopes a document view to a field type the plugin does not contribute.                                                                                  |
| [`PLUGIN_DOCUMENT_VIEW_INVALID`](https://nextlyhq.com/docs/cli/errors/plugin-document-view-invalid.md)                       | A plugin declares a document view with no component, a label that is not text, or a path the admin cannot route.                                                 |
| [`PLUGIN_DOWN_KEEPS_TABLES`](https://nextlyhq.com/docs/cli/errors/plugin-down-keeps-tables.md)                               | A plugin's DOWN migrations, as written, do not drop every table it owns, so a full uninstall would leave some.                                                   |
| [`PLUGIN_DOWN_LEFT_TABLES`](https://nextlyhq.com/docs/cli/errors/plugin-down-left-tables.md)                                 | A plugin's DOWN migrations ran and left a table it owns in place, so the uninstall was not recorded.                                                             |
| [`PLUGIN_ENTRY_EXPORTS_SEVERAL`](https://nextlyhq.com/docs/cli/errors/plugin-entry-exports-several.md)                       | The file given to `--plugin` exports more than one plugin, so it is not clear which to generate for.                                                             |
| [`PLUGIN_ENTRY_UNNAMED`](https://nextlyhq.com/docs/cli/errors/plugin-entry-unnamed.md)                                       | The file given to `--plugin` exports no plugin definition with a name.                                                                                           |
| [`PLUGIN_EXTENDS_OUTSIDE_ITS_SCHEMA`](https://nextlyhq.com/docs/cli/errors/plugin-extends-outside-its-schema.md)             | A plugin's `schema.extend` hook extends an entity that is not in the schema its migration module is compiled from.                                               |
| [`PLUGIN_HAS_DEPENDENTS`](https://nextlyhq.com/docs/cli/errors/plugin-has-dependents.md)                                     | Another configured plugin depends on the plugin to uninstall.                                                                                                    |
| [`PLUGIN_HOOK_CHANGED_SCHEMA`](https://nextlyhq.com/docs/cli/errors/plugin-hook-changed-schema.md)                           | On SQLite, a plugin's `onUninstall` changed the database schema before its DOWN migrations ran.                                                                  |
| [`PLUGIN_HOOK_CHANGED_TABLES`](https://nextlyhq.com/docs/cli/errors/plugin-hook-changed-tables.md)                           | A plugin's `onUninstall` dropped, renamed or replaced a table its DOWN migrations were to drop.                                                                  |
| [`PLUGIN_HOOK_HANDLERS_RUNNING`](https://nextlyhq.com/docs/cli/errors/plugin-hook-handlers-running.md)                       | Event handlers a plugin's install or uninstall hook set off were still running when the command's wait ran out.                                                  |
| [`PLUGIN_HOOK_SERVICES_REGISTERED`](https://nextlyhq.com/docs/cli/errors/plugin-hook-services-registered.md)                 | A plugin's install or uninstall hook was not run, because the process already had services registered.                                                           |
| [`PLUGIN_INSTALL_TARGET_UNCLEAR`](https://nextlyhq.com/docs/cli/errors/plugin-install-target-unclear.md)                     | `nextly plugins install` was given both a plugin name and `--all`, or neither.                                                                                   |
| [`PLUGIN_JOB_SLUG_TAKEN`](https://nextlyhq.com/docs/cli/errors/plugin-job-slug-taken.md)                                     | A plugin declares a job slug that another plugin, a reserved namespace or a built-in job type already uses.                                                      |
| [`PLUGIN_LIFECYCLE_LOCK_BUSY`](https://nextlyhq.com/docs/cli/errors/plugin-lifecycle-lock-busy.md)                           | Another migration held the migrate lock, so a plugin install or uninstall ran nothing.                                                                           |
| [`PLUGIN_MIGRATIONS_BARREL_UNREADABLE`](https://nextlyhq.com/docs/cli/errors/plugin-migrations-barrel-unreadable.md)         | The plugin's existing migrations barrel could not be loaded, so `nextly migrate:create` stopped rather than rewrite it.                                          |
| [`PLUGIN_MIGRATIONS_OUT_OF_ORDER`](https://nextlyhq.com/docs/cli/errors/plugin-migrations-out-of-order.md)                   | A plugin lists its migrations in an order other than the order of their names.                                                                                   |
| [`PLUGIN_MIGRATIONS_UNAVAILABLE`](https://nextlyhq.com/docs/cli/errors/plugin-migrations-unavailable.md)                     | A plugin declares tables or table elements and ships no migrations to create them.                                                                               |
| [`PLUGIN_MIGRATION_ADDS_UNFILLABLE_COLUMN`](https://nextlyhq.com/docs/cli/errors/plugin-migration-adds-unfillable-column.md) | A plugin migration would add a NOT NULL column with no default to a table that already has rows.                                                                 |
| [`PLUGIN_MIGRATION_BEFORE_APPLIED`](https://nextlyhq.com/docs/cli/errors/plugin-migration-before-applied.md)                 | A plugin lists a migration that has not run ahead of one that has.                                                                                               |
| [`PLUGIN_MIGRATION_DROPS_CREATED_SCHEMA`](https://nextlyhq.com/docs/cli/errors/plugin-migration-drops-created-schema.md)     | A generated plugin migration would drop a table or column an earlier migration of the plugin created.                                                            |
| [`PLUGIN_MIGRATION_MODULE_EXISTS`](https://nextlyhq.com/docs/cli/errors/plugin-migration-module-exists.md)                   | `nextly migrate:create --plugin` would write a migration module where one already exists, so it wrote nothing.                                                   |
| [`PLUGIN_MIGRATION_NAME_DUPLICATE`](https://nextlyhq.com/docs/cli/errors/plugin-migration-name-duplicate.md)                 | A plugin ships two migrations with the same name, ignoring case.                                                                                                 |
| [`PLUGIN_MIGRATION_NOT_SHIPPED`](https://nextlyhq.com/docs/cli/errors/plugin-migration-not-shipped.md)                       | A full uninstall needs the DOWN of an applied migration the configured version of the plugin no longer ships.                                                    |
| [`PLUGIN_MIGRATION_SQL_MISSING`](https://nextlyhq.com/docs/cli/errors/plugin-migration-sql-missing.md)                       | A plugin migration changes the schema on this database's dialect and has no statements for it.                                                                   |
| [`PLUGIN_NEEDS_MIGRATED_DATABASE`](https://nextlyhq.com/docs/cli/errors/plugin-needs-migrated-database.md)                   | A plugin was installed or uninstalled on a database `nextly migrate` has not run on yet.                                                                         |
| [`PLUGIN_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/plugin-not-found.md)                                               | The plugin named on the command line is not among the plugins the configuration lists.                                                                           |
| [`PLUGIN_NOT_INSTALLED`](https://nextlyhq.com/docs/cli/errors/plugin-not-installed.md)                                       | In production, a configured plugin has not been installed on this database.                                                                                      |
| [`PLUGIN_RESOLUTION_ERROR`](https://nextlyhq.com/docs/cli/errors/plugin-resolution-error.md)                                 | A plugin's declaration could not be resolved: a dependency, a version range, a capability, a name or a setting it declares is missing, in conflict or not valid. |
| [`PLUGIN_ROLLBACK_MODULE_NOT_SHIPPED`](https://nextlyhq.com/docs/cli/errors/plugin-rollback-module-not-shipped.md)           | `nextly migrate:down --plugin` names a module the ledger records as applied that the configured version of the plugin no longer ships.                           |
| [`PLUGIN_ROUTE_MOUNT_INVALID`](https://nextlyhq.com/docs/cli/errors/plugin-route-mount-invalid.md)                           | A plugin declares a route whose `mount` is neither "plugin" nor "root".                                                                                          |
| [`PLUGIN_ROUTE_ROOT_UNREACHABLE`](https://nextlyhq.com/docs/cli/errors/plugin-route-root-unreachable.md)                     | A plugin declares a root-mounted route at a path a request never reaches it on.                                                                                  |
| [`PLUGIN_SCHEMA_BEHIND`](https://nextlyhq.com/docs/cli/errors/plugin-schema-behind.md)                                       | In production, a plugin expects a schema version its applied migrations have not reached.                                                                        |
| [`PLUGIN_SCHEMA_UNINSTALLED`](https://nextlyhq.com/docs/cli/errors/plugin-schema-uninstalled.md)                             | A plugin that has been uninstalled is still listed in the configuration.                                                                                         |
| [`PLUGIN_SCHEMA_VERSION_MISSING`](https://nextlyhq.com/docs/cli/errors/plugin-schema-version-missing.md)                     | The plugin given to `--plugin` declares no `schemaVersion`, which its migrations are numbered by.                                                                |
| [`PLUGIN_SCHEMA_VERSION_NOT_ADVANCED`](https://nextlyhq.com/docs/cli/errors/plugin-schema-version-not-advanced.md)           | A plugin's declared `schemaVersion` does not move past the one on its last migration.                                                                            |
| [`PLUGIN_SETUP_FAILED`](https://nextlyhq.com/docs/cli/errors/plugin-setup-failed.md)                                         | A plugin's `setup` function threw while the configuration was loading.                                                                                           |
| [`PLUGIN_TABLES_NOT_MIGRATED`](https://nextlyhq.com/docs/cli/errors/plugin-tables-not-migrated.md)                           | A plugin's tables were created by a development push, so no applied migration can undo them.                                                                     |
| [`PLUGIN_TABLE_IDENTITY_UNREADABLE`](https://nextlyhq.com/docs/cli/errors/plugin-table-identity-unreadable.md)               | The database could not report the identity of a table a full uninstall drops, so the uninstall could not check its hook left it in place.                        |
| [`PLUGIN_UNINSTALL_IRREVERSIBLE`](https://nextlyhq.com/docs/cli/errors/plugin-uninstall-irreversible.md)                     | A full uninstall was asked of a plugin with a migration that has no DOWN to undo it.                                                                             |
| [`PLUGIN_UNINSTALL_KEEP_DATA_MISMATCH`](https://nextlyhq.com/docs/cli/errors/plugin-uninstall-keep-data-mismatch.md)         | An unfinished uninstall was run again with the other `--keep-data` setting than the one it began with.                                                           |
| [`PLUGIN_UNINSTALL_UNCONFIRMED`](https://nextlyhq.com/docs/cli/errors/plugin-uninstall-unconfirmed.md)                       | A full plugin uninstall would delete data, and the deletion was not confirmed or consented to, so nothing changed.                                               |
| [`PLUGIN_UNINSTALL_UNFINISHED`](https://nextlyhq.com/docs/cli/errors/plugin-uninstall-unfinished.md)                         | A configured plugin's uninstall began and did not finish, so the app does not start with it.                                                                     |
| [`PLUGIN_WIDGET_SOURCE_COLLISION`](https://nextlyhq.com/docs/cli/errors/plugin-widget-source-collision.md)                   | Two plugins contribute a widget source with the same id.                                                                                                         |
| [`PLUGIN_WIDGET_SOURCE_INVALID`](https://nextlyhq.com/docs/cli/errors/plugin-widget-source-invalid.md)                       | A plugin contributes a widget source with no id, or without the resolver functions a source needs.                                                               |
| [`PLUGIN_WIDGET_SOURCE_KIND`](https://nextlyhq.com/docs/cli/errors/plugin-widget-source-kind.md)                             | A plugin contributes a widget source of a kind the dashboard does not draw.                                                                                      |
| [`PLUGIN_WIDGET_SOURCE_NAMESPACE`](https://nextlyhq.com/docs/cli/errors/plugin-widget-source-namespace.md)                   | A plugin contributes a widget source whose id is not in the plugin's own namespace.                                                                              |
| [`PLUGIN_WIDGET_SOURCE_RESERVED`](https://nextlyhq.com/docs/cli/errors/plugin-widget-source-reserved.md)                     | A plugin contributes a widget source in a namespace Nextly reserves.                                                                                             |
| [`POSTGRES_SCHEMA_INVALID`](https://nextlyhq.com/docs/cli/errors/postgres-schema-invalid.md)                                 | `db.postgres.schema` is not a name PostgreSQL can use for a schema.                                                                                              |
| [`POSTGRES_SCHEMA_MISMATCH`](https://nextlyhq.com/docs/cli/errors/postgres-schema-mismatch.md)                               | `db.postgres.schema` and the database adapter's schema option name different PostgreSQL schemas.                                                                 |
| [`POSTGRES_SCHEMA_UNSUPPORTED`](https://nextlyhq.com/docs/cli/errors/postgres-schema-unsupported.md)                         | `db.postgres.schema` names a PostgreSQL schema other than `public`, which Nextly cannot create its tables in yet.                                                |
| [`PRODUCTION_ROLLBACK_UNCONFIRMED`](https://nextlyhq.com/docs/cli/errors/production-rollback-unconfirmed.md)                 | `nextly migrate:down` was run with `NODE_ENV=production` and without `--yes`.                                                                                    |
| [`PROJECT_ALREADY_INITIALIZED`](https://nextlyhq.com/docs/cli/errors/project-already-initialized.md)                         | The folder already has a `nextly.config.ts`, so `nextly init` did not overwrite it.                                                                              |
| [`PROMOTE_COLLECTION_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/promote-collection-not-found.md)                       | `db:sync --promote` names a collection the Schema Builder has no record of.                                                                                      |
| [`REFUSED_STATEMENT`](https://nextlyhq.com/docs/cli/errors/refused-statement.md)                                             | A migration holds a statement the runner refuses to run where it is, so nothing in it ran.                                                                       |
| [`RESOLVE_FILE_NOT_FOUND`](https://nextlyhq.com/docs/cli/errors/resolve-file-not-found.md)                                   | The migration file named to `nextly migrate:resolve` is not in the migrations folder.                                                                            |
| [`RESOLVE_LOCK_RELEASED`](https://nextlyhq.com/docs/cli/errors/resolve-lock-released.md)                                     | The schema lock was released before `nextly migrate:resolve` changed the migration's record, so nothing was written.                                             |
| [`RESOLVE_MODE_REQUIRED`](https://nextlyhq.com/docs/cli/errors/resolve-mode-required.md)                                     | `nextly migrate:resolve` was given none, or more than one, of `--applied`, `--rolled-back` and `--failed-cleanup`.                                               |
| [`RESOLVE_NOTHING_TO_CLEAN_UP`](https://nextlyhq.com/docs/cli/errors/resolve-nothing-to-clean-up.md)                         | `nextly migrate:resolve --failed-cleanup` was given a migration with no failed or unfinished attempt.                                                            |
| [`RESOLVE_NOT_APPLIED`](https://nextlyhq.com/docs/cli/errors/resolve-not-applied.md)                                         | `nextly migrate:resolve --rolled-back` was given a migration with no applied run to roll back.                                                                   |
| [`RESOLVE_PLUGIN_MODULE`](https://nextlyhq.com/docs/cli/errors/resolve-plugin-module.md)                                     | `nextly migrate:resolve --applied` was given a plugin module, which `nextly migrate` records itself.                                                             |
| [`RESOLVE_SCHEMA_MISMATCH`](https://nextlyhq.com/docs/cli/errors/resolve-schema-mismatch.md)                                 | `nextly migrate:resolve --applied` found the live schema does not match the migration's snapshot.                                                                |
| [`SCHEMA_DRIFT`](https://nextlyhq.com/docs/cli/errors/schema-drift.md)                                                       | The configuration has schema changes that no migration file holds yet.                                                                                           |
| [`SCHEMA_LOCK_LOST`](https://nextlyhq.com/docs/cli/errors/schema-lock-lost.md)                                               | Another run took the schema lock while the command still held it, so the two may have changed the schema at once.                                                |
| [`SCHEMA_LOCK_UNAVAILABLE`](https://nextlyhq.com/docs/cli/errors/schema-lock-unavailable.md)                                 | The schema lock's row could not be established, so the command refused to run without it.                                                                        |
| [`SCHEMA_SYNC_IN_PRODUCTION`](https://nextlyhq.com/docs/cli/errors/schema-sync-in-production.md)                             | `NODE_ENV` is `production`, where schema changes are applied by migrations and never synced automatically.                                                       |
| [`SETTINGS_CHANGE_WITHOUT_MIGRATION`](https://nextlyhq.com/docs/cli/errors/settings-change-without-migration.md)             | An entity's settings changed in the configuration, and no migration records the change.                                                                          |
| [`SETUP_ALREADY_COMPLETE`](https://nextlyhq.com/docs/cli/errors/setup-already-complete.md)                                   | This install already has an administrator, so setup is complete and the command changed nothing.                                                                 |
| [`SETUP_IN_PROGRESS`](https://nextlyhq.com/docs/cli/errors/setup-in-progress.md)                                             | Another setup holds this install's setup claim, so the command changed nothing.                                                                                  |
| [`SETUP_TOKEN_SET_BY_ENV`](https://nextlyhq.com/docs/cli/errors/setup-token-set-by-env.md)                                   | `NEXTLY_SETUP_TOKEN` sets this install's setup token, so there is no generated one to replace.                                                                   |
| [`UI_SCHEMA_INVALID`](https://nextlyhq.com/docs/cli/errors/ui-schema-invalid.md)                                             | The Schema Builder's `ui-schema.json` holds an entry the manifest's schema rejects.                                                                              |
| [`UI_SCHEMA_NOT_JSON`](https://nextlyhq.com/docs/cli/errors/ui-schema-not-json.md)                                           | The Schema Builder's `ui-schema.json` is not valid JSON.                                                                                                         |
| [`UI_SCHEMA_UNREADABLE`](https://nextlyhq.com/docs/cli/errors/ui-schema-unreadable.md)                                       | The Schema Builder's `ui-schema.json` exists but could not be read.                                                                                              |
| [`UNEXPECTED_ERROR`](https://nextlyhq.com/docs/cli/errors/unexpected-error.md)                                               | The command stopped on an error that no other code describes.                                                                                                    |
| [`UPGRADE_BACKUP_NOT_CONFIRMED`](https://nextlyhq.com/docs/cli/errors/upgrade-backup-not-confirmed.md)                       | `nextly upgrade` would change the database, and no backup was confirmed, with no terminal attached to ask.                                                       |
| [`UPGRADE_CANCELLED`](https://nextlyhq.com/docs/cli/errors/upgrade-cancelled.md)                                             | The backup prompt of `nextly upgrade` was answered no, so the upgrade did not run.                                                                               |
| [`UPGRADE_EVENTS_TABLE_TAKEN`](https://nextlyhq.com/docs/cli/errors/upgrade-events-table-taken.md)                           | A table of another shape already has the name `nextly upgrade` moves the migration records into.                                                                 |
| [`WORKFLOW_CANNOT_ATTACH`](https://nextlyhq.com/docs/cli/errors/workflow-cannot-attach.md)                                   | A workflow in the configuration is attached to a collection or Single it cannot run on.                                                                          |
