plandex-ai/plandex · error

Error getting plan settings:

Error message

Error getting plan settings: 

What it means

When the load includes piped data, notes, or images, the server must fetch the plan's settings (db.GetPlanSettings) to resolve the model pack and clients. If that DB-backed lookup fails, the request fails with HTTP 500 and the underlying database/storage error is appended to the message.

Source

Thrown at app/server/handlers/context_helper.go:102

	if mapFilesCount > 0 {
		log.Printf("[ContextHelper] Processing %d map files out of %d total contexts", mapFilesCount, totalFiles)
	}

	var err error

	var settings *shared.PlanSettings
	var clients map[string]model.ClientInfo
	var authVars map[string]string
	var orgUserConfig *shared.OrgUserConfig

	for _, context := range *loadReq {
		if context.ContextType == shared.ContextPipedDataType || context.ContextType == shared.ContextNoteType || context.ContextType == shared.ContextImageType {

			settings, err = db.GetPlanSettings(plan)

			if err != nil {
				log.Printf("Error getting plan settings: %v\n", err)
				http.Error(w, "Error getting plan settings: "+err.Error(), http.StatusInternalServerError)
				return nil, nil
			}

			orgUserConfig, err = db.GetOrgUserConfig(auth.User.Id, auth.OrgId)
			if err != nil {
				log.Printf("Error getting org user config: %v\n", err)
				http.Error(w, "Error getting org user config: "+err.Error(), http.StatusInternalServerError)
				return nil, nil
			}

			res := initClients(
				initClientsParams{
					w:           w,
					auth:        auth,
					apiKeys:     context.ApiKeys,
					openAIOrgId: context.OpenAIOrgId,
					authVars:    context.AuthVars,
					plan:        plan,

View on GitHub (pinned to e2d772072e)

Solutions

  1. Inspect the server logs for the wrapped err from db.GetPlanSettings to see the root cause
  2. Verify the plan's settings file exists and is valid JSON in the repo storage (plans/<org>/<plan>)
  3. Check disk space/permissions on the server data directory; restart/recover the storage backend
  4. Re-create the plan if its settings are unrecoverably corrupt
Defensive patterns

Strategy: fallback

Validate before calling

// pre-check: ensure plan settings file is readable
if _, err := os.Stat(planDir + "/settings.json"); err != nil {
    return fmt.Errorf("plan settings unreadable: %w", err)
}

Try / catch

resp, err := doLoad(req)
if err != nil && strings.Contains(err.Error(), "Error getting plan settings") {
    // inspect server logs / storage health, then retry once
    resp, err = doLoad(req)
}

Prevention

When it happens

Trigger: Any loadContexts call containing a ContextPipedDataType, ContextNoteType, or ContextImageType context where db.GetPlanSettings(plan) returns an error — corrupt or missing plan settings file, storage backend failure.

Common situations: Corrupted .plandex plans dir, interrupted plan creation leaving settings unpersisted, disk/permissions problems on the server's data volume, storage service outage in self-hosted deployments.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/31f80b0438ccbc82. Report an issue: GitHub.