plandex-ai/plandex · warning
planId field is required
Error message
planId field is required
What it means
This is a field-validation error: the parsed SetProjectPlanRequest has an empty PlanId, so the handler rejects the request with HTTP 400 'planId field is required' before applying the update. Like error 1040, it enforces that the required plan identifier is present.
Source
Thrown at app/server/handlers/projects.go:157
// read the request body
body, err := io.ReadAll(r.Body)
if err != nil {
log.Printf("Error reading request body: %v\n", err)
http.Error(w, "Error reading request body", http.StatusInternalServerError)
return
}
defer r.Body.Close()
var requestBody shared.SetProjectPlanRequest
if err := json.Unmarshal(body, &requestBody); err != nil {
log.Printf("Error parsing request body: %v\n", err)
http.Error(w, "Error parsing request body", http.StatusBadRequest)
return
}
if requestBody.PlanId == "" {
log.Println("Received empty planId field")
http.Error(w, "planId field is required", http.StatusBadRequest)
return
}
// update statement here -- need auth / current user id
log.Println("Successfully set project plan", projectId)
}
func RenameProjectHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Received request for RenameProjectHandler")
auth := Authenticate(w, r, true)
if auth == nil {
return
}
vars := mux.Vars(r)
projectId := vars["projectId"]
View on GitHub (pinned to e2d772072e)
Solutions
- Include a non-empty "planId" string in the JSON body: {"planId":"<plan-id>"}.
- Fix the client to obtain a real plan id (create or look up the plan) before calling this endpoint.
- Guard on the client: skip/queue the call when the plan id is empty instead of sending an empty one.
- If testing, use a plan id from a prior create-plan response.
Example fix
// before
{"planId": ""}
// after
{"planId": "01f3d0e9-8a2c-4b7e-9d1a-2c3b4d5e6f7a"} Defensive patterns
Strategy: validation
Validate before calling
if strings.TrimSpace(planId) == "" {
return errors.New("planId field is required")
} Type guard
func hasPlanId(req shared.SetProjectPlanRequest) bool {
return strings.TrimSpace(req.PlanId) != ""
} Prevention
- Resolve the plan id (create or fetch the plan) before calling set-plan.
- Disable/delay the set-plan UI action until a plan id exists.
- Mirror server validation client-side to fail fast with a clear message.
- Use the shared request struct so field names can't drift.
When it happens
Trigger: POST to the project set-plan endpoint with valid JSON but no "planId" key, "planId": "", or "planId": null (decodes to empty string).
Common situations: Client never resolved/selected a plan before calling set-plan; renamed field in client code (plan vs planId); stubbed client sending a placeholder empty payload; older client versions predating the planId field.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Has duplicates:
- Provider name is required
- Model id is required
- Model pack name is required
- name field is required
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/7613c4509b225c12.
Report an issue: GitHub.