dagger/dagger · error

rewrite lock entry for %s %v: %w

Error message

rewrite lock entry for %s %v: %w

What it means

UpdateWorkspaceLock: lock.SetLookup failed while rewriting a refreshed entry back into the workspace lockfile. The refresh itself succeeded; persisting the updated lookup (namespace/operation/inputs → new value) failed.

Source

Thrown at core/lockfile_update.go:35

	digest "github.com/opencontainers/go-digest"
)

// UpdateWorkspaceLock refreshes the existing entries in a workspace lockfile in place.
func UpdateWorkspaceLock(ctx context.Context, query *Query, lock *workspace.Lock) error {
	entries := lock.Entries()

	var refreshedEntries []workspace.LookupEntry
	for _, entry := range entries {
		if !isLatestLockEntry(entry) {
			continue
		}

		result, err := updateWorkspaceLockEntry(ctx, query, entry)
		if err != nil {
			return err
		}
		if err := lock.SetLookup(entry.Namespace, entry.Operation, entry.Inputs, result); err != nil {
			return fmt.Errorf("rewrite lock entry for %s %v: %w", entry.Operation, entry.Inputs, err)
		}
		selectedEntry, err := selectedSHAEntry(entry, result)
		if err != nil {
			return err
		}
		if containsLockEntry(refreshedEntries, selectedEntry) {
			continue
		}
		previousValue, found := lock.GetLookup(
			selectedEntry.Namespace,
			selectedEntry.Operation,
			selectedEntry.Inputs,
		)
		if found {
			selectedEntry.Value = previousValue
		}
		selectedValue, err := updateWorkspaceLockEntry(ctx, query, selectedEntry)
		if err != nil {

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Check the lockfile is writable and not concurrently modified
  2. Inspect the wrapped SetLookup error for the conflicting entry
  3. Regenerate the lockfile from scratch if it is corrupt
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/lockfile_update.go:35 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/f33ff01734497df1. Report an issue: GitHub.