Skip to content

Troubleshooting

Find the next command for migration, pending builds, interrupted publication, locks, and integrity errors.

Start with the error message and the exit code. For Managed commands, specify the workspace and Repository so you inspect the intended state:

sow version
sow status -C /srv/sow -r pgsql
sow log -C /srv/sow -r pgsql

Replace /srv/sow, pgsql, and the target name prod below with your configuration.

The database needs migration

SOW 0.9.0 and versions 0.5.0 through 0.8.0 use schema v13. These workspaces can upgrade directly, and 0.9.0 directly resumes interrupted 0.7.1 local GC plans containing an empty manifest array. See the upgrade guide. For a 0.3 or 0.4 workspace, stop writers and back up the complete workspace. Then run:

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

Repeat this for each Repository. Compatible read-only commands can still inspect an older schema, but they do not migrate it; write commands and init reject an unmigrated schema v12 database with exit code 6. If a Repository migrated from C2 layout by SOW 0.5 or 0.6 reported an invalid transition control target after a later build, SOW 0.7.0 and later recover this state automatically. See Upgrade.

If leftover C2 migration stage files block local GC, rerun sow repo migrate REPOSITORY. SOW 0.7.1 and later preserve unproven files under .sow/<repo>/abandoned/ and report their location. Inspect them before removal.

Status shows pending changes

add --skip, rm --skip, and configuration edits can leave Desired state ahead of Built state. Apply the pending changes, then check the result:

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

A local build updates local indexes. To update a configured remote target, also run sow publish prod -C /srv/sow. See sow status for the state fields.

A command was interrupted

For Plain mode, resolve the reported input or filesystem issue, then rerun the original sow create command with the same Pigsty, timestamp, and signing options, or rerun sow prune with the same --protect and --metadata-timestamp options.

For an interrupted add, rm, Dist change, or build, inspect sow log and fix the reported cause. Run sow build for that Repository to complete recovery. Committed Desired changes remain part of the pending build. For interrupted init, repo new, or repo rm operations, rerun the corresponding lifecycle command to recover the workspace journal. For an interrupted local gc or retain rm, rerun sow gc or sow retain rm GENERATION (including interrupted 0.7.1 empty-manifest local GC plans). If an R2 target deletion was interrupted, resume it with sow gc TARGET --delete.

If recovery needs a protected signing key, supply its password source again. Journals do not save passwords. A supported recovery command can use --passfile PATH or SOW_GPG_PASSFILE; per-key configuration still applies. Keep sow.yml consistent with any pending workspace lifecycle journal. See Password files.

For an interrupted publication, restore access to its storage and public endpoint, then rerun the same target:

sow publish prod -C /srv/sow

SOW resumes the saved attempt. To abandon an attempt before commit intent, use sow publish prod --abort -C /srv/sow. After commit intent, rerun publication to finish it. See Publication recovery.

Errors after a committed change

Database commit and later maintenance are separate steps. A checkpoint or cleanup error can occur after package membership or a build has committed. SOW keeps the committed result in command output. It does not report those items as rolled back.

Read the result and sow status, then inspect the recorded operation with sow log. Resume the command named in the diagnostic. Keep original input files until you have confirmed the result.

Target configuration changed

Compare sow.yml with the target named in the error. If you intentionally changed its name, public_endpoint, or max_cache_ttl, accept the change with:

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

A change to the Repository, provider, storage endpoint, region, bucket, or prefix requires a new target. Complete pending target maintenance before changing its TTL. See Target bindings.

A command waits for a lock

Another process is using the workspace or Repository. Let that command finish, or stop it through its normal process controls. Retry your command afterward.

For write commands that support lock options, use --no-wait to return immediately when the lock is busy, or --timeout 30s to bound the wait. These options do not apply to init or read commands. Shared-lock reads wait until the writer finishes or you cancel the command; status normally reports the lock state without waiting. Keep the lock files in place: SOW uses their stable paths to coordinate processes. If a populated workspace loses .sow/workspace.lock, stop all SOW processes and scheduled jobs for that workspace, exclusively create an empty 0600 .sow/workspace.lock as the workspace owner, and run sow init before restarting jobs. See Global options.

A package, signature, or path fails validation

A signing key asks for a password or cannot unlock

With a binary that supports password files, use --passfile PATH, a per-key passfile, or SOW_GPG_PASSFILE, in that priority order. create also requires --sign-with; setting the environment variable alone does not enable signing.

  • Check the selected path first. CLI/environment paths start at the process working directory, regardless of -C; config paths start at the workspace root. An empty environment variable is not the same as an unset one.
  • Regular files, symlinks (including Kubernetes Secret mounts), and named pipes (FIFOs, with a 2-second writer deadline) are supported. The password is one nonempty line (optional UTF-8 BOM and one final LF or CRLF are removed); spaces and tabs are significant. The file is not a shell script or NAME=value assignment.
  • An invalid selected source fails without fallback or prompting. External GPG needs agent support for loopback mode. A hardware key may still require its own confirmation.
  • config check unlocks metadata keys and probes external metadata GPG signing. RPM package preflight does not prove that a password is correct; verify an actual package-signing operation. check verifies public signatures without reading passwords.

Other validation failures

Use the named file and the check stage to narrow the cause:

Error Action
Same Pool path, different bytes Compare the input with the existing package. Give different content a new package version and file name. Moving it to another input directory does not change its Pool URL.
File name differs only by case Use the already recorded spelling. Case aliases cannot create another Pool URL.
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, GPG agent, and current key validity. Retry the build after correcting them.
RPM does not match the trust policy Check the package signature and configured public keys. See Signing.
Public URL returns old content Check the HTTP root, URL prefix, cache, and max_cache_ttl, then retry publication.

sow check reports integrity errors; it does not rewrite damaged data. Keep the reported path and operation ID when investigating. The layout reference explains which files belong to the package Pool, generated indexes, and private state.

Table reader