zed-industries/zed · error
{}
Error message
{} What it means
The Bedrock provider streams via invoke_with_response_stream and surfaces any error received on the event stream by formatting it with the AWS SDK's DisplayErrorContext, which renders the full error chain (service exception, message, request id). The text after this wrapper varies with the underlying AWS error.
Source
Thrown at crates/bedrock/src/bedrock.rs:128
ConverseStreamError::InternalServerException(e) => {
BedrockError::InternalServer(
e.message().unwrap_or("internal server error").to_string(),
)
}
_ => BedrockError::Other(err.into()),
}
}
other => BedrockError::Other(other.into()),
});
let stream = Box::pin(stream::unfold(
output?.stream,
move |mut stream| async move {
match stream.recv().await {
Ok(Some(output)) => Some((Ok(output), stream)),
Ok(None) => None,
Err(err) => Some((
Err(anyhow!(
"{}",
aws_sdk_bedrockruntime::error::DisplayErrorContext(err)
)),
stream,
)),
}
},
));
Ok(stream)
}
pub fn aws_document_to_value(document: &Document) -> Value {
match document {
Document::Null => Value::Null,
Document::Bool(value) => Value::Bool(*value),
Document::Number(value) => match *value {
AwsNumber::PosInt(value) => Value::Number(Number::from(value)),View on GitHub (pinned to bc538def45)
Solutions
- Read the inner AWS error in the message and act on it: AccessDeniedException - request model access in the Bedrock console for that region; ThrottlingException - retry with backoff or raise limits.
- Verify setup: `aws bedrock list-foundation-models --region <region>` and `aws sts get-caller-identity`.
- Retry transient errors (throttling, 500s) with exponential backoff.
- Match the model to a region where it is available, or use a cross-region inference profile.
Defensive patterns
Strategy: retry
Validate before calling
// pre-flight: credentials, region, and model access
let models = bedrock
.list_foundation_models()
.region(region.clone())
.send()
.await?;
anyhow::ensure!(
models.summaries().iter().any(|m| m.model_id() == Some(model_id)),
"model not available in {region}"
); Try / catch
match the DisplayErrorContext text: ThrottlingException/ServiceUnavailable -> exponential backoff and re-issue the request; AccessDeniedException/ExpiredToken -> stop and re-authenticate (do not retry); ValidationException -> fix the request before retrying.
Prevention
- Request model access per region in the Bedrock console
- Use cross-region inference profiles to spread throughput
- Refresh assumed-role credentials before long streams
- Wrap Bedrock streams in retry-with-backoff middleware
When it happens
Trigger: stream.recv() returns Err mid-generation inside the stream::unfold loop: ThrottlingException (throughput exceeded), AccessDeniedException (model access not enabled in the account/region), ExpiredToken/credential errors, ValidationException (context too long), or server-side 500s.
Common situations: Claude model access not granted in the target Bedrock region; assumed-role credentials expiring during long generations; bursting past provisioned throughput; using a region where the model is unavailable.
Related errors
- Unsupported Region {region}
- tool input was not fully received
- Anthropic streamed a compaction delta before starting its co
- Anthropic ended the stream without finishing its compaction
AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16).
Data as JSON: /api/errors/780b1c0b96b5917c.
Report an issue: GitHub.