plandex-ai/plandex · error

error rejecting plan files: %v

Error message

error rejecting plan files: %v

What it means

RejectPlanFiles waits on errCh once per file and wraps the first worker failure as 'error rejecting plan files: %v'. Any RejectPlanFile error (including getting results, panics, or per-result write failures) is aggregated here.

Source

Thrown at app/server/db/result_helpers.go:932

					errCh <- fmt.Errorf("panic in RejectPlanFiles: %v\n%s", r, debug.Stack())
					runtime.Goexit() // don't allow outer function to continue and double-send to channel
				}
			}()
			err := RejectPlanFile(orgId, planId, file, now)

			if err != nil {
				errCh <- err
				return
			}

			errCh <- nil
		}(file)
	}

	for i := 0; i < len(files); i++ {
		err := <-errCh
		if err != nil {
			return fmt.Errorf("error rejecting plan files: %v", err)
		}
	}

	return nil
}

func RejectPlanFile(orgId, planId, filePathOrResultId string, now time.Time) error {
	resultsDir := getPlanResultsDir(orgId, planId)
	results, err := GetPlanFileResults(orgId, planId)

	if err != nil {
		return fmt.Errorf("error getting plan file results: %v", err)
	}

	errCh := make(chan error, len(results))

	for _, result := range results {
		go func(result *PlanFileResult) {

View on GitHub (pinned to e2d772072e)

Solutions

  1. Read the wrapped %v to find which file and underlying error failed
  2. Verify the plan results directory exists and is readable/writable before calling RejectPlanFiles
  3. Ensure the same files are not being rejected concurrently from multiple requests
  4. Log and continue per file if partial rejection is acceptable instead of failing fast
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := os.Stat(getPlanResultsDir(orgId, planId)); os.IsNotExist(err) {
    return nil // nothing to reject; skip the call
}
// pre-check inputs
for _, f := range files { if f == "" { return fmt.Errorf("empty file path") } }

Try / catch

if err := RejectPlanFiles(orgId, planId, files, now); err != nil {
    log.Printf("rejecting plan files failed: %v", err)
    // retry once after checking filesystem health, or fall back to per-file RejectPlanFile
}

Prevention

When it happens

Trigger: RejectPlanFile returns an error for any of the fanned-out files: GetPlanFileResults fails, result files unreadable/unwritable, or a recovered panic occurs.

Common situations: Results directory missing or unreadable for the given org/plan; one bad file causing repeated failures; concurrent rejection of the same files from two requests.

Related errors


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