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

Frequent 504 Gateway Timeout errors from api.anthropic.com

Open ty13r opened this issue 1 year ago • 14 comments

Description

Experiencing frequent and random 504 Gateway Timeout errors when using Claude Code, which significantly impacts productivity.

Error Details

API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 5 seconds… (attempt 4/10)
⎿  API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 9 seconds… (attempt 5/10)
⎿  API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 16 seconds… (attempt 6/10)
⎿  API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 35 seconds… (attempt 7/10)
⎿  API Error (api.anthropic.com | 504: Gateway time-out) · Retrying in 34 seconds… (attempt 8/10)

I'm now having difficulty recovering my session, even after the agent responded: Image

Frequency

These errors occur randomly during normal usage, often requiring multiple retry attempts before succeeding.

Impact

  • Interrupts workflow
  • Causes delays in development
  • Sometimes requires 8+ retry attempts

Environment

  • Claude Code CLI
  • Platform: macOS (Darwin 23.5.0)
  • Date observed: 2025-08-29

Expected Behavior

API calls should complete successfully without frequent gateway timeouts.

Additional Context

The retry mechanism does eventually succeed in most cases, but the frequency of these errors suggests there may be an infrastructure or rate limiting issue that needs investigation.

Workaround:

I was able to recover my session task by asking the agent to break out the output file into seperate smaller files.

Image

I got it to write one file, but now it's stuck again:

Image

Here's a screenshot of my current context usage for whomever at anthropic works on debugging this issue: Image

ty13r avatar Aug 29 '25 01:08 ty13r

Same here. It starts out working ok but as context length grows I run into these errors. I think #6781 is the same issue.

dimfeld avatar Aug 29 '25 01:08 dimfeld

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/6781

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 29 '25 01:08 github-actions[bot]

same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback

roy-law avatar Aug 29 '25 01:08 roy-law

For more context: Image

roy-law avatar Aug 29 '25 01:08 roy-law

same here. It started from 6pm EST onwards. very confusing and frustrating. Just reached out to support team but haven't got any feedback

https://status.anthropic.com/ not showing any outages.

ty13r avatar Aug 29 '25 01:08 ty13r

same here

eyal-spexsai avatar Aug 29 '25 01:08 eyal-spexsai

Full Context Image Image

Suketug avatar Aug 29 '25 01:08 Suketug

Same here

a7asoft avatar Aug 29 '25 01:08 a7asoft

So, here is what happened, after the error I hit:

Image

Suketug avatar Aug 29 '25 01:08 Suketug

Not sure if this has anything to do with it, but they just updated their status page:

Image

ty13r avatar Aug 29 '25 01:08 ty13r

I think it's resolved and working fine for me now.

Suketug avatar Aug 29 '25 02:08 Suketug

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.

github-actions[bot] avatar Dec 05 '25 10:12 github-actions[bot]

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] avatar Jan 05 '26 10:01 github-actions[bot]

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 Jan 12 '26 14:01 github-actions[bot]