Meridian handbook
Reference

Exit codes

The five exit codes every engine-dmo and engine-cms command uses (0 success, 1 error, 2 pending or unconfirmed, 3 invalid configuration, 4 degraded), and which commands return 2 and 4 and why.

Every command exits with one of five codes, so a script or CI step can act on the result without parsing output. Under --json the code is also in the output (the envelope’s exit).

CodeNameMeaning
0SuccessThe command did what it was asked, or there was nothing to do
1ErrorIt failed: a database it could not reach, a file it could not write, a refusal that is not about confirmation
2PendingChanges are pending, or the command refused for want of confirmation
3InvalidThe configuration is invalid, or a flag’s value cannot be used
4DegradedIt ran, and something it depends on is not answering
engine-dmo migrate status
case $? in
  0) echo "up to date" ;;
  2) engine-dmo migrate up ;;
  *) exit 1 ;;
esac

Exit 2: pending or unconfirmed

CommandExits 2 when
migrate statusAny migration is pending
schema planThe configuration differs from the database
schema applyThe plan is destructive and not approved; an id in the files replaces a stored one not named by --replace; the plan holds a change this engine cannot apply yet; or a destructive plan was not confirmed on the terminal
serveMigrations are pending (and migrate.on_boot is refuse), or the configuration has drifted (and schema.on_drift is refuse)
dev authoring verbs with --applyThe resulting plan is destructive: review it and run schema apply
search rebuildA rebuild, purge or check is already running, or held by another worker
search verifyThe index has drifted from what is published
ai test, crm dedupeThe AI budget is spent
seed reset, user reset-mfa, mail suppression remove, content purge, site retire, crm erase, newsletter send, broadcast send and similarThe confirming flag (--confirm or --yes) is missing

Exit 3: invalid

check, config validate, serve and every command that loads the project exit 3 when the configuration or a template is invalid, after printing every problem with its file, line and column. Several commands also exit 3 for a flag value they cannot use (an address that is not loopback for docs serve, an AI command with no provider configured, a sar address or --out it cannot use). audit verify exits 3 when nothing is chained, and 1 on a break in the chain.

Unknown commands and flags exit 1

help --json describes exit 3 as “configuration invalid, or a bad invocation”, but an unknown command, an unknown flag or a missing required flag exits 1 in this release. Treat any non-zero code other than 2 and 4 as a failure.

Exit 4: degraded

CommandExits 4 when
healthThe server did not answer 200 (within --wait, when given)
jobs list, jobs retryThe database does not answer
search status, search test, search verifyThe search backend does not answer
ai status, ai testThe AI provider does not answer; the AI features are unavailable and nothing else is affected
analytics report --format pdfThe PDF could not be rendered
crm dedupeThe AI provider behind duplicate detection is not answering (exit 2 when the AI budget is spent)
  • CLI: every command.
  • Error codes: the MRD-nnnn code a refusal carries.