claude-code
claude-code copied to clipboard
Invalid JSON Parsing Error in API Request Body
Bug Description API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The request body is not valid JSON: no low surrogate in string: line 1 column 27572 (char 27571)"}} Getting this error when I am working on a particilar file.
Environment Info
- Platform: macos
- Terminal: Apple_Terminal
- Version: 1.0.17
- Feedback ID: 4e626193-3003-4c6e-a71e-168fb1c6d248
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 YZ (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n at file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n at Q (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n at cJ (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n at aP (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n at a6 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)","timestamp":"2025-06-12T03:06:29.367Z"},{"error":"ShellError: Shell command failed\n at Object.call (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1573:1326)\n at async iZ5 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n at async WK1 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n at async cZ5 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16794)\n at async uZ5 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16423)\n at async NO (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:15452)\n at async dZ (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2328:2123)","timestamp":"2025-06-12T03:06:51.813Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The request body is not valid JSON: no low surrogate in string: line 1 column 35385 (char 35384)\"}}\n at Y5.generate (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1338:12578)\n at Kw.makeStatusError (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1353:2082)\n at Kw.makeRequest (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1353:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Qw2.ae.showErrors (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:20863)\n at async ae (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:12252)\n at async Qw2 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:20726)\n at async file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:17149\n at async vo1 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:5204)\n at async dd (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:17119)","timestamp":"2025-06-12T03:06:52.541Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The request body is not valid JSON: no low surrogate in string: line 1 column 35348 (char 35347)\"}}\n at Y5.generate (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1338:12578)\n at Kw.makeStatusError (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1353:2082)\n at Kw.makeRequest (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1353:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Qw2.ae.showErrors (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:20863)\n at async ae (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:12252)\n at async Qw2 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:20726)\n at async file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:17149\n at async vo1 (file:///Users/naveen/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1680:5204)\n at async dd (file:///Users/naveen/.claude/local
Note: Error logs were truncated.
Hey Naveen,
Can ask Claude to find the error in the file? or give you the command to verify JSON?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.