{"record":{"id":"2904993e45ff46ec","repo":"vectordotdev/vector","slug":"pagefind-is-unavailable","errorCode":null,"errorMessage":"Pagefind is unavailable.","messagePattern":"Pagefind is unavailable\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"website/assets/js/search.tsx","lineNumber":83,"sourceCode":"  return records\n    .filter((record) =>\n      record.aliases.some((alias) => {\n        const normalizedAlias = normalizeSearchTerm(alias);\n        const exactMatch = normalizedAlias === normalizedQuery;\n        const vrlPrefixMatch =\n          record.category === \"VRL function\" &&\n          normalizedQuery.length >= minVrlPrefixLength &&\n          normalizedAlias.startsWith(normalizedQuery);\n\n        return exactMatch || vrlPrefixMatch;\n      })\n    )\n    .map(({ aliases: _, ...record }) => record);\n};\n\nconst getPagefind = async () => {\n  if (!window.loadPagefind) {\n    throw new Error(\"Pagefind is unavailable.\");\n  }\n\n  pagefindModule ??= window.loadPagefind().catch((error) => {\n    pagefindModule = undefined;\n    throw error;\n  });\n  return pagefindModule;\n};\n\nconst pagefindCategory = (url: string) => {\n  const resultUrl = new URL(url, window.location.origin);\n  const path = resultUrl.pathname.split(\"/\").filter(Boolean);\n\n  if (path.slice(0, 3).join(\"/\") === \"docs/reference/configuration\") {\n    if (/^#enrichment[-_]tables(?:[._-]|$)/.test(resultUrl.hash)) {\n      return \"Enrichment tables\";\n    }\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/website/assets/js/search.tsx#L65-L101","documentation":"This is a panic raised by `.expect(\"all required builder params specified\")` on the aws-sdk-sqs `DeleteMessageBatchRequestEntry` builder. The SDK builder's `build()` returns a Result and fails when a mandatory field (`id` or `receipt_handle`) was never set. In this call site both fields are set unconditionally from a successfully processed message, so the expect documents the invariant that the build cannot fail; if it fires, the surrounding code's invariant is broken (e.g. a None receipt_handle was force-unwrapped or an SDK version changed builder semantics).","triggerScenarios":"Calling `DeleteMessageBatchRequestEntry::builder().id(..).receipt_handle(..).build()` without setting `id` or `receipt_handle`. In vector's `run_once` (src/sources/aws_s3/sqs.rs:486) this only triggers if `receipt_handle` extraction produced None that was unwrapped earlier, or an aws-sdk upgrade made additional fields required.","commonSituations":"Upgrading the `aws-sdk-sqs` crate to a version where the builder gained a new required field; refactoring the delete loop and accidentally dropping a `.receipt_handle()` call; a receipt_handle Option being consumed/moved after the first message in a batch so later iterations build with None.","solutions":["Verify the aws-sdk-sqs version against vector's Cargo.lock/Cargo.toml and restore matching field setters if the builder API changed.","Check that `receipt_handle` is a non-Option String built from `message.receipt_handle` before the loop and is not moved/consumed in earlier iterations.","If a runtime failure is possible, replace `.expect()` with proper error handling that emits `SqsMessageDeleteError` and skips the entry instead of panicking the source task."],"exampleFix":"// before\nDeleteMessageBatchRequestEntry::builder()\n    .id(message_id.clone())\n    .receipt_handle(receipt_handle)\n    .build()\n    .expect(\"all required builder params specified\")\n// after\nDeleteMessageBatchRequestEntry::builder()\n    .id(message_id.clone())\n    .receipt_handle(receipt_handle)\n    .build()\n    .unwrap_or_else(|e| panic!(\"SQS delete entry build failed: {e}\"))","handlingStrategy":"validation","validationCode":"fn valid_delete_entry(id: &str, receipt_handle: &str) -> bool {\n    !id.is_empty() && !receipt_handle.is_empty()\n}","typeGuard":"fn as_receipt(m: &Message) -> Option<&str> { m.receipt_handle.as_deref().filter(|r| !r.is_empty()) }","tryCatchPattern":"// Rust: replace .expect with match on build Result\nmatch DeleteMessageBatchRequestEntry::builder().id(id).receipt_handle(rh).build() {\n    Ok(entry) => entries.push(entry),\n    Err(e) => { emit!(SqsMessageDeleteError { error: &e.into() }); }\n}","preventionTips":["After every aws-sdk-sqs upgrade, compile-check all builder call sites (build() Result forces review).","Never unwrap Option receipt_handles before the builder; thread Options through and handle None explicitly.","Add a unit test asserting delete entries build successfully for representative messages."],"tags":["aws","sqs","rust","panic","builder-pattern"],"backgroundTag":"missing-required-argument","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}