{"record":{"id":"00882bcc267a4f90","repo":"plandex-ai/plandex","slug":"error-updating-settings","errorCode":null,"errorMessage":"Error updating settings","messagePattern":"Error updating settings","errorType":"http","errorClass":"http","httpStatus":500,"severity":"error","filePath":"app/server/handlers/settings.go","lineNumber":204,"sourceCode":"\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error storing settings: %v\", err)\n\t\t}\n\n\t\tcommitMsg = getUpdateCommitMsg(settings, originalSettings, false)\n\n\t\terr = repo.GitAddAndCommit(branch, commitMsg)\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error committing settings: %v\", err)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tlog.Println(\"Error updating settings: \", err)\n\t\thttp.Error(w, \"Error updating settings\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tres := shared.UpdateSettingsResponse{\n\t\tMsg: commitMsg,\n\t}\n\tbytes, err := json.Marshal(res)\n\n\tif err != nil {\n\t\tlog.Println(\"Error marshalling response: \", err)\n\t\thttp.Error(w, \"Error marshalling response\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Write(bytes)\n\n\tlog.Println(\"UpdateSettingsHandler processed successfully\")\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/settings.go#L186-L222","documentation":"UpdateSettingsHandler applies the settings change inside a callback; if that operation returns an error the handler logs it and returns HTTP 500 'Error updating settings'. This means the settings change failed to persist server-side.","triggerScenarios":"The update callback returns an error: write/commit failure to the settings store (git commit or DB write), storage backend unavailable, permission denied, or context cancellation of r.Context().","commonSituations":"Storage backend down or read-only filesystem; git settings repo in a locked/dirty state; concurrent settings update conflict; request context canceled by client timeout mid-update.","solutions":["Check the server log for the underlying error adjacent to this message","Verify storage backend is writable and reachable (disk space, permissions, locks)","Retry the update after resolving storage issues; check for concurrent update conflicts","Ensure the client request isn't timing out and canceling the server context"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"resp, err := client.UpdateSettings(ctx, req)\nif err != nil {\n    var apiErr *APIError\n    if errors.As(err, &apiErr) && strings.Contains(apiErr.Message, \"Error updating settings\") {\n        // transient storage failure: backoff and retry\n        time.Sleep(2 * time.Second)\n        return client.UpdateSettings(ctx, req)\n    }\n    return err\n}","preventionTips":["Use generous client timeouts so the server context isn't canceled mid-write","Monitor storage backend health (disk space, git repo state)","Retry with backoff on transient failures; updates should be idempotent"],"tags":["http","storage","go"],"backgroundTag":"settings-update-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}