vectordotdev/vector · error
Finalizer must exist for the batch receiver to be created
Error message
Finalizer must exist for the batch receiver to be created
What it means
Invariant expectation in the aws_sqs source run loop: events are decoded with a batch receiver whose acknowledgement finalizer is created earlier in the same iteration. This fires only if that finalizer were absent when the receiver is constructed — impossible in the current control flow — so the string documents why the unwrap is safe: the batch ack finalizer is always created before the decoder that needs it.
Solutions
- If observed, it indicates the batch/finalizer construction order was refactored incorrectly — restore creation of the finalizer before the receiver
- Add a unit test asserting the receiver is only built after the finalizer exists
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at src/sources/aws_sqs/source.rs:165 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/226224cf9db90a60.
Report an issue: GitHub.
Appendix: source
Thrown at src/sources/aws_sqs/source.rs:165
"aws_sqs",
body.as_bytes(),
timestamp,
&batch,
self.log_namespace,
&events_received,
);
events.extend(decoded);
}
}
drop(batch); // Drop last reference to batch acknowledgement finalizer
let count = events.len();
match out.send_batch(events).await {
Ok(()) => {
if self.delete_message {
match batch_receiver {
Some(receiver) => finalizer
.expect("Finalizer must exist for the batch receiver to be created")
.add(receipts_to_ack, receiver),
None => {
delete_messages(
self.client.clone(),
receipts_to_ack,
self.queue_url.clone(),
)
.await
}
}
}
}
Err(_) => emit!(StreamClosedError { count }),
}
}
}
}
View on GitHub (pinned to bdb87aeaa4)