Skip to content

sow status

Check from recorded state whether a repository needs a build, holds pending data, or is locked.

sow status tells you whether a repository needs a build, how much data waits in the pending area, and whether a writer holds the lock. It reads only recorded state and never hashes package files, so it is cheap enough to run before every build or from a monitoring loop. To verify the files themselves, use sow check.

Synopsis

sow status [-C|--workdir DIR] [-r|--repo NAME] [-d|--dist NAME]... [--json]
Flag Meaning Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
-d, --dist NAME Report dirty and readiness state for these Dists only; repeatable all Dists
--json Output JSON false

Output

After an add --skip, the repository has a change that is not built yet:

sow status
repository=demo status=dirty ready_to_copy=false revision=2 generation=3 dirty_dists=el9 pending=1/23516 locked=false
Field Meaning
status Repository state; see repository states
ready_to_copy true when the recorded state is deliverable; check still has to verify the files
revision Desired revision, which increases with every change to desired state
generation Current Generation (the last completed build)
dirty_dists Dists whose desired and built state differ; empty when clean
pending Count and bytes of packages waiting in the private pending area
locked Whether a writer holds the repository lock

--json adds dirty_reasons, which explains a false ready_to_copy, and the most recent operation. The result object for the same state:

{
  "repository": "demo",
  "status": "dirty",
  "ready_to_copy": false,
  "desired_revision": 2,
  "built_generation": "00000000000000000003",
  "dirty_dists": ["el9"],
  "dirty_reasons": [
    "dist el9 Desired and Built membership sets differ",
    "one or more dists differ from their built projections"
  ],
  "pending": {"count": 1, "bytes": 23516},
  "recent_operation": {
    "id": "8690093128362517253",
    "kind": "add",
    "state": "done_dirty",
    "created_at": "2026-11-27T08:36:31.271314Z",
    "updated_at": "2026-11-27T08:36:31.561629Z"
  },
  "repository_locked": false
}

Repository states

SOW records the package set you asked for as desired state, and each completed build as a Generation whose contents are the built state. status compares the two:

State Meaning Next step
clean Desired state matches built state Run check before copying the repository
dirty Desired and built state differ, commonly after --skip or a config change Run build to apply the changes
recovering A local repository operation was interrupted Run build to recover it
error State, files, or recovery records need attention Read dirty_reasons, then run check and log

Exit behavior

status exits 0 for every readable state, including dirty, recovering, and error. Scripts should read the reported state rather than treat those conditions as command failures.

Code Trigger
0 Repository state is readable
1 Runtime I/O failure
2 Usage error, workspace not found, or implicit repository selection is ambiguous
5 State database unreadable or inconsistent
6 Explicit repository or Dist is not configured

Details

Unfinished operations

An unfinished maintenance operation makes the affected Dists dirty even when their desired and built membership match; dist ls and dist show report the same condition. Read dirty_reasons and the pending operation, then run the recovery command it names. SOW finds the unfinished operation by its pending state, not by timestamp order, so a clock step cannot hide it behind an older completed record.

Reading older workspaces

status never migrates or repairs state. It reads database schemas v6, v12, and the current v13; unsupported or unreadable state exits 5. Before writing to an older workspace, back it up and run sow repo migrate for each repository.

See also

Table reader