gastownhall/beads · error

resolving %s: %w

Error message

resolving %s: %w

What it means

When GetIssueOrWisp fails for any reason other than ErrNotFound (driver error, transaction failure, deserialization problem), the error is wrapped as 'resolving <id>: %w'. It signals the mutation aborted while reading the issue, not that the issue is absent.

Source

Thrown at cmd/bd/mutate_proxied_server.go:28

	"github.com/steveyegge/beads/internal/types"
	"github.com/steveyegge/beads/internal/ui"
	"github.com/steveyegge/beads/internal/validation"
	"github.com/steveyegge/beads/internal/workapi"
	"github.com/steveyegge/beads/issueops"
)

func proxiedMutateIssue(ctx context.Context, id, commitMsg string, mutate func(ctx context.Context, uw uow.UnitOfWork, issue *types.Issue, isWisp bool) error) (*types.Issue, error) {
	if uowProvider == nil {
		return nil, fmt.Errorf("proxied-server UOW provider not initialized")
	}
	var updated *types.Issue
	err := uow.RunTx(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {
		issue, isWisp, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(uw), id)
		if errors.Is(rerr, storage.ErrNotFound) {
			return "", fmt.Errorf("issue %s not found", id)
		}
		if rerr != nil {
			return "", fmt.Errorf("resolving %s: %w", id, rerr)
		}
		if err := validateIssueUpdatable(id, issue); err != nil {
			return "", err
		}
		if err := mutate(ctx, uw, issue, isWisp); err != nil {
			return "", err
		}
		if isWisp {
			updated, _ = uw.IssueUseCase().GetWisp(ctx, issue.ID)
		} else {
			updated, _ = uw.IssueUseCase().GetIssue(ctx, issue.ID)
		}
		return commitMsg, nil
	})
	if err != nil {
		return nil, err
	}
	commandDidWrite.Store(true)

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped cause after 'resolving <id>:' to identify the driver error and address it (connectivity, locks, disk).
  2. Retry the command once storage is healthy; transient lock/timeout errors usually clear.
  3. Restart the local Dolt/store process if the connection is wedged.
  4. If corruption is indicated, restore from backup or re-sync (`bd dolt pull`).
Defensive patterns

Strategy: retry

Validate before calling

// Pre-check storage reachability before mutating
if err := store.HealthCheck(ctx); err != nil {
    return fmt.Errorf("storage unhealthy, aborting mutation of %s: %w", id, err)
}

Try / catch

_, err := proxiedMutateIssue(ctx, id, msg, mutate)
if err != nil && strings.Contains(err.Error(), "resolving "+id) {
    // transient storage error: wait/backoff and retry once
    time.Sleep(time.Second)
    return proxiedMutateIssue(ctx, id, msg, mutate)
}

Prevention

When it happens

Trigger: Any proxied mutation where the storage read inside uow.RunTx errors — database connection failure, driver-level error, corrupt row, or context canceled during the read.

Common situations: Dolt server unreachable or restarted mid-command; lock contention/timeout on the database; disk or corruption errors; context deadline exceeded on slow storage.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/67a558f173fe90be. Report an issue: GitHub.