Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

Reference

Look up sow.yml fields, package references, file paths, exit codes, JSON fields, platform support, and fixes for common errors.

These pages hold the exact facts that the tutorials and feature pages summarize: every sow.yml field and its default, every path SOW writes, every exit code and JSON field a script can rely on, and what to do when a command fails. Come here when you need a precise answer rather than an explanation. For a command’s flags and output, see Commands or run sow help COMMAND.

Example conventions

Command blocks omit the shell prompt so you can copy them. In syntax descriptions, uppercase words such as NAME and DIR are placeholders, square brackets mark optional arguments, ... marks a repeatable argument, and | separates alternatives.

Paths, IDs, hashes, timestamps, and counts in sample output depend on the workspace. Treat operation and Generation IDs as strings; see JSON output.

1 - Troubleshooting

Match an error message, status value, exit code, or client failure to its cause and the commands that fix it.

Find what you are seeing in the table below and jump to its section; each one names the likely cause and the commands that fix it. The examples use /srv/sow for the workspace, pgsql for the repository, and prod for the publication target; replace them with yours.

Collect the state before changing anything. status says whether the repository is clean, dirty, recovering, or in error; log shows recent operations and which one failed. Error messages keep SOW’s internal names: most errors from workspace commands (those that work on standard repositories) carry managed: after the error category, as in operation rejected: managed: operation rejected: …, and errors from create and prune, which work on simple repositories, start with plain:.

sow version
sow status -C /srv/sow -r pgsql
sow log -C /srv/sow -r pgsql
What you see Go to
configuration error, or config check exits 2 or 6 The configuration is rejected
status shows dirty; check exits 5 without naming a damaged file Status shows pending changes
status shows recovering, a command exited 130, or a process was killed A command was interrupted
A nonzero exit, but the output lists committed packages or a new Generation Errors after a committed change
publish says the target is already bound Target configuration changed
Exit 5 with a target publication must roll forward, write-active publication attempt, or unfinished ... report Publication and target GC wait for each other
Exit 6 with mutation would withdraw published pointer A change would withdraw a published file
A write command hangs, or exits 4 A command waits for a lock
A password prompt, signing credential is unavailable, or a key unusable for signing A signing key asks for a password or cannot unlock
add, build, or check rejects a package file, signature, or path Other validation failures
dnf, yum, or apt cannot sync, install, or sees old content Client errors
repository schema migration required, or trouble right after an upgrade After upgrading

The configuration is rejected

Every workspace command reads sow.yml first, so one mistake there stops all of them. Run the check alone to see the first problem and the field it names:

sow config check -C /srv/sow

Exit 2 means the file itself is invalid: a YAML error, an unknown field (often a typo or wrong indentation), a bad name, or a value outside its rule. Exit 6 means the file is valid but contradicts recorded state or cannot resolve a signing key. The usual cause is a repository or Dist deleted from the file by hand, or an architecture removed while packages or built Generations still use it. Put the entry back; remove a repository or Dist with sow repo rm or sow dist rm instead. A changed Dist format exits 5; a Dist’s format is fixed once it exists. The configuration reference lists every field’s rule.

Status shows pending changes

status reports dirty and lists dirty_dists, and check exits 5 although nothing is damaged. add --skip, rm --skip, or a configuration edit committed a desired state that has not been built yet. Clients still get the last built indexes, which are consistent but are not what you declared. Build and check:

sow build -C /srv/sow -r pgsql
sow check -C /srv/sow -r pgsql

A local build updates the workspace only. To update a configured target as well, run sow publish prod -C /srv/sow. See sow status for each field.

A command was interrupted

A command exited 130, was killed, or lost power, and status may show recovering. A standard repository journals each change before applying it, so an interrupted operation stays pending until a later command finishes it or rolls it back. First fix whatever the diagnostic reports (a full disk, a missing input, unreachable storage), then run the command that recovers that operation:

Interrupted Run
sow create (simple repository) The same command, with the same --pigsty, --metadata-timestamp, and signing options
sow prune (simple repository) The same command, with the same --protect and --metadata-timestamp options
add, rm, a Dist change, or build sow build -C /srv/sow -r pgsql; committed desired-state changes stay part of the pending build
init, repo new, or repo rm The same lifecycle command again
Local gc or retain rm sow gc or sow retain rm GENERATION again
R2 target deletion sow gc prod --delete
publish sow publish prod, described below

If recovery has to sign metadata with a protected key, supply the password again: journals never store it. Use --passfile PATH or SOW_GPG_PASSFILE on the recovery command; per-key passfile settings still apply. Do not edit sow.yml while an init, repo new, or repo rm is pending, because recovery compares the file with the journal and stops with an integrity error if it matches neither the old nor the new version. See Password files.

For an interrupted publication, restore access to the storage and the public endpoint, then run the same target again. SOW resumes the saved attempt rather than starting over:

sow publish prod -C /srv/sow

Before the attempt records its commit intent, you can abandon it with sow publish prod --abort -C /srv/sow. After commit intent, only rerunning publish finishes it, and --abort exits 6, as it does when there is no attempt to abandon. Until the publication finishes, local changes and target GC wait for it; see Publication and target GC wait for each other, publish, and Transactions and recovery.

Errors after a committed change

A command exits nonzero, yet its output lists accepted packages or a new Generation. Database commit and the maintenance that follows (a checkpoint, a cleanup) are separate steps, so the second can fail after the first succeeded. SOW reports the committed items as committed, not rolled back. Read the result and sow status, inspect the operation with sow log, and run the command the diagnostic names. Keep the original input files until you have confirmed the result.

Target configuration changed

sow publish exits 1 with one of these messages:

  • already bound with different mutable configuration; rerun publish with --rebind after operator review
  • already bound to different storage or prefix; configure a new target name

The first publish recorded the target’s binding, and sow.yml no longer matches it. Compare the file with what you intended. If you meant to change the target name, public_endpoint, or max_cache_ttl, accept the change:

sow publish prod --rebind -C /srv/sow

A different repository, provider, endpoint, region, bucket, or prefix cannot be rebound; configure a new target under a new name. Finish pending target maintenance before changing the TTL. See Changing a target.

Publication and target GC wait for each other

A publication works from a frozen plan of the local tree, and publication and target GC both change what the target holds. So an unfinished publication blocks local changes and target GC, and an unfinished target GC report blocks publication. Each case exits 5 and names the command that finishes the pending work:

Message Reported by Run
a target publication must roll forward before Repository bytes can change add, rm, build, dist new/rm, repo rm, init sow publish prod, or sow publish prod --abort before commit intent
target "prod" has write-active publication attempt ... gc prod sow publish prod, or --abort before commit intent
target "prod" has an unfinished candidate report; resume with gc prod publish prod sow gc prod
target "prod" has an unfinished conditional-delete report; resume with gc prod --delete gc prod (R2) sow gc prod --delete

Then rerun the command that was blocked.

A change would withdraw a published file

dist rm, or a build that would remove a published RPM architecture view or metadata signature, exits 6 with mutation would withdraw published pointer "dists/..." from configured target "prod". The target’s published Generation protects the paths of repository entry points and their signature companions. Content-addressed indexes can rotate normally. To go ahead, first retire the target (remove it from sow.yml) or move it to a new target and prefix, then repeat the change. To undo instead, restore the previous settings; the repository returns to its built state.

A command waits for a lock

A write command hangs, or exits 4 when run with --no-wait or --timeout. Another SOW process holds the workspace or repository write lock, and writers wait without a limit by default. sow status reports locked=true without waiting for that writer. Let the other command finish, or stop it through its normal process controls, then retry.

In scripts, use --no-wait (-N) to return at once or --timeout 30s (-T 30s) to bound the wait. These options apply to write commands only, not to init or read commands. A read that needs a consistent snapshot waits for the writer until you cancel it.

Leave the lock files in place: SOW coordinates processes through their fixed paths. If a populated workspace has lost .sow/workspace.lock:

  1. Stop every SOW process and scheduled job for the workspace.
  2. As the workspace owner, exclusively create an empty .sow/workspace.lock with mode 0600.
  3. Run sow init /srv/sow, then restart the jobs.

See Transactions and recovery for the lock model.

A package, signature, or path fails validation

A signing key asks for a password or cannot unlock

Signing prompts for a password, or fails with signing credential is unavailable, passfile ... is empty, or a metadata key that is unusable for signing. The last one is also what a wrong or missing password for an encrypted key file looks like. SOW takes the password from --passfile PATH, then the key’s passfile, then SOW_GPG_PASSFILE; check the source that actually applies:

  • Path. Command-line and environment paths are relative to the process working directory, regardless of -C; sow.yml paths are relative to the workspace root. An empty SOW_GPG_PASSFILE is an error, not the same as an unset one.
  • Content. One nonempty line; an optional UTF-8 BOM and one final LF or CRLF are removed, and spaces and tabs count. It is not a shell script or a NAME=value line. Regular files, symlinks, and named pipes (with a 2-second writer deadline) work.
  • No fallback. A broken selected source fails without trying another one or prompting. External GPG needs an agent that allows loopback mode, and a hardware key can still ask for its own confirmation.
  • Simple repositories. sow create signs only with --sign-with; the environment variable alone does not enable signing.

config check unlocks metadata keys and probes external GPG metadata signing, so it catches a wrong metadata password. For RPM package keys it checks only format, tools, and key availability; confirm the password with a real package-signing build. check verifies public signatures and never reads passwords. The full contract is in Password files.

Other validation failures

Use the file and check stage named in the error:

Error Cause and fix
Same pool path, different bytes A different package already uses this file name. Compare the two; give changed content a new version and file name. Moving the file to another input directory does not change its pool URL.
File name differs only by case Case aliases cannot create a second pool URL. Use the spelling already recorded.
Missing or altered pool file Restore the original bytes from a matching backup, then rerun sow check.
Signing key unavailable Check the configured key, secret-key access, the GPG agent, and the key’s validity, then rebuild.
RPM does not match the trust policy Check the package signature against key and trusted_keys. See Sign your repository.

sow check reports integrity errors but never rewrites damaged data. Keep the reported path and operation ID while you investigate. Repository layout shows which files belong to the pool, the generated indexes, and private state.

Client errors

What the client does Cause and fix
Gets old content or 404s from the public URL Check the HTTP root, URL prefix, cache settings, and max_cache_ttl, then publish again.
dnf reposync refuses the package locations A standard repository’s RPM views point to ../../../pool/, outside the directory reposync allows. Generate a self-contained copy with sow export rpm-leaf.
EL7 yum keeps the old package list after you switch generators EL7 compares metadata timestamps with its cache. Use a new repository ID or clear its cache; see Existing EL7 caches.
Modular packages are filtered, or dnf module install fails SOW writes no module metadata. Set module_hotfixes=1 for ordinary installs, or keep a tool that provides modules; see XML and SQLite RPM metadata.
A tool requires primary_db SOW writes XML metadata only. YUM falls back to XML; other tools need an XML input or a conversion.

Test the actual client configuration before switching hosts; Serve and publish has client setup for both formats.

After upgrading

These problems come only from workspaces created by older SOW releases. Follow the upgrade guide first; it covers backups and the max_cache_ttl: 0s review.

The database needs migration

Repositories created by 0.5.0 through 0.8.0 already use the same schema v13 as 0.9.0. Releases 0.2.0, 0.3.0, and 0.4.0 created schemas v8, v10, and v12 respectively. All three need migration. In 0.9.0, sow status can inspect v12 and returns 5 for v8 or v10. On all three schemas, sow build and sow init exit 6 and ask for migration.

Stop all writers and back up the complete workspace with hard links preserved. Then run the following commands for each repository.

sow repo migrate pgsql -C /srv/sow
sow build -C /srv/sow -r pgsql
sow check -C /srv/sow -r pgsql

Leftovers from older releases

  • Interrupted 0.7.1 local GC plan with an empty manifest array: run sow gc again; 0.9.0 resumes it directly.
  • Invalid transition control target after a build, in a repository migrated from C2 layout by SOW 0.5 or 0.6: current releases recover this automatically.
  • Leftover C2 migration stage files block local GC: rerun sow repo migrate pgsql -C /srv/sow. Files that SOW cannot prove safe to delete are kept under .sow/pgsql/abandoned/ and their location is reported; inspect them before you remove them.

2 - sow.yml Reference

Every sow.yml field with its default and validation rule, plus key references, the password-file contract, and publication targets.

sow.yml is the configuration file of a workspace, the directory that holds your standard repositories. It declares which repositories exist, which Dists each one serves and with what package policy, how indexes and packages are signed, and where builds are published. Look here when you edit the file by hand or need the exact default or validation rule for a field. A simple repository has no configuration file: sow create and sow prune never read it.

Complete example

This file uses every section. Comments give the default that applies when a field is omitted. Only schema and each Dist’s format are required: schema: sow/v3 alone is a valid, empty workspace.

schema: sow/v3                         # required
architectures: [x86_64, aarch64]       # default; amd64 and arm64 are accepted aliases

repos:
  pgsql:                               # public tree at <workspace>/pgsql/
    protected: true                    # refuse `sow repo rm`; default false
    signing:                           # omit for unsigned indexes and untouched packages
      rpm:
        packages:                      # sign RPM files with the host rpm and GPG
          mode: fill                   # default: fill with a key, never without
          key: agent://7F721C4AD40F4A9D8CA578BFAC7E4690B50CCF3B
          passfile: /run/secrets/rpm-password
          trusted_keys: [keys/upstream.asc]
        metadata:                      # writes repodata/repomd.xml.asc
          key: keys/repo-signing.asc
          passfile: /run/secrets/gpg-password
      deb:
        metadata:                      # writes InRelease and Release.gpg
          key: keys/repo-signing.asc
          passfile: /run/secrets/gpg-password
    dists:
      el9:
        format: rpm                    # required: rpm or deb; fixed after creation
        limit: 2                       # newest versions kept; default 0 keeps all
        exclude:
          - kind: [debuginfo, debugsource, llvmjit]
      el10:
        format: rpm
        architectures: [x86_64]        # default: the workspace list
      bookworm:
        format: deb
        exclude:
          - kind: [dbgsym, dbg]
          - name: ["*-experimental"]
            arch: [aarch64]

targets:
  mirror:                              # copy to a local directory
    repository: pgsql
    provider: filesystem
    endpoint: file:///srv/www          # must already exist
    prefix: pgsql
    public_endpoint: https://repo.example.com/pgsql/
    max_cache_ttl: 5m
  cdn:                                 # upload to Cloudflare R2
    repository: pgsql
    provider: r2
    endpoint: https://0123456789abcdef.r2.cloudflarestorage.com
    bucket: packages                   # region defaults to auto
    prefix: pgsql
    credential: env://SOW_R2_CREDENTIAL
    public_endpoint: https://cdn.example.com/pgsql/
    max_cache_ttl: 24h

Check the file after every edit, then look at what SOW will actually use:

sow config check
sow config show -r pgsql

config check parses the file, compares it with the recorded state of each repository, and resolves every signing reference. It exits 0 when the file is usable, and otherwise:

  • 2: the file itself is invalid, such as a YAML error, an unknown field, a bad name, or a value outside its rule.
  • 6: the file is valid but cannot be applied. A signing reference does not resolve, the file drops a repository or Dist that already has state, or it drops an architecture that members or built Generations still use.
  • 5: a Dist’s format differs from the one it was created with.

config show prints the effective configuration with every default filled in and the resolved key fingerprints added. In a workspace with several repositories, select one with -r, or print the whole workspace with --all.

File rules

  • The file is one YAML document with schema: sow/v3. Unknown fields, duplicate keys, and a second document are errors.
  • It is named sow.yml or sow.yaml and sits at the workspace root as a regular file of at most 16 MiB. Reads follow a symlink to a regular file; sow init creates sow.yml and refuses a symlink. Having both sow.yml and sow.yaml as regular files is an error. With sow.yml, a repository directory named sow.yaml is allowed.
  • sow init, repo new/rm, and dist new/rm edit the file as part of their work. Policy, signing, and target settings are yours to edit. SOW applies defaults when it reads the file and never writes them back.
  • A repository or Dist you add by hand is only declared. Run sow init to create its state, or use sow repo new and sow dist new, which do both. To remove one, use sow repo rm or sow dist rm; deleting it from the file instead fails config check with exit 6, because its state still exists.
  • A frozen sow/v2 workspace is readable by config check, repo ls, repo show, dist ls, and dist show until you upgrade it with repo migrate.

Workspace

Field Type Default Meaning
schema string Required Must be sow/v3
architectures string list [x86_64, aarch64] CPU families that Dists in this workspace may build
repos map Empty Repository names and settings
targets map Empty Publication target names and settings

SOW knows two architecture families, x86_64 and aarch64. It accepts amd64 for x86_64 and arm64 for aarch64, and stores the canonical name. A list you write must not be empty or name the same family twice after that normalization. noarch and all are package architectures, not families, so they are rejected here; SOW adds those neutral packages to every view of a Dist on its own.

Repositories

Field Type Default Meaning
protected boolean false Refuses repo rm, even with -f
signing map Unsigned metadata; package mode: never Signing settings
dists map Empty Dist names and settings

protected guards against deleting the whole repository by mistake. It does not block package changes or dist rm. To remove a protected repository, set it to false, run sow config check, then sow repo rm.

Repository, Dist, and target names must match [a-z0-9][a-z0-9._-]* and must not be one of the reserved names ., .., .sow, pool, dists, sow.yml, workspace.lock, workspace-ops, or repo-locks. Each repository needs separate paths for its state directory, database, and SQLite sidecar files. For example, the database of repository db and the state directory of repository db.db would both be .sow/db.db, so the names cannot coexist.

Dists

Field Type Default Meaning
format string Required rpm or deb; cannot change after the Dist is created
architectures string list Workspace list Nonempty subset of the workspace families
limit integer 0 Newest versions to keep per binary package name and canonical architecture; 0 keeps all
exclude rule list Empty Exclusion rules

Adding an architecture marks the Dist dirty. sow build then generates the new view. Removing an architecture is rejected while members or built Generations still reference it. A build also rejects changes that withdraw a protected entry point, such as a published RPM architecture’s repomd.xml. See Published entry points.

limit must be zero or positive. RPM versions compare by epoch-version-release, with a caret snapshot sorting before the next point release (2.0^20250611 < 2.0.1); DEB versions use Debian ordering. Neutral packages (noarch, all) form their own group. limit removes older members when newer ones arrive, and relaxing it later does not bring them back: add their package files again.

Exclusion rules

exclude:
  - kind: [debuginfo, debugsource, dbgsym, dbg, llvmjit]
  - name: ["test-*", "*-experimental"]
    arch: [aarch64]

A package is excluded when any rule matches. A rule matches when all of its fields match, and a field matches when any of its patterns does. In the example, every debug package is excluded, and so is any test-* or *-experimental package built for aarch64. Exclusion runs before limit, over every candidate member of the Dist.

Field Matches
name Binary package name
source Normalized RPM SOURCERPM or DEB Source name
arch x86_64, aarch64, or neutral
kind From the package-name suffix. RPM: debuginfo, debugsource, llvmjit; DEB: dbgsym, dbg; all others: main
format rpm or deb

Patterns are case-sensitive exact strings or shell globs (*, ?, [...]). An empty rule, an empty or untrimmed pattern, a pattern repeated within one field, or an invalid glob is an error. Values are not checked against what packages can contain, so a typo such as kind: [debuginf] is accepted and matches nothing. See Membership policy for how to read the results.

Signing

Signing is configured per repository, in three independent blocks. Leave all three out and SOW publishes unsigned indexes and stores package files exactly as they arrived.

Block Signs Output
signing.rpm.metadata RPM index manifest repodata/repomd.xml.asc
signing.deb.metadata APT release manifest InRelease, Release.gpg
signing.rpm.packages RPM package files Signature embedded in each RPM

DEB package files are never re-signed; APT trusts them through the signed Release. Signing model explains key rotation, package reuse, and client setup.

RPM package settings

rpm.packages field Default Meaning
mode never without a key; fill with a key never, fill, or always
key None Key reference for the signer; required by fill and always
passfile None Password file; requires key
trusted_keys Empty Further public-key references whose signatures fill keeps
Mode Behavior Use when
never Store input bytes unchanged You do not sign packages, or must keep upstream bytes exactly
fill Keep packages whose signature verifies with key or a trusted key; sign the rest You mix upstream-signed packages with your own builds
always Keep packages already signed by key; re-sign every other package Every package must carry your signature

The public half of key is trusted automatically. A reference listed twice in trusted_keys is an error.

Package signing runs the host rpm command on a staged copy, so the private key must already be in the GPG environment that rpm uses. Naming a key file in key identifies the signer; it does not import the private key into that environment.

Metadata settings

rpm.metadata and deb.metadata take the same fields:

Field Default Meaning
key None Key reference; without it the index is unsigned
passfile None Password file; requires key
passphrase None Legacy password reference; requires key; cannot be combined with passfile

Key references

Form Example Resolves to
Path keys/repo.asc OpenPGP key file; a relative path starts at the workspace root
file:// file:///secure/repo.asc OpenPGP key file
env:// env://SOW_METADATA_KEY Variable holding armored key material, a file path, or a GPG key identifier
agent:// agent://7F721C4AD40F4A9D8CA578BFAC7E4690B50CCF3B Key in the local GPG environment

Environment variable names match [A-Za-z_][A-Za-z0-9_]*. A GPG key identifier is a 16-digit key ID or a 40- or 64-digit fingerprint, in either letter case.

A key file holds ASCII-armored or binary OpenPGP data, at most 16 MiB; comment lines outside the armor are tolerated. It can be a regular file or a symlink to one, such as a Kubernetes Secret mount. When SOW has the private key material, it signs metadata itself and supports RSA, EdDSA (Ed25519, Ed448), ECDSA, and DSA keys. When a reference resolves to a GPG key identifier, through agent:// or an environment variable, SOW calls external gpg instead.

A signing key must resolve to exactly one primary key. A trusted_keys file can hold several complete public keys, including consecutive armored blocks; SOW reads the whole bundle and rejects malformed or truncated input rather than silently using the first key.

Password files

A protected private key needs its password at signing time. SOW reads it from a file you name, so the password never appears in sow.yml, in a command line, or in an environment variable value. The same mechanism serves RPM packages, RPM metadata, and APT metadata, for key files and agent:// keys alike.

Which source applies. For each signing key, SOW takes the first source that is set:

  1. --passfile PATH on the command line, for every key the invocation uses.
  2. The key’s own passfile in sow.yml, or its legacy passphrase reference.
  3. SOW_GPG_PASSFILE, a default path for keys without a configured source.
  4. None: unlocking is left to the existing key, GPG, or RPM setup.
sow create ./packages -S 0123456789ABCDEF --passfile /run/secrets/gpg-password
export SOW_GPG_PASSFILE=/run/secrets/gpg-password
sow config check
sow build -r demo

passfile sits next to key under repos.<name>.signing.rpm.packages, signing.rpm.metadata, or signing.deb.metadata; there is no top-level setting. passfile: "" counts as unset. The command-line override does not bypass validation: a metadata key with both passfile and passphrase set is still rejected.

Paths. passfile takes a literal filesystem path, not a URL such as file:// and not a variable name. Paths from the command line or SOW_GPG_PASSFILE are relative to the process working directory, even with -C; paths in sow.yml are relative to the workspace root. SOW does not expand ~ or $VARIABLE in configuration or environment values (your shell expands them in command-line arguments), and it searches no default location. To reuse one file across commands, set SOW_GPG_PASSFILE to an absolute path. An empty SOW_GPG_PASSFILE is an error when it is the selected source and a password is needed; unset the variable instead.

File format. The file contains the password itself:

  • One nonempty line, at most 64 KiB including an optional line ending. An optional UTF-8 BOM is removed.
  • A final newline is optional; exactly one final LF or CRLF is removed.
  • Nothing is trimmed: leading and trailing spaces and tabs belong to the password. Quotes, #, and backslashes are literal; there are no comments, escapes, or NAME=value lines.
  • Rejected: an empty file, an empty line, NUL, a CR or LF inside the password, a bare final CR, and extra blank lines. A password made only of spaces is not empty.
  • The path can be a regular file, a symlink (including a Kubernetes Secret mount), or a named pipe. A pipe writer has two seconds to write the line and close its end.

Keep the file outside the repository and any public document root, normally with mode 0600 in a private directory. SOW does not insist on exactly 0600, so a read-only secret mount with suitable access control also works. Anyone who can read the file can read the password.

When it is read and how it fails. SOW reads the selected source only to sign or to run a signing check. A missing, unreadable, or malformed source fails the command; SOW does not try the next source or open a password prompt. With an explicit source, external GPG runs in batch loopback mode, which the agent must allow; a hardware key that requires a touch or PIN still requires it.

Without any source, an encrypted metadata key file still needs a password reference. External GPG metadata signing can use a key the agent has already unlocked, but runs with pinentry disabled. RPM package signing keeps its usual agent and macro behavior. An unprotected key needs no password file. SOW_GPG_PASSFILE only supplies a password: sow create still needs --sign-with to sign anything.

Commands that accept --passfile. create (with --sign-with), init, config check, repo new/rm/migrate, dist new/rm, add, rm, build, and export rpm-leaf. add --skip can still sign packages, and rm --check can render signed preview metadata. publish, local and target gc, and log prune accept it too, because finishing an interrupted operation can need a signer; recovery selects the source again from the current invocation and configuration. Query commands, config show, and check (which only verifies public signatures) never read password files. retain and prune do not accept --passfile.

What SOW does with the password. It never writes the value to logs, journals, configuration output, repository state, or public files. External GPG metadata signing receives it through a private file descriptor. RPM may call GPG several times per package, so RPM signing writes it to a 0600 file in a private sow-gpg-pass-* directory under $TMPDIR (or /tmp), then overwrites the file with zeros and removes it when the call returns; a process killed by force can leave it behind. If a signing tool fails, SOW reports a diagnostic drawn from at most 4 KiB of its stderr. Changing only a passfile path does not change a signing identity or mark any Dist dirty.

Passphrase references (legacy)

Metadata keys still accept the older passphrase field, as a path, file://, or env:// reference, including with GPG key identifiers. It has the same priority as a per-key passfile: it beats SOW_GPG_PASSFILE and loses to --passfile. Setting both passfile and passphrase on one key is an error. Prefer passfile in new configuration. Switching an existing key from passphrase to passfile can trigger one metadata rebuild, because the recorded configuration identity includes the old reference.

Legacy references keep their byte-oriented rules: at most 64 KiB, nonempty, no NUL; one final LF and then one final CR are removed. In-process signing accepts other bytes in such a password; external GPG requires a single line. Relative legacy file paths resolve from the workspace root, like key files.

Check signing settings

config check exits 2 for a malformed reference and 6 for one that does not resolve or cannot sign. It unlocks metadata key files and checks that they can sign; external GPG metadata keys also sign a probe. A wrong or missing password for an encrypted metadata key is reported as the key being unusable for signing. For RPM package signing, the check covers the password file’s format, the tools, and whether the secret key is available. It signs no package, so it cannot prove the password is correct; that happens when a package first needs signing.

config show adds public identities to the signing settings: key_fingerprint, and for active RPM package signing also key_snapshot_sha256, trusted_key_fingerprints, and trusted_key_snapshot_sha256s. The fingerprint and snapshot arrays are sorted independently, so do not pair them by index. These are output fields only; sow.yml does not accept them.

Publication targets

A target copies one repository’s public tree (pool/ and dists/) to a directory or an R2 bucket, so clients can install from somewhere other than the workspace host. sow publish TARGET uploads packages before the indexes that reference them and verifies the result at public_endpoint.

Field Provider Required Rule
repository Both Yes A repository defined in repos
provider Both Yes filesystem or r2
endpoint Both Yes Filesystem: file:///absolute/path, not /. R2: https://host with no path; http:// only for localhost, 127.0.0.1, or ::1
region R2 No Default auto; letters, digits, and -, 1–64 characters, case-insensitive
bucket R2 Yes DNS-safe name: 1–63 characters of a-z, 0-9, ., -, starting and ending with a letter or digit, no ..
prefix Both No Relative path under the endpoint; empty means the storage root
credential R2 Yes env://NAME or file:///absolute/path
public_endpoint Both Yes URL where SOW verifies published files. R2: http(s)://; filesystem: http(s):// or file://
max_cache_ttl Both Yes Go duration from 0 up, such as 0s, 5m, or 24h
authoritative_workspace Both No Default true; false or null is rejected
single_writer Both No Default true; false or null is rejected
exclusive_write_authority Both No Default true; false or null is rejected

A filesystem target rejects region, bucket, and credential. SOW normalizes what it can: scheme and host case, default ports, a trailing slash on endpoint, the trailing / that public_endpoint always gets, and durations (24h becomes 24h0m0s). The rest must already be canonical:

  • prefix has no leading or trailing /, no empty, ., or .. segment, no backslash, ?, #, or percent-encoded separator, and only visible ASCII characters.
  • endpoint and public_endpoint carry no user name, query, or fragment, and the public_endpoint path has no . or empty segments.
  • A file:// public_endpoint must name the published directory itself, the endpoint path plus prefix; publish rejects any other directory.

Cache lifetime. max_cache_ttl is the longest time a client, proxy, or CDN may keep a published file. Target GC keeps the files a publication superseded for at least that long after the publication, so stale indexes in caches still find their packages. Set it to the longest cache lifetime your HTTP service uses. With 0s, superseded files may become candidates at the next target GC, subject to existing deadlines and live references. R2 reports candidates by default and requires --delete for deletion. The maximum accepted value is Go’s maximum duration minus 24 hours, inclusive.

Ownership. The three authority fields state the assumption target GC depends on: this workspace is the only writer under the target’s prefix. They default to true and cannot be turned off. For the same reason two targets cannot overlap. On the same storage, their prefixes must not be equal or nested, and an empty prefix overlaps everything; two R2 targets with the same endpoint and bucket count as the same storage whatever their region. Filesystem targets must not resolve to the same or nested directories.

Filesystem endpoint. Create the endpoint directory before the first publish. It must be a real directory, not a symlink; SOW creates the prefix below it.

R2 credentials. The variable or file named by credential holds one JSON document:

{"access_key_id":"YOUR_ACCESS_KEY_ID","secret_access_key":"YOUR_SECRET_ACCESS_KEY"}

session_token is also accepted. Unknown fields, trailing data, missing keys, and values over 64 KiB are rejected. A credential file must resolve to a regular file; a symlink to one is accepted. config check validates only the form of the reference; an unset variable or unreadable file shows up when publish or target gc runs, which then exits 5. Credentials never appear in the public tree or in config show.

Published entry points. A configured target protects the paths in its published Generation for repomd.xml, Release, InRelease, Release.gpg, and repomd.xml.asc. Builds can update these files and rotate checksum-named metadata. A change that removes a protected path, such as dropping a published RPM architecture view or disabling its metadata signature, exits 6 with mutation would withdraw published pointer. Retire or move the target binding before withdrawing that path.

Changing a target. The first publish binds the target to its repository, provider, storage identity (endpoint, region, bucket), and prefix. To change the target name, public_endpoint, or max_cache_ttl afterwards, edit the file and accept the change with publish --rebind. The repository, provider, endpoint, region, bucket, and prefix cannot be rebound; configure a new target instead. Pending target maintenance can block a TTL or public_endpoint change until it completes.

Fixed settings

Some things have no field because SOW derives them. A repository always lives at <workspace>/<name>. APT indexes always use the component main. Architecture views follow from Dist configuration and package headers. Generations are kept with retain, not with a count in the file.

See Repository layout for where these paths land and Exit codes for scripting against config check.

3 - Package References

Name a stored package by digest, coordinate, file name, or bare name, and resolve ambiguous or missing matches.

rm, show, and where take a package reference: a string that names one package stored in a standard repository, or every version of a package at once. Look here when a command reports that a reference is ambiguous or matches nothing, or when a script needs a reference that always picks exactly one object. add is different: it takes file or directory paths.

The easiest way to get an exact reference is to copy it from sow ls:

sow ls -r demo -d el9
sow show 'rpm:example-0:1.0-1.x86_64' -r demo

Accepted forms

Form Syntax Matches
SHA-256 sha256:<64 lowercase hex digits> Stored package bytes
RPM coordinate rpm:<name>-<epoch>:<version>-<release>.<arch> Complete RPM identity, including epoch
DEB coordinate deb:<name>=<version>:<arch> Complete DEB identity
File name example-1.0-1.x86_64.rpm Stored package file name
Bare name example Every package with that binary name

Use a coordinate or a full digest in scripts. A file name is a convenience and is not guaranteed to be unique; a bare name deliberately matches several versions. References do not accept paths, globs, regular expressions, or version ranges.

SHA-256. Write all 64 digits in lowercase; an abbreviated or uppercase digest is rejected with exit 6. The digest is of the stored bytes, which RPM package signing can make different from the input file’s digest.

Coordinates. Every component is required, because SOW matches the complete stored coordinate. An RPM coordinate always includes the epoch, 0 when the package has none. A DEB coordinate carries the complete Debian version, with any epoch and revision. The architecture is the package’s own: x86_64, aarch64, or noarch for RPM; amd64, arm64, or all for DEB. The sow.yml aliases do not apply here.

sow where 'rpm:example-0:1.0-1.noarch'
sow where 'deb:example=2:1.0-1:amd64'

Name matching and ambiguity

A bare name can match several versions or architectures. Each command handles that differently:

Command When a bare name matches several packages
rm Removes every match from the selected Dists
show Rejects the reference and lists the candidates
where Requires one package identity, then returns every repository location for it

Preview a name-wide removal before applying it:

sow rm example -r demo -d el9 --check

For show or where, pick a coordinate or digest from the candidate list. where can return several repositories when they hold the same format, coordinate, and SHA-256; if repositories hold different versions or bytes, narrow it with -r or a more specific reference. Every other form must identify one object within a repository. A reference that matches nothing or is ambiguous returns exit 6.

sow prune DIR --protect NAME, used on simple repositories, also takes only an exact binary RPM package name, not a coordinate, digest, or file name.

Search scope

Command Searches Selection
rm Desired membership of the selected Dists in one repository -r; repeatable -d, or an inferred Dist
show Every recorded package object in one repository, including ones no longer in any Dist -r; -d narrows to desired membership of those Dists
where Desired membership in every repository of the workspace Optional -r and -d

Files SOW has not recorded are never query results. If rm cannot infer the Dist and the repository has several, pass -d. Without -r, where -d NAME searches the repositories that have a Dist of that name, and fails if none does.

Coordinate conflicts

Within a repository, one coordinate names at most one content object, so references stay unambiguous. SOW rejects a different package that reuses an existing coordinate instead of silently replacing it, and a changed signature alone counts as different bytes.

With active RPM signing, SOW can reuse an existing signed object when its coordinate, signature-neutral payload, and signing policy all match. Otherwise, publish changed bytes as a new release with a new file name. See Signing model.

Command options are on the rm, show, and where pages.

4 - Repository Layout

Where package files, indexes, private state, and publication output live, and which of them to serve.

Every path SOW reads or writes, in a simple repository and in a workspace of standard repositories. Look here when you configure a web server, write backup or sync rules, or need to find a file that a diagnostic names. For a standard repository, the rule that matters most: serve <workspace>/<repo>/, which holds pool/ and dists/, and keep sow.yml and .sow/ outside the web server’s document root.

Simple repository

  • /srv/offline/
    • example-1.0-1.x86_64.rpm
    • example_1.0-1_amd64.deb
    • repodata/
      • <sha256>-primary.xml.gz
      • <sha256>-filelists.xml.gz
      • <sha256>-other.xml.gz
      • repomd.xml
    • Packages
    • Packages.gz
    • repo_completewith --pigsty

sow create writes indexes next to the packages: RPM metadata only when the directory holds RPMs, DEB metadata only when it holds DEBs. Index entries are relative (a bare file name for RPM, ./<file name> for DEB), so the directory works at any URL. sow prune removes older RPMs from the same directory and rewrites only the RPM index.

SOW also keeps a few private files in a simple repository:

Path Purpose Serve or copy
.sow-plain-stage-*/ Staging while create runs; a later create removes stale ones Exclude
.sow-prune-repo-complete Tracks the completion marker while prune runs Exclude
.sow-plain-rpm-history.json Current and previous RPM metadata references Keep it with a copy you will run create or prune on

The history file is not part of any client index and is not a recovery journal.

Workspace and standard repositories

  • <workspace>/
    • sow.ymlworkspace configuration
    • .sow/private state
      • workspace.lock
      • workspace-ops/
      • repo-locks/<repo>.lock
      • <repo>.db
      • <repo>/
        • abandoned/retained migration stages
        • stage/active staging and retain-remove-* removal plans/tombstones
        • recovery/active local GC plans (<operation-id>/plan.json) and detached payloads
        • retained/retained generation records
        • transitions/
        • pending/
    • <repo>/public repository root
      • pool/
      • dists/
Path under .sow/ Holds
workspace.lock, repo-locks/<repo>.lock Advisory locks; SOW coordinates processes through these fixed paths, so leave them in place
workspace-ops/ Workspace lifecycle journal for init, repo new, and repo rm
<repo>.db Repository database: membership, builds, operation journal, publication state. SQLite WAL and shared-memory sidecar files can sit beside it
<repo>/pending/ New package files waiting for a build to move them into the pool
<repo>/stage/, recovery/, transitions/, abandoned/ Work in progress and recovery material for builds, GC, retain rm, and layout migration
<repo>/retained/ Records of Generations kept with retain

.sow/ and the pending directories are private (0700). Pending package files are 0644, so a build can move them into public paths without changing their mode.

SOW 0.9.0 uses database schema v13 and configuration schema sow/v3 (in sow.yml or sow.yaml); the two version numbers are independent. The database only makes sense together with the private and public files it describes, so back up and restore the workspace as a whole, and do it before repo migrate. Do not edit the schema version or the rebuildable cache by hand.

Package pool

pool/<prefix>/<source>/<filename>

Each repository stores every package once, in its own pool. Every Dist and architecture index points at that one file, so a noarch package shared by five views is still one copy.

source comes from the RPM SOURCERPM or DEB Source field, normalized to a source package name; without one, SOW uses the binary package name. The prefix is the first character in lowercase, except that a source starting with lowercase lib uses its first four characters (or the whole name, if shorter), also in lowercase.

Source Example path
postgresql-18 pool/p/postgresql-18/libpq5_18.3-1_amd64.deb
example pool/e/example/example-1.0-1.x86_64.rpm
libfoo pool/libf/libfoo/libfoo1_1.0-1_amd64.deb

Pool files are immutable. Removing a package from a Dist does not delete its bytes, because built, retained, recovery, and publication records can still reference them; gc deletes them once no record does.

RPM Dist

  • dists/el9/
    • x86_64/repodata/
      • <sha256>-primary.xml.gz
      • <sha256>-filelists.xml.gz
      • <sha256>-other.xml.gz
      • repomd.xml
      • repomd.xml.ascwith metadata signing
    • aarch64/repodata/

Architecture views hold metadata only. Each package location points back to the pool:

<location href="../../../pool/e/example/example-1.0-1.x86_64.rpm"/>

A native package appears in its own architecture’s view; a noarch package appears in every configured view. Older checksum-named metadata files can remain next to the current ones, and repomd.xml selects the active set. For a self-contained directory with local package paths, use export rpm-leaf.

DEB Dist

  • dists/trixie/
    • Release
    • InReleasewith metadata signing
    • Release.gpgwith metadata signing
    • main/
      • binary-amd64/
        • Packages
        • Packages.gz
        • by-hash/SHA256/<digest>
      • binary-arm64/

Packages entries use paths relative to the repository root, such as Filename: pool/e/example/example_1.0-1_amd64.deb. Release lists SHA-256 checksums and sets Acquire-By-Hash: yes. An architecture all package appears in every applicable index.

Publication paths

Both target providers receive the same public layout under the target’s prefix:

  • <prefix>/
    • pool/
    • dists/

An export is different: it has its own package files, metadata, manifest, and a .sow-export.json completion marker. It is a separate delivery artifact, not another standard repository.

Names and case sensitivity

Repository, Dist, and target names become path components, so they follow the naming rules in the configuration reference; the reserved names (.sow, pool, dists, sow.yml, and others) keep them from colliding with the paths above.

SOW rejects a new pool path that differs only in case from an existing one, even with identical bytes. On a case-insensitive filesystem, source directories that differ only in case also conflict. On a case-sensitive filesystem they can coexist, so check for them before you move a repository to a case-insensitive volume.

See Pool and metadata views, Serve and publish, and Platforms and integrations.

5 - Exit Codes

What exit codes 0–6 and 130 mean, what to do next, and how to branch on them in scripts.

Every SOW command exits with one of the codes below, and a code means the same thing in every command. A script can therefore branch on the code and leave the message for humans. Look here when you wrap SOW in a script, or when you need to know whether a nonzero exit left committed work behind.

Code Meaning Next step
0 Success, or nothing to do Read the result; a command with nothing to do can report noop: true
1 Runtime I/O, package parsing, rendering, or another unclassified error Fix the reported input or environment problem, then retry
2 Invalid command line, workspace discovery failure, or invalid configuration Check sow help COMMAND, the selection flags, and sow config check
3 Partial success Read the result to separate committed work from failed items
4 Write lock unavailable Retry later or allow a longer --timeout
5 Integrity or recovery error, or the repository or target is not ready for this operation Inspect status and check; build a dirty repository, or finish the recorded operation the error names
6 Operation rejected Fix the conflict, package reference, architecture, signing setting, or protection setting the error names
130 Interrupted by SIGINT or SIGTERM Run the recovery command for the interrupted operation

Success does not always mean ready

status exits 0 whenever it can report the state, including dirty, recovering, and error. Its ready_to_copy field summarizes that state but does not check bytes. Run check before you deliver a repository:

sow build -r demo
sow check -r demo

A dirty repository can have perfectly consistent old indexes and still fail check with 5, because the desired state has not been built. Build and check again. If the diagnostic instead reports corrupted bytes or conflicting recovery evidence, investigate that first; see Troubleshooting.

Partial success

Code 3 means some work committed and some failed, so neither “retry everything” nor “carry on” is safe without reading the result:

  • add: at least one input was accepted or reused and at least one failed. The JSON result keeps a per-input outcome. A package excluded by policy is not a failure.
  • init: some declared objects were created before a later one failed.
  • prune: an error occurred after it published the filtered index or removed at least one RPM.

Capture both the output and the code before deciding whether to continue:

#!/usr/bin/env bash
set -uo pipefail

sow add ./incoming/ -r demo -d el9 --json > add-result.json
rc=$?
case "$rc" in
  0) ;;
  3) jq '.result.items[] | select(.status == "failed")' add-result.json
     exit 3 ;;
  4) echo 'Repository is busy; retry later.' >&2
     exit 4 ;;
  *) exit "$rc" ;;
esac

sow check -r demo || exit $?
sow publish mirror

The script stops on partial success so you can inspect the failed inputs before anything is published. mirror must be a configured target for demo.

Lock waits and interruption

Write commands wait for their lock without a time limit by default (-T 0). -T 30s waits up to 30 seconds and -N tries once; either returns 4 when the lock stays busy. Combining -N with a nonzero -T is a usage error (2). Read-only commands do not accept these flags. Some of them take shared locks for a consistent snapshot, while status reports writer activity without waiting for the writer.

SOW returns 130 when it handles Ctrl-C or SIGTERM. An internal timeout, such as an upload making no progress, keeps its normal error class instead. Interruption never undoes work that already committed: inspect the state and follow Transactions and recovery to resume.

JSON errors

With --json, stdout carries the result envelope and stderr carries diagnostics. Each entry in the errors array has a class that maps to the exit code:

Code JSON class
1 runtime
2 usage, discovery, or config
3 partial
4 lock
5 integrity
6 rejected
130 interrupted

Branch on the code or class, never on message text. create and prune, the commands for simple repositories, print their underlying error (starting with plain:) to stderr, and their JSON message can carry an extra CLI category prefix. When ok is false, diagnostic and partial results are still present. See JSON output for the envelope.

6 - JSON Output

The sow.cli/v1 envelope, error classes, ID types, and the result fields of every command.

With --json, a SOW command writes one versioned JSON document instead of human-readable text, so a script gets stable field names rather than parsing log lines. Look here for the envelope every response shares, how errors and IDs are typed, and the result fields of each command.

The document is a single newline-terminated line on stdout; diagnostics go to stderr. Successful create and prune runs put their warnings and skipped entries inside the JSON result and leave stderr empty. log export is the exception: it writes JSON Lines and does not accept --json.

sow status -r demo --json | jq '.result.status'

Envelope

Every JSON response has these seven fields:

Field Type Meaning
schema string sow.cli/v1
command string Command name including any subcommand, such as repo ls
ok boolean true on success; false when errors is not empty
repository string or null The selected repository, when the response is tied to one
operation string or null Operation or publication attempt ID, per command (see below)
result object or null Command data, including partial or diagnostic results on failure
errors array Error objects with code, class, and message

A successful configuration check, shown here on several lines:

{
  "schema": "sow.cli/v1",
  "command": "config check",
  "ok": true,
  "repository": null,
  "operation": null,
  "result": {"workspace": "/srv/repo", "repositories": 1, "dists": 2},
  "errors": []
}

A command that fails before doing meaningful work usually returns result: null. Some failures still return a useful result: a failed check, a partially successful add, or a maintenance error after a database commit, which reports what did commit. Keep the result when ok is false, and read it together with status and the operation log before retrying; a nonzero exit does not mean the transaction rolled back.

Errors

{"code":3,"class":"partial","message":"managed: batch partially succeeded"}

Branch on code or class, never on message text. The classes are runtime, usage, discovery, config, partial, lock, integrity, rejected, and interrupted; Exit codes maps them to exit codes and next steps.

Identities

Treat operation and Generation IDs as strings. Operation IDs can exceed the range of integers that JavaScript represents exactly. Generation IDs are 20-digit, zero-padded decimal strings, so they also sort correctly as text:

{"operation":"8632724976452398569","built_generation":"00000000000000000004"}

This applies to generation, built_generation, base_generation, and base when it names a Generation. Desired-state revisions and counts are JSON numbers.

The top-level operation field holds:

Command Value
add, rm without preview, build, local gc, log prune Journal ID, if one was allocated
publish, publish --abort Publication attempt ID, if available
log ID The requested operation ID
Other commands (create, prune, init, config, ls, show, where, retain, export) null

A null operation does not mean the command is read-only. The top-level repository is null for create, prune, init, config check, and repo ls. where sets it when -r/--repo is given and leaves it null when searching every repository; each entry in result.locations names its own repository either way.

Simple repositories: create and prune

sow create returns:

Result field Meaning
dir Absolute path of the indexed directory
rpm, deb Retained RPM and DEB file counts from this scan. Identical copies count separately and share one index entry
kept Sorted file names retained by this scan
removed Files removed by --pigsty
skipped {path, reason} objects for packages skipped in the default fault-tolerant mode, when present
warnings Warning strings from scanning or publication, when present
marker Whether the completion marker was produced
marker_sha256 Marker digest, present with the marker
noop No public file needed to change
recovered Always false; a simple repository has no journal to recover
signed, signer Signed file names and signer identity, when available
dropped_metadata Unsupported repomd.xml data types (such as group, updateinfo, or modules) that create replaced, when present

sow prune returns:

Result field Meaning
dir Target directory path
dry_run Whether --dry-run was set
kept Sorted file names of the top-level RPMs kept
candidates {path, latest} objects: each removal candidate and the RPM that replaces it
removed File names of removed RPMs
skipped {path, reason} objects for RPMs skipped in the default fault-tolerant mode, when present
warnings Warning strings, such as corrupt packages, equal-version conflicts, or unmatched --protect names, when present
index_updated Whether repodata/ was rewritten
marker Whether repo_complete exists after completion
noop Whether a live run made no changes. A preview checks removal candidates and any pending completion marker. It does not predict an index rewrite

Initialization and configuration

Command Result
init workspace, config_created, repositories_initialized, dists_initialized, existing
config check workspace, repositories, dists
config show The effective configuration: schema, architectures, repos, and targets when present

Resolved signing settings can include public key fingerprints and certificate snapshot hashes. The fingerprint and hash arrays are sorted independently; do not pair them by index. See Check signing settings.

Repositories and Dists

repo ls returns result.repositories[]; repo new and repo show return one repository object directly. Its fields are name, path, protected, dists, generation, desired_revision, status, packages, memberships, and config, plus dirty_reasons and recent_operation when available. packages counts stored package objects and memberships counts desired Dist memberships, so one object in two Dists counts as one package and two memberships.

An operation summary has id, kind, state, created_at, and updated_at, plus an optional error_class. status.pending_operation and status.recent_operation use the same shape.

dist ls returns result.dists[]; dist new and dist show return one Dist object with name, format, architectures, desired_members, built_members, generation, dirty, status, effective_config_sha256, config, and an optional dirty_reasons. Each architecture entry has family and ecosystem_arch; a DEB view of family x86_64 has the ecosystem name amd64, for example.

repo rm and dist rm return name, removed, and noop.

repo migrate returns repository, repository_id, from_layout, to_layout, schema_from, schema_to, phase, generation, grace_not_before (null when no grace deadline applies), legacy_aliases, complete, and an optional warnings. Warnings from an aborted migration name retained temporary stages or incomplete cleanup. Once the repository is selected, a failed migration still reports it in the response. See repo migrate for the phases.

add, rm, and build

All three report the repository state after the operation: repository, desired_revision, built_generation, and dirty.

add also returns operation, accepted, failed, memberships_added, memberships_removed, and items[]. Each item has input and status, plus format, coordinate, sha256, a per-Dist dists map, and error when those are known.

Item status Meaning
accepted A new package entered membership
reused An existing package object was reused; membership can still change
excluded Policy kept the package out of every selected Dist
failed The input failed; read error

Each entry of the dists map is accepted, excluded, or limited, so one package can have different outcomes in different Dists. memberships_removed grows when limit pushes older versions out.

rm returns an optional operation, removed[], the selected dists, changes[], and check. Each removed record has dist, sha256, coordinate, and name. A preview has check: true, and only prediction_complete: true means its predicted file list is complete. rm never deletes pool bytes.

build returns operation, the Dists it considered in dists, and noop. A no-op build creates no Generation.

status and check

status returns status, ready_to_copy, desired_revision, built_generation, dirty_dists, dirty_reasons, pending, and repository_locked, plus pending_operation, recent_operation, and lock_holder when they apply. status is clean, dirty, recovering, or error, and pending holds count and bytes. A successful query can report any of those states: ok: true means the query worked, not that the repository is healthy. Run check before publishing or copying.

check returns repository, status, ready_to_copy, built_generation, desired_revision, and layers[]. Each layer has name, ok, checked, and issues. The normal layers, in order, are config, state, public-modes, retained, package-bytes, desired-membership, index, signature, and generation-manifest. During an active layout transition, the first three are followed by layout-transition instead. A repository-wide check can pass every consistency layer and still exit 5 when desired changes need building. With -d, status and check report ready_to_copy for the selected Dists. Omit -d to gate delivery of the entire repository.

changes

The result has repository, base, generation, dirty, and changes[]. Each change contains:

Field Values
op add, update, delete
phase payload, metadata, pointer, delete
path Slash-separated path relative to the repository root
size, sha256 Present for added and updated files; omitted for deletions

changes first runs the same verification as check. It works on a dirty repository, but exits 5 while an operation is pending or the repository is recovering or fails verification.

Without a base, the comparison is against the previous built Generation. Base 0 lists the complete current tree, and a numbered base compares that recorded Generation with the current one. These are local file differences; remote changes are the business of publish and target gc.

Package queries

Command Result fields
ls repository, selected dists, dirty, packages[]
show repository, package
where reference, locations[]

A package object has sha256, format, coordinate, architecture, canonical_arch, pool_path, filename, size, name, source, version, kind, storage, created_revision, dists, and built_dists, plus optional epoch, release, RPM payload_sha256 and signature_key, and warning.

  • architecture is the package’s own name (noarch, amd64, and so on); canonical_arch is x86_64, aarch64, or neutral.
  • storage is pool or pending. It describes the local workspace, not remote publication.
  • dists is the desired membership; built_dists is the membership of the last build.
  • A package object’s coordinate has no format prefix: prepend format and : to get a CLI reference. Coordinates in where locations already include it.

Each where location has repository, dists, built_dists, sha256, and coordinate.

Publication and maintenance

Command Main result fields
publish repository, target, provider, generation, optional attempt/checkpoint, phase, objects, noop
publish --abort repository, target, provider, attempt, phase, objects
retain add/rm repository, record, record_identity, path
retain ls repository, generations[]
Local gc Optional operation, repository, base_generation, generation, objects, bytes, noop
Target gc repository, target, provider, phase, reports, candidates, deleted_objects, deleted_bytes, retained_objects, pending_grace, completed_attempts, noop
export rpm-leaf repository, repository_id, generation, dist, arch, directory, method, signed, signer_identity, packages, files, manifest_sha256

publish --rebind returns the normal publish shape. For R2, the default target GC report and gc TARGET --delete share the target GC fields; the latter records verified removals in deleted_objects and deleted_bytes.

Operation logs

log returns repository and operations[], newest first. log ID returns repository and detail, which holds operation, duration_ms, events, packages, memberships, and files:

Detail array Record fields
events sequence, state, detail_json, occurred_at
packages sequence, input_path, disposition; optional package_sha256, coordinate, error_class, message, dists
memberships sequence, dist, package_sha256, action
files sequence, action, phase, path; optional size, sha256

payload_json, result_json, and event detail_json are strings that contain JSON, so decode them separately. Operations that build metadata record publication_time in payload_json; layout migrations and journals written without a recorded time omit it.

sow log -r demo --json \
  | jq '.result.operations[] | .payload_json | fromjson'

log prune returns operation, repository, before, pruned, and compaction_deferred. A date-only argument is resolved in the machine’s local time zone, and before holds the resolved timestamp.

log export writes one complete operation record per line, without the envelope:

sow log export operations.jsonl -r demo
sow log export - -r demo

The output file must not exist yet. A symlinked parent directory, such as /tmp on macOS, is resolved to its physical path before the file is created atomically and the directory is synced.

Use a validation result in a script

#!/usr/bin/env bash
set -euo pipefail
sow check -r demo --json | jq -e '.ok' >/dev/null
sow changes 0 -r demo --json \
  | jq -r '.result.changes[] | [.phase, .op, .path] | @tsv'

The script fails unless the local repository passes check, then prints its current file manifest. To publish it, run sow publish TARGET for a configured target.

7 - Platforms & Integrations

What SOW runs on, which packages and clients it supports, how that is tested, and what it does not support.

Check this page before you deploy SOW or point a new client at it. The first sections list what is supported: host platforms, workspace filesystems, package inputs, client formats, and publication providers. How it is tested lists the automated checks behind those claims, and Not supported lists the gaps with their workarounds.

Platforms

Operating system amd64 arm64 Release formats
Linux Yes Yes Archive, RPM, DEB
macOS Yes Yes Archive

Release binaries are built with CGO_ENABLED=0 and need no language runtime. An archive contains the sow binary and the Apache-2.0 LICENSE; the Linux packages install /usr/bin/sow and the license. Building from source requires Go 1.27.4 or later. sow version prints the binary’s version, platform, and Go toolchain.

Workspace filesystem

A workspace needs a local POSIX filesystem with advisory locks, fsync, and atomic rename within the filesystem, because every build and recovery depends on them. On macOS, use APFS: SOW refuses to build when the atomic directory exchange it needs is unavailable. Keep the public tree and private staging on the same filesystem.

Serve only <workspace>/<repo>/. That pool/ plus dists/ tree is complete on its own, so you can copy it to other storage without the private database or journal.

SOW rejects pool paths that differ only in case, and on a case-insensitive filesystem it also rejects source directories that differ only in case. A repository built on a case-sensitive volume can therefore contain source directories that a case-insensitive destination cannot hold; filesystem publication checks for this before it starts. See Repository layout.

Package inputs

RPM. SOW reads RPM format v4 and v6, including dual- and multi-signed packages, wherever it reads packages: create and prune for simple repositories, add, build, and check for standard repositories. For v6 that means lead major versions 3 through 6, PAYLOADSHA256 without PAYLOADSHA256ALGO, and native OpenPGP v4 and v6 signature arrays in RPMSIGTAG_OPENPGP (tag 278). SOW also verifies RSA, DSA, ECDSA, and EdDSA (Ed25519) signatures in RPMSIGTAG_DSA (tag 267) and the legacy PGP tags; when tag 278 is present, it is authoritative. Main-header tags that repeat with identical values, such as the duplicate SOURCERPM in some EL10 packages, are accepted; conflicting main-header tags and duplicate signature-header tags are rejected.

DEB. SOW reads binary packages whose control.tar is uncompressed or compressed with gzip, bzip2, xz, or zstd. Legacy Latin-1 bytes (>= 0x80) in the control file are normalized to UTF-8.

Architectures. Dists in a standard repository accept x86_64, aarch64, and neutral packages: RPM x86_64, aarch64, and noarch; DEB amd64, arm64, and all. sow create indexes whatever architectures a simple repository contains.

Metadata signing supports RSA, EdDSA (Ed25519, Ed448), ECDSA, and DSA keys; see Signing model.

Repository formats and clients

Repository Client entry point Package locations
Simple, RPM repodata/repomd.xml Beside repodata/
Simple, DEB Packages or Packages.gz Beside the indexes: a flat APT repository (deb URL ./)
Standard, RPM dists/<dist>/<arch>/repodata/repomd.xml Relative paths back to the root pool/
Standard, DEB dists/<dist>/Release, or InRelease when signed Root-relative pool/ paths

A standard repository’s APT indexes use the component main and SHA-256 by-hash files. Metadata signing adds repomd.xml.asc for RPM and InRelease plus Release.gpg for APT. RPM metadata is gzip-compressed primary, filelists, and other XML, which DNF and YUM read directly.

Publication times

In a standard repository, each operation that builds metadata records one publication time and uses it for the APT Release date, the RPM repomd.xml data timestamps, and the metadata signatures. Recovery reuses the recorded time, and an operation that changes nothing leaves it untouched; a journal written without a recorded time keeps its earlier timestamp behavior. The RPM revision stays the Generation number. sow repo migrate is the exception: it keeps its own timestamp behavior, described below.

Existing EL7 caches

EL7 YUM compares metadata data timestamps with the copy it has cached, so a repository whose timestamps go backwards can look stale to existing clients. For a simple repository, create --metadata-timestamp SECONDS and prune --metadata-timestamp SECONDS let you keep an existing publication time and move it forward; the default is 0.

Exported RPM leaves and the RPM metadata that sow repo migrate writes use timestamp 0, with no override; later builds of a standard repository use their recorded publication time. If clients have cached a positive timestamp under their current repository ID, give these outputs a new repository ID or clear that ID’s metadata cache; changing only the base URL is not enough. To keep the old ID and cache, keep serving a simple repository and follow the timestamp procedure in Migrate an existing YUM repository.

Publication providers

Provider Publication Target GC
filesystem Writes below an existing canonical file:// endpoint Deletes conditionally after the cache grace period, then verifies the files are gone from the public endpoint
r2 Writes through S3-compatible storage operations Reports candidates by default; gc TARGET --delete rechecks eligible objects, deletes them, and verifies they are gone

Both providers publish the complete repository under the configured prefix. The HTTP service, DNS, credentials, access policy, and caching in front of that storage are yours to set up: public_endpoint tells SOW where to verify published content but does not create a service. R2 public endpoints must use HTTP(S); filesystem targets also accept file://. Field rules are in Publication targets.

How it is tested

The table covers the v0.9.0 test suite. Results are available for the CI run, integration tests, and release build.

Check Environment What it proves
Core contract tests Linux and macOS Repository manager, recovery, signing, and the patched RPM parser, as unit and contract suites
CLI clean-room workflow Linux The shipped binary: a mixed RPM and DEB simple repository, workspace initialization, RPM and DEB Dists, queries, build, and check
APT client, simple repository Ubuntu 22.04 apt updates, discovers, downloads, and installs from an explicitly trusted, unsigned flat APT repository
Clients of a signed standard repository Ubuntu 22.04, AlmaLinux 9 APT and DNF verify signed repository metadata and install a package
RPM signing with a password file AlmaLinux 8, 9, 10 Native rpm-sign and GnuPG sign with a protected key whose password comes from a password file
Detached signature transition AlmaLinux 8, 9, 10 How real DNF clients behave while repomd.xml and its detached signature are replaced
S3-compatible publication Pinned PGSTY Silo container Object transport, target GC deletion, republishing identical bytes, and a following no-op publish
Release packaging Linux Four archives, two RPMs, two DEBs, checksums, installed paths, and license files

The S3-compatible check does not run against Cloudflare R2 itself. Verify conditional multipart completion against the hosted R2 endpoint your deployment uses.

Before you switch production clients, run sow check, publish to the intended target, then refresh indexes and install a package with the real client configuration. See Serve and publish for client setup.

Not supported

Not supported Instead
Windows hosts Run SOW on Linux or macOS
A workspace on NFS or another network filesystem Keep the workspace on a local POSIX filesystem; copy or publish the public tree elsewhere
A macOS workspace on a volume without atomic directory exchange Use APFS
Packages for other CPU architectures, such as i686, in a standard repository (add rejects them) Index such a directory as a simple repository with sow create
DEB packages with control.tar.lzma Rebuild them with a gzip, bzip2, xz, zstd, or uncompressed control archive
SQLite (primary_db), zchunk, modulemd, and source-package RPM indexes See XML and SQLite RPM metadata
Default dnf reposync against a standard repository’s RPM view See dnf reposync

XML and SQLite RPM metadata

SOW writes gzip-compressed XML only, not the SQLite primary_db, filelists_db, or other_db. That does not stop YUM: when no suitable SQLite index exists, the upstream YUM metadata loader reads the XML and builds its own local cache. A tool that accepts only primary_db needs an XML input path or a separate conversion. Because the XML is gzip-compressed, zstd support is a separate question when you compare SOW’s output with other repositories.

SOW also writes no zchunk, modulemd, or source-package indexes. If clients need module profiles or dnf module install, keep a tool that provides module metadata. To install packages from modular builds as ordinary RPMs, set the client’s module_hotfixes policy; see Migrate an existing YUM repository.

dnf reposync

By default dnf reposync confines downloads to one repository directory, following its documented safe-write rule, so it rejects the parent-relative package locations in a standard repository’s RPM views. Use sow export rpm-leaf to produce a self-contained directory for that workflow.