{"record":{"id":"39b17777312fecdf","repo":"gastownhall/beads","slug":"load-create-context-w","errorCode":null,"errorMessage":"load create context: %w","messagePattern":"load create context: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_proxied_server.go","lineNumber":336,"sourceCode":"\t\t\treturn HandleError(\"%v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tdomainPlan, err := buildDomainGraphPlan(plan, in)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcommitMsg := plan.CommitMessage\n\tif commitMsg == \"\" {\n\t\tcommitMsg = fmt.Sprintf(\"bd: graph-apply %d nodes\", len(plan.Nodes))\n\t}\n\n\tres, err := uow.RunTxResult(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (map[string]string, string, error) {\n\t\tcctx, err := uw.ConfigUseCase().LoadCreateContext(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"load create context: %w\", err)\n\t\t}\n\n\t\t// validateProxiedGraphPlan enforces a uniform storage class, so its\n\t\t// resolved useWisp decides which table the whole plan routes to. The\n\t\t// collision preflight runs inside this transaction, so it cannot race\n\t\t// a concurrent create of the same explicit ID.\n\t\tuseWisp, err := validateProxiedGraphPlan(&plan, in, cctx, uowIssueExists(ctx, uw))\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"invalid graph plan: %w\", err)\n\t\t}\n\n\t\tvar result domain.GraphApplyResult\n\t\tvar applyErr error\n\t\tif useWisp {\n\t\t\tresult, applyErr = uw.IssueUseCase().ApplyWispGraph(ctx, domainPlan, in.createdBy)\n\t\t} else {\n\t\t\tresult, applyErr = uw.IssueUseCase().ApplyIssueGraph(ctx, domainPlan, in.createdBy)\n\t\t}","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_proxied_server.go#L318-L354","documentation":"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.","triggerScenarios":"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.","commonSituations":"Server config DB unreachable or corrupt; malformed default-priority/issue-type config values; permission errors reading config through the proxy.","solutions":["Read the wrapped error for the config-layer cause","Validate server config (default issue type, priority) is set and well-formed","Check proxied-server connectivity and storage health (`bd doctor`)","Retry once config is repaired; the tx is atomic so no partial writes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: ensure server config defaults are reachable\nif _, err := configClient.GetDefaultIssueType(ctx); err != nil {\n    return fmt.Errorf(\"server config unavailable before graph apply: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := uow.RunTxResult(ctx, uowProvider, fn)\nif err != nil && strings.Contains(err.Error(), \"load create context\") {\n    // transaction rolled back atomically; safe to retry after fixing config\n    return repairServerConfigAndRetry(ctx, in)\n}","preventionTips":["Verify server config (default type/priority) is set before bulk applies","Monitor server storage health","Remember the tx is atomic — no partial graph writes to clean up"],"tags":["proxied-server","transaction","config","graph-apply"],"backgroundTag":"create-context-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}