claude-code
claude-code copied to clipboard
API Request Failure: Unhandled Error Without Detailed Error Response
Bug Description continuously getting api error but without any explanation
Environment Info
- Platform: macos
- Terminal: cursor
- Version: 1.0.9
- Feedback ID: bc47d143-4cdf-4ae7-8e9e-2a8a931bcabe
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:882:11)\n at execSync (node:child_process:954:15)\n at IZ (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:638:3921)\n at file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:6771\n at Q (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17069)\n at ml (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:5963)\n at WG (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:5409)\n at fq2 (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2004:4707)","timestamp":"2025-06-03T10:48:29.054Z"},{"error":"Error: Connection error.\n at rz.makeRequest (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:4386)","timestamp":"2025-06-03T11:05:19.323Z"},{"error":"Error: Connection error.\n at rz.makeRequest (file:///Users/jwinter/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1351:4386)","timestamp":"2025-06-03T11:11:33.779Z"}]
The error message appears to indicate that you are missing a secret in your keychain called "Claude Code" - did you perhaps delete that one?
Posting your ~/.claude/settings.json would be helpful. You probably have an apiKeyHelper defined that uses the security command to get the secret?
The strange thing is that I don't get this at all when I run in my iTerm2 terminal. That error happens in cursor for me consistently.
That could be because MacOS allows iTerm2 to access the keychain whereas for some reason it is not allowing Cursor to do so.
cat ~/.claude/settings.json cat: /Users/jwinter/.claude/settings.json: No such file or directory
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.