{"record":{"id":"9b3b19743357ed18","repo":"quickwit-oss/quickwit","slug":"lambda-function-did-not-become-ready-within","errorCode":null,"errorMessage":"lambda function '{}' did not become ready within {} seconds","messagePattern":"lambda function '(.+?)' did not become ready within (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-lambda-client/src/deploy.rs","lineNumber":509,"sourceCode":"        if is_active && last_update_status == &LastUpdateStatus::Successful {\n            info!(\n                function_name = %function_name,\n                attempts = attempt + 1,\n                \"lambda function is ready\"\n            );\n            return Ok(());\n        }\n\n        info!(\n            function_name = %function_name,\n            state = ?config.state(),\n            last_update_status = ?config.last_update_status(),\n            attempt = attempt + 1,\n            \"waiting for Lambda function to be ready\"\n        );\n    }\n\n    anyhow::bail!(\n        \"lambda function '{}' did not become ready within {} seconds\",\n        function_name,\n        MAX_WAIT_ATTEMPTS as u64 * WAIT_INTERVAL.as_secs()\n    )\n}\n\n/// Garbage collect old Lambda versions, keeping the current + 5 most recent.\nasync fn garbage_collect_old_versions(\n    client: &LambdaClient,\n    function_name: &str,\n    current_version: &str,\n) -> anyhow::Result<()> {\n    let mut quickwit_lambda_versions: Vec<(u64, String)> = Vec::new();\n    let mut marker: Option<String> = None;\n\n    // Collect all Quickwit-managed versions\n    loop {\n        let mut request = client","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-lambda-client/src/deploy.rs#L491-L527","documentation":"Thrown by wait_for_function_ready when the Lambda function does not reach a ready (Successful/Non-published) LastUpdateStatus within MAX_WAIT_ATTEMPTS * WAIT_INTERVAL seconds. The caller polls until the update completes; the bail fires on timeout.","triggerScenarios":"Calling update_function_code when Lambda takes longer than the hard-coded timeout (~MAX_WAIT_ATTEMPTS poll cycles) to finish publishing the new code, e.g. very large packages or slow Lambda-side processing.","commonSituations":"Deploying very large lambda artifacts over slow network/Lambda processing; temporary Lambda service slowness; the poll loop being too short for the deployment size.","solutions":["Increase MAX_WAIT_ATTEMPTS or WAIT_INTERVAL in quickwit-lambda-client/src/deploy.rs and rebuild","Check the Lambda function's state in the AWS console; the update may complete after the timeout","Retry the deployment with a longer client-side wait","Reduce package size to speed up Lambda's publish step"],"exampleFix":"// before\nconst MAX_WAIT_ATTEMPTS: u32 = 60;\nconst WAIT_INTERVAL: Duration = Duration::from_secs(5);\n// after\nconst MAX_WAIT_ATTEMPTS: u32 = 180;\nconst WAIT_INTERVAL: Duration = Duration::from_secs(5);","handlingStrategy":"retry","validationCode":"let start = std::time::Instant::now();\nlet timeout = Duration::from_secs(300);\n// pass a wait budget >= expected publish time for your package size","typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match update_and_wait(...).await {\n        Err(e) if e.to_string().contains(\"did not become ready\") => continue,\n        other => break other,\n    }\n}","preventionTips":["Size the wait timeout relative to deployment package size","Verify Lambda function state in AWS if timeouts recur","Avoid deploying very large packages during Lambda service degradation"],"tags":["aws","lambda","timeout","deployment"],"backgroundTag":"request-timeout","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}