{"record":{"id":"b47d9ab4620348ec","repo":"plandex-ai/plandex","slug":"error-getting-plan-data-v","errorCode":null,"errorMessage":"error getting plan data: %v","messagePattern":"error getting plan data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/plan/build_load.go","lineNumber":140,"sourceCode":"\t\t\t\treturn\n\t\t\t}\n\n\t\t\torgUserConfig = res\n\t\t\terrCh <- nil\n\t\t}()\n\n\t\tfor i := 0; i < 4; i++ {\n\t\t\terr = <-errCh\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error getting plan data: %v\\n\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting plan data: %v\", err)\n\t}\n\n\tUpdateActivePlan(plan.Id, branch, func(ap *types.ActivePlan) {\n\t\tap.Contexts = modelContext\n\t\tfor _, context := range modelContext {\n\t\t\tif context.FilePath != \"\" {\n\t\t\t\tap.ContextsByPath[context.FilePath] = context\n\t\t\t}\n\t\t}\n\t})\n\n\tstate.modelContext = modelContext\n\tstate.settings = settings\n\tstate.orgUserConfig = orgUserConfig\n\n\treturn pendingBuildsByPath, nil\n}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/build_load.go#L122-L158","documentation":"loadPendingBuilds wraps any error from its transaction/graceful-db batch (which loads plan settings, org user config, and model context) with this message and returns it to Build. It is an aggregate: the real cause is the underlying error from the batch callback (including errors surfaced on errCh from the loader goroutines, such as 'error getting org user config' or 'error getting plan settings').","triggerScenarios":"Any of the four errCh sends or the graceful batch callback returns an error during Build -> loadPendingBuilds: plan settings load failure, org user config load failure, model context load failure, or transaction rollback.","commonSituations":"Database connectivity problems during plan build startup; missing plan settings or org-user config rows; a recovered panic in one of the loader goroutines (see errors 665/666); concurrent plan state invalidation.","solutions":["Look at the wrapped inner error and the log lines emitted during the load (e.g. 'Error getting plan settings' / 'Error getting org user config') to identify the real cause.","Fix the underlying DB issue: connectivity, missing rows, or migrations.","Ensure auth and plan objects are fully populated before calling Build.","Retry the build if the inner error was transient (timeout, deadlock)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if plan == nil || plan.Id == \"\" {\n    return fmt.Errorf(\"plan must be loaded before building\")\n}\nif err := db.Ping(); err != nil {\n    return fmt.Errorf(\"database unavailable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"plan, err := Build(req)\nif err != nil {\n    var inner = errors.Unwrap(err) // inspect the wrapped load error\n    log.Printf(\"plan data load failed: %v (cause: %v)\", err, inner)\n    if isRetryable(inner) {\n        plan, err = Build(req)\n    }\n}","preventionTips":["Always inspect the wrapped inner cause — this message is an aggregator, not the root failure.","Check logs for 'Error getting plan settings' / 'Error getting org user config' emitted during the load.","Ensure DB health before invoking Build (ping or readiness probe).","Verify plan, settings and auth records exist for the branch being built.","Retry only transient inner errors; fix missing-data errors at the source."],"tags":["database","build","aggregated-error"],"backgroundTag":"database-query-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}