gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

✕ [API Error: exception TypeError: fetch failed sending request]

Open CHANDRAMOHANnegi opened this issue 2 months ago • 3 comments

What happened?

✕ [API Error: exception TypeError: fetch failed sending request]

What did you expect to happen?

It should work properly

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

CLI Version 0.20.2 │ │ Git Commit af894e46-8 │ │ Model auto │ │ Sandbox no sandbox │ │ OS darwin │ │ Auth Method gemini-api-key

> /about
# paste output here

Login information

No response

Anything else we need to know?

tried this : https://github.com/google-gemini/gemini-cli/issues/3426

No response

CHANDRAMOHANnegi avatar Dec 13 '25 18:12 CHANDRAMOHANnegi

Hi! Can you provide repro info for this? Is it always happening or just once?

chrstnb avatar Dec 15 '25 16:12 chrstnb

It is always happening for me,

echo $https_proxy
echo $http_proxy
echo $HTTPS_PROXY
echo $HTTP_PROXY

All above info is empty for me, but it is working for my teammates.

Reproduce info:

  1. type gemini in terminal
  2. type anything in input box
Image

CHANDRAMOHANnegi avatar Dec 15 '25 16:12 CHANDRAMOHANnegi

{
  "error": {
    "message": "exception TypeError: fetch failed sending request",
    "stack": "Error: exception TypeError: fetch failed sending request\n    at file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/genai/dist/node/index.mjs:11550:19\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async Models.generateContentStream (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/genai/dist/node/index.mjs:12859:24)\n    at async file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/loggingContentGenerator.js:121:26\n    at async retryWithBackoff (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/utils/retry.js:75:28)\n    at async GeminiChat.makeApiCallAndProcessStream (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:380:32)\n    at async GeminiChat.streamWithRetries (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/geminiChat.js:234:40)\n    at async Turn.run (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/turn.js:60:30)\n    at async GeminiClient.sendMessageStream (file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/core/client.js:392:26)\n    at async file:///opt/homebrew/Cellar/gemini-cli/0.20.2/libexec/lib/node_modules/@google/gemini-cli/dist/src/ui/hooks/useGeminiStream.js:485:26"
  },
  "context": [
    {
      "role": "user",
      "parts": [
        {
          "text": "This is the Gemini CLI. We are setting up the context for our chat.\nToday's date is Tuesday, December 16, 2025 (formatted according to the user's locale).\nMy operating system is: darwin\nThe project's temporary directory is: /Users/abc/.gemini/tmp/1feb3521b4022932acbda057ad0f7eb7b792e3e7659b9e49240ffdfc80fd4bd7\nI'm currently working in the directory: /Users/abc/z/x\nHere is the folder structure of the current working directories:\n\nShowing up to 200 items (files + folders). Folders or files indicated with ... contain more items not shown, were ignored, or the display limit (200 items) was reached....: Do not return an empty response when a tool call is required.\n\nMy setup is complete. I will provide my first command in the next turn."
        }
      ]
    },
    {
      "role": "user",
      "parts": [
        {
          "text": "hi"
        }
      ]
    },
    {
      "role": "user",
      "parts": [
        {
          "text": "hi"
        }
      ]
    }
  ]
}

CHANDRAMOHANnegi avatar Dec 16 '25 04:12 CHANDRAMOHANnegi

ping 216.239.36.223

Does it work ?

I had the same issue, and it started working for me once my network was working again.

NoahStepheno avatar Jan 03 '26 05:01 NoahStepheno

ping 216.239.36.223 this command works but gemini-cli is not working

CHANDRAMOHANnegi avatar Jan 05 '26 08:01 CHANDRAMOHANnegi

Closing this as we are unable to duplicate. Please reopen with more steps required to reproduce this issue if you're able.

bdmorgan avatar Jan 21 '26 13:01 bdmorgan