gastownhall/beads · error

load create context: %w

Error message

load create context: %w

What it means

Inside the graph-apply transaction, LoadCreateContext on the config use case failed (actor/defaults/resolution context for creates could not be loaded). The whole uow.RunTxResult transaction aborts and nothing from the plan is written.

Source

Thrown at cmd/bd/create_proxied_server.go:336

			return HandleError("%v", err)
		}
		return nil
	}

	domainPlan, err := buildDomainGraphPlan(plan, in)
	if err != nil {
		return err
	}

	commitMsg := plan.CommitMessage
	if commitMsg == "" {
		commitMsg = fmt.Sprintf("bd: graph-apply %d nodes", len(plan.Nodes))
	}

	res, err := uow.RunTxResult(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (map[string]string, string, error) {
		cctx, err := uw.ConfigUseCase().LoadCreateContext(ctx)
		if err != nil {
			return nil, "", fmt.Errorf("load create context: %w", err)
		}

		// validateProxiedGraphPlan enforces a uniform storage class, so its
		// resolved useWisp decides which table the whole plan routes to. The
		// collision preflight runs inside this transaction, so it cannot race
		// a concurrent create of the same explicit ID.
		useWisp, err := validateProxiedGraphPlan(&plan, in, cctx, uowIssueExists(ctx, uw))
		if err != nil {
			return nil, "", fmt.Errorf("invalid graph plan: %w", err)
		}

		var result domain.GraphApplyResult
		var applyErr error
		if useWisp {
			result, applyErr = uw.IssueUseCase().ApplyWispGraph(ctx, domainPlan, in.createdBy)
		} else {
			result, applyErr = uw.IssueUseCase().ApplyIssueGraph(ctx, domainPlan, in.createdBy)
		}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped error for the config-layer cause
  2. Validate server config (default issue type, priority) is set and well-formed
  3. Check proxied-server connectivity and storage health (`bd doctor`)
  4. Retry once config is repaired; the tx is atomic so no partial writes
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: ensure server config defaults are reachable
if _, err := configClient.GetDefaultIssueType(ctx); err != nil {
    return fmt.Errorf("server config unavailable before graph apply: %w", err)
}

Try / catch

err := uow.RunTxResult(ctx, uowProvider, fn)
if err != nil && strings.Contains(err.Error(), "load create context") {
    // transaction rolled back atomically; safe to retry after fixing config
    return repairServerConfigAndRetry(ctx, in)
}

Prevention

When it happens

Trigger: runCreateProxiedGraph / graph-apply against the proxied server when uw.ConfigUseCase().LoadCreateContext errors — e.g. server-side config unavailable, bad default-issue-type/priority config, or storage error inside the tx.

Common situations: Server config DB unreachable or corrupt; malformed default-priority/issue-type config values; permission errors reading config through the proxy.

Related errors


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