quickwit-oss/quickwit · error
lambda function ' ' is in Failed state
Error message
lambda function '{}' is in Failed state: {} What it means
wait_for_function_ready polls the Lambda function configuration until the function is Active. If the poll observes State == Failed, it bails with the function name and AWS-provided state reason, since a Failed Lambda state is terminal and will never become ready.
Solutions
- Read the state_reason in the error message and fix the underlying deployment issue (package, image, role, or VPC config).
- Retry the update with a valid function code/artifact (check the artifact URL and SHA256 configured in build.rs).
- Delete and recreate the function if it is stuck in Failed state after repeated update attempts.
Defensive patterns
Strategy: try-catch
Try / catch
match wait_for_function_ready(&lambda, "my-function", timeout).await {
Ok(_) => { /* function active */ }
Err(e) if e.to_string().contains("is in Failed state") => {
// terminal failure: read the reason, fix deployment inputs, do not keep polling
}
Err(e) => { /* transient: may retry within timeout */ }
} Prevention
- Validate the deployment package/container image and IAM role before updating.
- Monitor Lambda State/StateReason after updates instead of waiting for readiness blindly.
- Keep the artifact URL and SHA256 in build.rs current and reachable.
When it happens
Trigger: Polling during update_function_code (or directly) when GetFunctionConfiguration returns State=Failed with a state_reason (e.g., failed deployment, image pull error, invalid package/permissions).
Common situations: Bad Lambda deployment package or container image; insufficient Lambda execution role permissions; VPC/network misconfiguration causing the function create/update to fail; stale artifact URL/SHA in the lambda client build script.
Related errors
- 1 is always non-zero.
- 60 should be non-zero
- ack_id not found in in-flight
- `append_records` should be called with `position_opt: None`
- `assign_jobs` should return at least one client or fail.
AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08).
Data as JSON: /api/errors/d3a10ee03c9a879e.
Report an issue: GitHub.
Appendix: source
Thrown at quickwit/quickwit-lambda-client/src/deploy.rs:467
for attempt in 0..MAX_WAIT_ATTEMPTS {
interval.tick().await;
let response = client
.get_function()
.function_name(function_name)
.send()
.await
.context("failed to get function status")?;
let Some(config) = response.configuration() else {
continue;
};
// Check for terminal failure states.
if config.state() == Some(&State::Failed) {
let reason = config.state_reason().unwrap_or("unknown reason");
anyhow::bail!(
"lambda function '{}' is in Failed state: {}",
function_name,
reason
);
}
let last_update_status: &LastUpdateStatus = config
.last_update_status()
.unwrap_or(&LastUpdateStatus::Successful);
if last_update_status == &LastUpdateStatus::Failed {
let reason = config
.last_update_status_reason()
.unwrap_or("unknown reason");
anyhow::bail!(
"lambda function '{}' last update failed: {}",
function_name,
reasonView on GitHub (pinned to a39730c5cd)