anthropic-sdk-python icon indicating copy to clipboard operation
anthropic-sdk-python copied to clipboard

Bedrock Frequently Has Server-side Errors

Open kevinlu1248 opened this issue 2 years ago • 6 comments

Likely unrelated to the client but I'm getting this pretty frequently on Anthropic Bedrock.

anthropic.APIStatusError: Error code: 424 - {'message': 'The system encountered an unexpected error during processing. Try your request again.'}

Also, it seems like this replace the other issue from: https://github.com/anthropics/anthropic-sdk-python/issues/418, so that issue should be resolved now.

kevinlu1248 avatar Apr 02 '24 20:04 kevinlu1248

I'm also coming up against this error though Bedrock. Would it make sense to simply add handling for 424 in BaseClient._should_retry?

costa-paxton avatar May 21 '24 18:05 costa-paxton

Ah, yes, that does sound like a good idea. We'll take a look at that.

rattrayalex avatar May 26 '24 01:05 rattrayalex

Is this something we should handle on our own in the meantime? Any guidance?

mtliendo avatar Apr 05 '25 04:04 mtliendo

Hey, sorry for the delay in addressing this. This is really more of a Bedrock API issue – they should probably be returning a 5xx for this – but we'll take another look at merging #583 or equivalent.

rattrayalex avatar Apr 07 '25 03:04 rattrayalex

I added logic to work around this over six months ago and I've just persuaded my team not to merge a PR that layered on our own retries on top of the Anthropic retry system but now I'm not convinced that's right coming back here and realising this still isn't fixed after two years.

It would appear that the SDK's retry mechanisms are not being given very much attention and perhaps we would be best to disable them and just roll our own handling. At the moment we're already having to handle this 429 plus some other corner cases where the SDK seems to not retry on streaming operations.

Can Anthropic commit to getting on top of this, or perhaps they can more clearly document the limitations of the retry mechanisms embedded in the SDK so users know what else to layer on?

Edit: Just seen this seems to be at least partially owned by Stainless. Perhaps Anthropic should take ownership of their SDK.

sihil avatar Mar 27 '26 12:03 sihil

Gonna close this one given the staleness. Feel free to open a new one if these errors are still showing up!

dtmeadows-ant avatar Aug 06 '26 17:08 dtmeadows-ant