{"record":{"id":"5a29d822c9679008","repo":"plandex-ai/plandex","slug":"error-getting-default-config-v","errorCode":null,"errorMessage":"error getting default config: %v","messagePattern":"error getting default config: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/models.go","lineNumber":117,"sourceCode":"\tvar defaultConfig *shared.PlanConfig\n\n\terrCh := make(chan error, 2)\n\n\tgo func() {\n\t\tvar err error\n\t\tserverModelsInput, err = lib.GetServerModelsInput()\n\t\tif err != nil {\n\t\t\terrCh <- fmt.Errorf(\"error getting server models input: %v\", err)\n\t\t\treturn\n\t\t}\n\t\terrCh <- nil\n\t}()\n\n\tgo func() {\n\t\tvar apiErr *shared.ApiError\n\t\tdefaultConfig, apiErr = api.Client.GetDefaultPlanConfig()\n\t\tif apiErr != nil {\n\t\t\terrCh <- fmt.Errorf(\"error getting default config: %v\", apiErr.Msg)\n\t\t\treturn\n\t\t}\n\t\terrCh <- nil\n\t}()\n\n\tfor i := 0; i < 2; i++ {\n\t\terr := <-errCh\n\t\tif err != nil {\n\t\t\tterm.OutputErrorAndExit(err.Error())\n\t\t\treturn\n\t\t}\n\t}\n\n\tusingDefaultPath := false\n\tif customModelsPath == \"\" {\n\t\tusingDefaultPath = true\n\t\tcustomModelsPath = lib.GetCustomModelsPath(auth.Current.UserId)\n\t}","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/models.go#L99-L135","documentation":"This error wraps a failure from api.Client.GetDefaultPlanConfig(), a network call that fetches the default plan configuration from the server. The CLI runs this in a goroutine and funnels any API error (apiErr.Msg) into errCh as this formatted error. It means the server rejected or could not serve the default plan config request.","triggerScenarios":"GetDefaultPlanConfig returns a non-nil *shared.ApiError — e.g. unauthenticated session, server 4xx/5xx response, or network failure during 'models' command startup.","commonSituations":"Expired or missing auth token, API server down or unreachable, backend changed the default-config endpoint, corporate proxy blocking the request.","solutions":["Check authentication (run the login/auth command) and retry","Verify the API server is reachable (curl the endpoint / check status page)","Update the CLI — the endpoint contract may have changed","Inspect apiErr.Msg in the output for the server-side cause"],"exampleFix":"// before\nif apiErr != nil {\n    errCh <- fmt.Errorf(\"error getting default config: %v\", apiErr.Msg)\n    return\n}\n// after\nif apiErr != nil {\n    if apiErr.StatusCode == 401 {\n        errCh <- fmt.Errorf(\"not authenticated; run 'auth login' first\")\n    } else {\n        errCh <- fmt.Errorf(\"error getting default config: %v\", apiErr.Msg)\n    }\n    return\n}","handlingStrategy":"try-catch","validationCode":"if auth.Current.UserId == \"\" || authToken == \"\" {\n    return fmt.Errorf(\"not authenticated; run 'auth login' first\")\n}","typeGuard":"var apiErr *shared.ApiError\n_, apiErr = api.Client.GetDefaultPlanConfig()\nif apiErr != nil {\n    // handle\n}","tryCatchPattern":"defaultConfig, apiErr := api.Client.GetDefaultPlanConfig()\nif apiErr != nil {\n    switch apiErr.StatusCode {\n    case 401: reAuth(); case 500: retryWithBackoff(); default: return apiErr\n    }\n}","preventionTips":["Check auth state before running commands that hit the API","Handle *shared.ApiError explicitly and inspect StatusCode","Retry transient 5xx with backoff","Keep the CLI updated to match API changes"],"tags":["network","api","cli","config"],"backgroundTag":"api-request-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"}