anomalyco/sst · info

ErrLockNotFound

ErrLockNotFound

Error message

Lock not found

What it means

`ErrLockNotFound` is a sentinel error returned when SST tries to release/operate on a stage lock that does not exist. It is typically used internally to detect that no lock is held — e.g. `sst unlock` on an unlocked stage.

Source

Thrown at pkg/project/provider/provider.go:69

func (dt *DevTransport) Publish(input interface{}) error {
	jsonBytes, err := json.Marshal(input)
	if err != nil {
		return err
	}
	dt.Out <- string(jsonBytes)
	return nil
}

type DevSession interface {
	Cleanup() error
	Publish(json string) error
}

const SSM_NAME_BOOTSTRAP = "/sst/bootstrap"

var ErrLockExists = fmt.Errorf("Concurrent update detected, run `sst unlock --stage=<stage>` to delete lock file and retry.")
var ErrLockNotFound = fmt.Errorf("Lock not found")
var passphraseCache = map[Home]map[string]string{}

func Copy(from Home, to Home, app, stage string) error {
	reader, err := from.getData("app", app, stage)
	if err != nil {
		return err
	}
	err = to.putData("app", app, stage, reader)
	if err != nil {
		return err
	}
	reader, err = from.getData("secret", app, stage)
	if err != nil {
		return err
	}
	to.putData("secret", app, stage, reader)
	return nil
}

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Nothing to fix — the stage is already unlocked; proceed with your deploy
  2. If this blocks you unexpectedly, check for another sst process that already released the lock
Defensive patterns

Strategy: try-catch

Validate before calling

# only unlock if a lock is actually present
aws ssm get-parameter --name /sst/lock/<app>/<stage> --query Parameter.Value

Try / catch

err := sstUnlock(ctx, stage)
if errors.Is(err, sst.ErrLockNotFound) {
    // stage already unlocked — safe to proceed with deploy
    return nil
}

Prevention

When it happens

Trigger: Running `sst unlock --stage=<stage>` when no lock exists; internal unlock/cleanup paths invoked after the lock was already removed (e.g. a concurrent process released it first).

Common situations: Running unlock defensively after a deploy that actually completed; two processes racing to unlock the same stage.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/bd1f136be0d41ecc. Report an issue: GitHub.