{"record":{"id":"5e459d88f4877c0f","repo":"plandex-ai/plandex","slug":"error-getting-account-credentials-v","errorCode":null,"errorMessage":"error getting account credentials: %v","messagePattern":"error getting account credentials: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/model_credentials.go","lineNumber":134,"sourceCode":"\tfor pub := range grouped {\n\t\tsort.SliceStable(grouped[pub], func(i, j int) bool {\n\t\t\treturn grouped[pub][i].Priority < grouped[pub][j].Priority\n\t\t})\n\t}\n\treturn grouped\n}\n\nfunc checkProviderCredentialStatus(cfg *shared.ModelProviderConfigSchema, authVars map[string]string) (ProviderAuthStatus, []string, error) {\n\tvar missing []string\n\n\tif cfg.SkipAuth {\n\t\treturn FullySatisfied, nil, nil\n\t}\n\n\tif cfg.HasClaudeMaxAuth {\n\t\tcreds, err := GetAccountCredentials()\n\t\tif err != nil {\n\t\t\treturn FullyMissing, nil, fmt.Errorf(\"error getting account credentials: %v\", err)\n\t\t}\n\t\tif creds == nil || creds.ClaudeMax == nil {\n\t\t\treturn FullyMissing, nil, nil\n\t\t}\n\t}\n\n\tif cfg.ApiKeyEnvVar != \"\" && authVars[cfg.ApiKeyEnvVar] == \"\" {\n\t\tmissing = append(missing, cfg.ApiKeyEnvVar)\n\t}\n\n\tfor _, extra := range cfg.ExtraAuthVars {\n\t\tif extra.Required && authVars[extra.Var] == \"\" {\n\t\t\tmissing = append(missing, extra.Var)\n\t\t}\n\t}\n\n\tnumRequired := 0\n\tfor _, extra := range cfg.ExtraAuthVars {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/model_credentials.go#L116-L152","documentation":"checkProviderCredentialStatus returns this when cfg.HasClaudeMaxAuth and GetAccountCredentials() fails while reading the local account-credential store. The provider is graded FullyMissing and the error bubbles up through CheckCredentialStatus as 'error checking API keys/credentials'.","triggerScenarios":"Grading any provider whose config has HasClaudeMaxAuth when GetAccountCredentials returns an error — credentials file unreadable, corrupt JSON, or a storage backend failure.","commonSituations":"Corrupt credentials store after an interrupted write, file permissions too strict (different user in CI), or missing HOME so the store path cannot be resolved.","solutions":["Re-authenticate to regenerate the credentials store.","Fix file permissions on the credentials file/directory.","Inspect the wrapped %v error for the exact storage/parse failure and address it.","If Claude Max auth is not needed, remove HasClaudeMaxAuth from the provider config or skip it via claudeMaxEnabled=false."],"exampleFix":"// before\nif cfg.HasClaudeMaxAuth {\n    creds, err := GetAccountCredentials()\n    if err != nil { return FullyMissing, nil, fmt.Errorf(...) }\n// after\nif cfg.HasClaudeMaxAuth {\n    creds, err := GetAccountCredentials()\n    if err != nil {\n        log.Printf(\"account credentials unavailable, treating as missing: %v\", err)\n        return FullyMissing, nil, nil // degrade instead of failing the whole check\n    }","handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(credentialsStorePath()); err != nil {\n    log.Printf(\"credentials store missing: %v\", err) // treat Claude Max providers as FullyMissing\n}","typeGuard":null,"tryCatchPattern":"creds, err := GetAccountCredentials()\nif err != nil {\n    log.Printf(\"account credentials unavailable: %v\", err)\n    return FullyMissing, nil, nil // degrade instead of failing\n}","preventionTips":["Repair/re-login when the store is corrupt rather than retrying","Set HOME explicitly in CI/service contexts","Verify store permissions after OS/user changes","Provide a non-ClaudeMax fallback provider"],"tags":["credentials","auth","claude-max"],"backgroundTag":"account-credentials-unavailable","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"}