claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

JSON Parsing Error: Invalid Low Surrogate in Request Body

Open yunqiqiliang opened this issue 6 months ago • 2 comments

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 81796 (char 81795)"}}

请继续 ⎿ 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 81759 (char 81758)"}}

/compact ⎿ Error: Error during compaction: Error: 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 76767 (char 76766)"}}

Environment Info

  • Platform: macos
  • Terminal: vscode
  • Version: 1.0.17
  • Feedback ID: 2d09c7a9-c6e0-4647-9a20-f4f3804c4c49

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:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at checkExecSyncError (node:child_process:890:11)\n    at execSync (node:child_process:962:15)\n    at YZ (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n    at file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n    at Q (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n    at cJ (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n    at aP (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n    at a6 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)","timestamp":"2025-06-09T04:04:14.727Z"},{"error":"Error: Command failed: security delete-generic-password -a $USER -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at checkExecSyncError (node:child_process:890:11)\n    at execSync (node:child_process:962:15)\n    at YZ (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n    at HfA (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:12906)\n    at KfA (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:12780)\n    at v1A (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2034:2569)\n    at g1A.startOAuthFlow (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2034:3705)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-09T04:04:34.727Z"},{"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:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at checkExecSyncError (node:child_process:890:11)\n    at execSync (node:child_process:962:15)\n    at YZ (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n    at file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n    at Q (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n    at cJ (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n    at aP (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n    at a6 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)","timestamp":"2025-06-09T04:04:34.797Z"},{"error":"ShellError: Shell command failed\n    at Object.call (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1573:1326)\n    at async iZ5 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n    at async WK1 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n    at async cZ5 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16794)\n    at async uZ5 (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16423)\n    at async NO (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:15452)\n    at async NO (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16278)\n    at async NO (file:///Users/liangmo/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1896:16

Note: Error logs were truncated.

yunqiqiliang avatar Jun 09 '25 08:06 yunqiqiliang

  ⎿ 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 226723 (char 
    226722)"}}

> **Prompt**?
  ⎿ 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 226723 (char 
    226722)"}}

> **Prompt**?
  ⎿ 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 226723 (char 
    226722)"}}

I'm getting the same erro

naren200 avatar Jun 13 '25 22:06 naren200

i've started getting this all the time. Also on macos, using the regular terminal.

interior-night avatar Jun 15 '25 11:06 interior-night

Image me too

oceandi avatar Jul 03 '25 05:07 oceandi

me too :~

wennycooper avatar Jul 05 '25 04:07 wennycooper

I'm getting the same. So I guess Claude was vibe coded...

Image Image

n0Sp00n avatar Jul 09 '25 08:07 n0Sp00n

me too in win

siri666666 avatar Jul 13 '25 06:07 siri666666

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 239091 (char 239090)"}}

How To fix this?

gilsonherbst avatar Jul 13 '25 18:07 gilsonherbst

only way that works for me is to press esc go 3-4 messages back, i manually copy the previous lines upto the esc so it doesn't lose context of the forward converesation.

ramakay avatar Jul 14 '25 00:07 ramakay

Same here, I think it the .claude.json file that gets corrupted line 1 column 239091 (char 239090)"}} is from that file, it gets really big and sometimes corrupted, when if you run a /clear command it deletes full history for that repo but at least it will work again. You could ask claude code to open claude.json and see what the issue is on that line :-)

jaspergreen avatar Jul 17 '25 07:07 jaspergreen

Probably Claude was vibe-coded :)

On Thu, Jul 17, 2025 at 10:59 AM jaspergreen @.***> wrote:

jaspergreen left a comment (anthropics/claude-code#1832) https://github.com/anthropics/claude-code/issues/1832#issuecomment-3083026628

Same here, I think it the .claude.json file that gets corrupted line 1 column 239091 (char 239090)"}} is from that file, it get really big and sometimes corrupted, when if you run a /clear command it deletes full history for that repo but at least it will work again. You could as claude code to open claude.json and see what the issue is on that line :-)

— Reply to this email directly, view it on GitHub https://github.com/anthropics/claude-code/issues/1832#issuecomment-3083026628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4TY46EOGNF7HU4XBB4VX33I5JVTAVCNFSM6AAAAAB64KC47CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAOBTGAZDMNRSHA . You are receiving this because you commented.Message ID: @.***>

-- Kind regards, Tsvetan Dimitrov https://calendly.com/dimitrovovich

n0Sp00n avatar Jul 17 '25 08:07 n0Sp00n

any updates to that error?

olbo22 avatar Jul 23 '25 16:07 olbo22

same

Atsumi3 avatar Jul 28 '25 06:07 Atsumi3

same here, using max plan

tientv avatar Jul 28 '25 09:07 tientv

Anthropic's has to start hiring real engineers and not vibe coders.

Kind regards, Tsvetan Dimitrov https://calendly.com/dimitrovovich

On Mon, 28 Jul 2025 at 11:58, TienTran @.***> wrote:

tientv left a comment (anthropics/claude-code#1832) https://github.com/anthropics/claude-code/issues/1832#issuecomment-3126474749

same here, using max plan

— Reply to this email directly, view it on GitHub https://github.com/anthropics/claude-code/issues/1832#issuecomment-3126474749, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4TY44ALYQ7JZ4HDAEFXWD3KXX4JAVCNFSM6AAAAAB64KC47CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMRWGQ3TINZUHE . You are receiving this because you commented.Message ID: @.***>

n0Sp00n avatar Jul 28 '25 10:07 n0Sp00n

same here

timobehrens avatar Aug 10 '25 07:08 timobehrens

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.

github-actions[bot] avatar Sep 04 '25 14:09 github-actions[bot]