{"record":{"id":"82af4ab31f6db550","repo":"plandex-ai/plandex","slug":"project-not-found","errorCode":null,"errorMessage":"Project not found: ","messagePattern":"Project not found: ","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"app/server/handlers/projects.go","lineNumber":222,"sourceCode":"\tres, err := db.Conn.Exec(\"UPDATE projects SET name = $1 WHERE id = $2\", requestBody.Name, projectId)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error updating project: %v\\n\", err)\n\t\thttp.Error(w, \"Error updating project: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\trowsAffected, err := res.RowsAffected()\n\n\tif err != nil {\n\t\tlog.Printf(\"Error getting rows affected: %v\\n\", err)\n\t\thttp.Error(w, \"Error getting rows affected: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif rowsAffected == 0 {\n\t\tlog.Printf(\"Project not found: %v\\n\", projectId)\n\t\thttp.Error(w, \"Project not found: \"+projectId, http.StatusNotFound)\n\t\treturn\n\t}\n\n\tlog.Println(\"Successfully renamed project\", projectId)\n\n}\n","sourceCodeStart":204,"sourceCodeEnd":229,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/projects.go#L204-L229","documentation":"This HTTP 404 response means the rename UPDATE executed fine but affected zero rows — no project exists with the given projectId (or the row already had that exact name in some edge interpretations, though for Postgres an UPDATE that matches no id reports 0). The handler uses RowsAffected == 0 to detect a missing project and reports 404 with the projectId included.","triggerScenarios":"Calling the rename endpoint with a projectId that does not exist in the projects table; stale ID from a deleted project still cached in the UI; wrong ID type/format silently coerced (e.g. string with whitespace or wrong UUID) matching nothing; ID belongs to a different environment's database.","commonSituations":"Frontend holding a project that another user deleted (no realtime sync); test fixtures pointing at a cleaned database; dev/staging database mismatch where the ID exists locally but not on the server; ID truncated or URL-encoded incorrectly in the client.","solutions":["Confirm the projectId exists: SELECT * FROM projects WHERE id = '<id>'; with the app's DB credentials.","Refresh the client's project list after deletions and remove stale references.","Validate/normalize the projectId (UUID format, trimming) before sending.","Verify the server is pointed at the environment you expect (DATABASE_URL) — the record may exist in a different DB.","On 404, have the client surface 'project no longer exists' and offer to refresh the list."],"exampleFix":"// before (client)\nawait api.renameProject(projectIdFromCache, name); // may 404 if deleted elsewhere\n// after\nconst project = await api.getProject(projectId);\nif (!project) {\n  ui.refreshProjectList();\n  throw new Error('Project no longer exists');\n}\nawait api.renameProject(projectId, name);","handlingStrategy":"validation","validationCode":"// client-side: verify the project exists before renaming\nconst project = await api.getProject(projectId);\nif (!project) { ui.refreshProjectList(); return; } // don't attempt rename","typeGuard":"function projectExists(p) { return p !== null && typeof p === 'object' && typeof p.id === 'string' && p.id.length > 0; }","tryCatchPattern":"// client\ntry {\n  const res = await renameProject(id, name);\n  if (res.status === 404) {\n    ui.notify('Project no longer exists');\n    await ui.refreshProjectList();\n  }\n} catch (e) { console.error(e); }","preventionTips":["Refresh cached project lists after deletes (yours or other users').","Validate ID format (UUID) before sending requests.","Confirm the client and server point at the same environment/database.","Treat 404 as an expected, handled outcome — not a bug to retry."],"tags":["http-404","not-found","database","stale-data"],"backgroundTag":"resource-not-found","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"}