Network Timeout Errors Occurring Frequently in API Calls

Resolved 💬 30 comments Opened Feb 26, 2025 by ppamment Closed May 5, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
ApiError: read ETIMEDOUT happening almost every request. Some response tokens are generated, but it halts after a short whle with this error

Environment Info

  • Platform: linux
  • Terminal: undefined
  • Version: 0.2.9
  • Feedback ID: 27c8403f-88b9-4205-8e8c-5e8f1af9e755

View original on GitHub ↗

30 Comments

bcherny collaborator · 1 year ago

Are you using 1P API, Bedrock, or Vertex?

ppamment · 1 year ago

1P API, assuming you mean Anthropic 1st party API?

ppamment · 1 year ago

Still same thing happening, Emphasis added by me.

● I'll analyze your zsh configuration and update your fish config. Let me check the files first.

● Search(pattern: ".zshrc")…
  ⎿  Found 1 file

● Search(pattern: ".oh-my-zsh/**")…
  ⎿  Found 100 files

● Search(pattern: "~/.config/fish/config.fish")…
  ⎿  Found 0 files

● Search(pattern: "/home/user/.config/fish/**")…
  ⎿  Found 29 files
  ⎿  API Error: read ETIMEDOUT

continue
  • Noodling… (237s · esc to interrupt)
  • ⎿  API Error: Socket timeout
/doctor

! ping anthropic.com
  ⎿  PING anthropic.com (160.79.104.10) 56(84) bytes of data.
64 bytes from 160.79.104.10 (160.79.104.10): icmp_seq=1 ttl=52 time=14.6 ms
64 bytes from 160.79.104.10: icmp_seq=2 ttl=52 time=18.0 ms
  ⎿  Terminated
Exit code 143

ok continue then

● Let me examine your zsh and fish configurations to transfer your custom functionality.

● Read(file_path: ".zshrc")…
  ⎿  # If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
... (+158 lines)

● Read(file_path: ".config/fish/config.fish")…
  ⎿  if status is-interactive
# Commands to run in interactive sessions can go here
end
... (+1 lines)

● Let me update your fish config with the equivalent functionality from your zsh setup:

● Write(file_path: .config/fish/config.fish)…
⎿ Updated .config/fish/config.fish with 63 additions and 1 removal
1 if status is-interactive
2 # Commands to run in interactive sessions can go here
3 end
REDACTED
66 \ No newline at end of file

∗ Herding… (324s · esc to interrupt)

And we seem to be stuck again. Running WSL2 ubuntu with SHELL=/bin/bash claude as I read on another issue it ca have issues with zsh

bcherny collaborator · 1 year ago

Looking into it -- thanks for the report

behrangsa · 1 year ago

I also have the same problem. I am using Proton VPN.

sjsage522 · 1 year ago

I also have the same problem.

⏺ Bash(cd /path/my-project && ./gradlew build -i)…
  ⎿  Error: spawnSync /bin/sh ETIMEDOUT

pseudotensor · 1 year ago

Direct access with no other internet issues. claude code not responding anymore.

  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
  ⎿  API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
  ⎿  API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
  ⎿  API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
  ⎿  API Error (Request timed out.) · Retrying in 17 seconds… (attempt 6/10)
  ⎿  API Error (Request timed out.) · Retrying in 37 seconds… (attempt 7/10)
  ⎿  API Error (Request timed out.) · Retrying in 34 seconds… (attempt 8/10)
itsmikethetech · 1 year ago

Having the same issue here.

             this.network = new NetworkManager(this);
     … +758 lines (ctrl+r to expand)
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
  ⎿  API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
SamDc73 · 1 year ago
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
  ⎿  API Error (Request timed out.) · Retrying in 1 seconds… (attempt 3/10)
  ⎿  API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
✻ Displaying… (282s · ↑ 0 tokens · esc to interrupt · offline)

Getting the same problem ! I'm only 2 messages into the conversation !

bcherny collaborator · 1 year ago

This happens occasionally during peak API load times. Wait a bit and try again when it happens. Working on making these less frequent.

maksimmuravev · 1 year ago

It happens every day. Can switching to the Max plan reduce the issue's intensity? Also, what should I type when it breaks during a working pipeline? Will continue be enough?

titov-d · 1 year ago

@maksimmuravev I'm on Max plan, but I also have this issue.

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 5 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 19 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 7/10)

DylanG157 · 1 year ago
@maksimmuravev I'm on Max plan, but I also have this issue. ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10) ⎿ API Error (Request timed out.) · Retrying in 5 seconds… (attempt 4/10) ⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10) ⎿ API Error (Request timed out.) · Retrying in 19 seconds… (attempt 6/10) ⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 7/10)

I was having the same issue, and then I uninstalled the claude code npm package and then downloaded it again on my wsl ubuntu "npm install -g @anthropic-ai/claude-code"
I did this because I ran that /doctor and it mentioned it could not update my package

Not sure if this will help, but worth a shot!

Update - Ran into the issue again shortly after, then picked up I had a local install of claude and global
Seems to be working again after removing the local install and just having the global install

michalss · 1 year ago

Same here still api time out..

MaximCrabbe · 1 year ago

Yes on windows PC it works perfect for me. I used it 10 hours today there. Now and then I also want to use claude code on ubuntu server... What a joke, the first 2 commands work maybe, then it API errors 10 out of 10 attempts and fails. This is such a shame because claude code also would be a great help to help me on my server at times... I got the most expensive Max license btw

owenmead · 1 year ago

Your VPN might be causing or worsening the problem. If you're using a popular VPN, you could be encountering rate limits due to many users sharing the same connection node. Try disabling your VPN to see if the issue goes away.

mrgrupprr · 1 year ago

Hey, there same issue for me too with and without Vpn.

abhagsain · 1 year ago

I'm not even using a VPN, and I'm still facing the issue. What's the point of paying $200/month :/

!Image

MaximCrabbe · 1 year ago

I am not using a VPN or a firewall. I am not saying my network is perfect, but atleast --debug or something should give more info for this problem.

abhagsain · 1 year ago
I am not using a VPN or a firewall. I am not saying my network is perfect, but atleast --debug or something should give more info for this problem.

I'm using Claude in WindSurf and if you use --debug, the entire terminal gets filled with the debug logs and you can't scroll up/down to see the issue. I haven't tried it in the native terminal yet

sosno · 1 year ago

I'm having the same issues. I've tried with and without a VPN. Not sure what's going on with it. Every once in a while it works for easy tasks, which makes me believe that Claude Code utilizes different agents for different tasks, and one of the important agents may not be working? Not sure. I don't know much about the inner workings.

I'll add I've been encountering this issue for 3 days, ever since I installed claude code, so it's not that Claude servers are down.

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 8 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 18 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 35 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 34 seconds… (attempt 10/10)

pruthvi-itribe · 1 year ago

same issue occuring, but on restarting laptop its working fine , but restarting everytime doesn't make sense, not sure if its due to some DNS cache clearing or another server getting allocated when restarting laptop

maksimmuravev · 1 year ago

<img width="974" alt="Image" src="https://github.com/user-attachments/assets/b8daa16a-13d5-4a79-8530-7ac41efeaaa6" />

Half of the requests end up the same way — no VPN and a Cyprus location. I guess they prioritize based on some algorithm since this keeps happening. I'm not sure what to do. Sometimes, restarting the claude binary helps.

Update: Another workaround is to open multiple windows—4 work for me. Run claude --continue in each. When one starts working well, close the others.

vec715 · 1 year ago

+1, having the same issues, almost unusable rn

vec715 · 1 year ago

why this issue is closed?

andrej-suty · 1 year ago

Try switching to public DNS (8.8.8.8 or 1.1.1.1) in wsl, it worked for me.

In wsl:
sudo nano /etc/resolv.conf

Add:
nameserver 8.8.8.8
nameserver 1.1.1.1

And restart wsl.

ivan-velikanov · 1 year ago

For the record @andrej-suty 's method seems to work
also pls. note. You may need to edit /etc/wsl.conf and add

[network]
generateResolvConf = false

[boot]
command = "echo 'nameserver 8.8.8.8' > /etc/resolv.conf && echo 'nameserver 1.1.1.1' >> /etc/resolv.conf"

to prevent settings from getting erased or overwritten by the default values when wsl is shutdown and restarted. This should make things more stable.

luis15pt · 1 year ago

The comment that helped me was to open another terminal with claude --continue and then close the one with the API issues.

maksimmuravev · 11 months ago

Fully uninstall Little Snitch from your macOS. Just disabling it or setting it to ALL ON won't solve the problem. No need to say thank you.

github-actions[bot] · 11 months ago

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.