sow status
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
| 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:
| 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 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
sow build— build pending repository changessow check— verify the files before deliverysow log— inspect the operation reported here- Transactions & Recovery — state transitions and recovery