plandex-ai/plandex · error
error getting plan settings: %v
Error message
error getting plan settings: %v
What it means
Despite the 'plan settings' wording, this error is the panic-recovery branch of the goroutine that calls active.PendingBuildsByPath in loadPendingBuilds (build_load.go). The defer/recover block catches any panic (nil map write, nil pointer dereference, etc.) inside that goroutine and reports it as 'error getting plan settings: %v' with the recovered value, then calls runtime.Goexit to avoid double-sending on errCh. So seeing this message means the pending-builds goroutine panicked, not that settings failed. The recovered value after '%v' is the panic cause.
Source
Thrown at app/server/model/plan/build_load.go:72
runtime.Goexit() // don't allow outer function to continue and double-send to channel
}
}()
res, err := db.GetPlanContexts(auth.OrgId, plan.Id, true, false)
if err != nil {
log.Printf("Error getting plan modelContext: %v\n", err)
errCh <- fmt.Errorf("error getting plan modelContext: %v", err)
return
}
modelContext = res
errCh <- nil
}()
go func() {
defer func() {
if r := recover(); r != nil {
log.Printf("panic in getPlanSettings: %v\n%s", r, debug.Stack())
errCh <- fmt.Errorf("error getting plan settings: %v", r)
runtime.Goexit() // don't allow outer function to continue and double-send to channel
}
}()
res, err := active.PendingBuildsByPath(auth.OrgId, auth.User.Id, nil)
if err != nil {
log.Printf("Error getting pending builds by path: %v\n", err)
errCh <- fmt.Errorf("error getting pending builds by path: %v", err)
return
}
pendingBuildsByPath = res
errCh <- nil
}()
go func() {
defer func() {View on GitHub (pinned to e2d772072e)
Solutions
- Check server logs for 'panic in getPlanSettings' followed by the stack trace - it identifies the exact nil dereference or assertion that panicked.
- Check the log lines just before it for 'Error activating plan' - a failed activatePlan leaves 'active' partially initialized; fix that activation error first.
- Upgrade plandex-server (and plandex CLI) to matching latest versions; this panic path was likely fixed in newer releases.
- Retry the operation after confirming the plan/branch state is valid (plandex branches, plandex builds).
- If reproducible, capture the stack trace and report it to Plandex - a panic here is an internal bug, not user error.
Example fix
// before (server code that lets a failed activation produce a nil-dependent panic)
active, err := activatePlan(clients, plan, branch, auth, "", true, false, sessionId)
if err != nil {
log.Printf("Error activating plan: %v\n", err)
}
// after
active, err := activatePlan(clients, plan, branch, auth, "", true, false, sessionId)
if err != nil {
errCh <- fmt.Errorf("error activating plan: %v", err)
return err
} Defensive patterns
Strategy: try-catch
Validate before calling
// before triggering the build, confirm the plan activated cleanly // plandex ps --plan <planId> -> plan exists and branch is valid // check server logs for 'Error activating plan' before/at request time
Try / catch
err := loadPlanBuild(planId)
if err != nil {
if strings.Contains(err.Error(), "error getting plan settings") {
// ambiguous message: check server logs for 'panic in getPlanSettings'
// + stack trace to confirm it was a panic in the pending-builds goroutine,
// then retry or report upstream with the stack
return fmt.Errorf("internal server panic while loading plan: %w", err)
}
return err
} Prevention
- Keep plandex-server and plandex CLI on matching versions to avoid state-shape mismatches that panic.
- Check server logs for activation errors; a failed activatePlan is the usual precursor to this panic.
- Avoid concurrent operations on the same plan/branch that race on shared state.
- Report any 'panic in getPlanSettings' stack trace upstream - it indicates a server bug, not user error.
When it happens
Trigger: Any panic inside the goroutine that wraps active.PendingBuildsByPath(orgId, userId, nil) - typically a nil receiver/plan-state field (e.g. 'active' or an internal map is nil because activatePlan failed upstream) or an unexpected type assertion while computing pending builds by path.
Common situations: activatePlan on line 23 failed (its error is only logged, not returned) leaving 'active' partially initialized; concurrent mutation of plan state; a bug triggered by a plan with zero pending builds or an unusual branch state; running a server build with mismatched plandex-server/shared versions.
Related errors
- panic in UpdateContexts: %v\n%s
- panic in GetPlanConvo: %v\n%s
- panic in gitRemoveIndexLockFileIfExists: %v %s
- panic in SyncPlanTokens: %v %s
- panic in DeleteDraftPlans: %v %s
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/e9b837d65bc1ff94.
Report an issue: GitHub.