vectordotdev/vector · info

static

Error message

static

What it means

run_inner limits the Loki sink to a single concurrent request builder when out_of_order_action is Drop or RewriteTimestamp. It builds NonZeroUsize::new(1) and unwraps with expect("static"), since 1 is trivially non-zero. This is a compile-time-true invariant; the panic cannot occur at runtime.

Solutions

  1. No user action required.
  2. If seen, check for modified source where the constant was changed from 1 to 0.
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: Not triggerable — NonZeroUsize::new(1) always returns Some. The expect exists to satisfy the type system for a hardcoded constant.

Common situations: None for users; would only appear if the literal 1 were changed to 0 in a code modification.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/3a1052b937593d96. Report an issue: GitHub.

Appendix: source

Thrown at src/sinks/loki/sink.rs:556

                remove_timestamp: config.remove_timestamp,
            },
            batch_settings: validated.batch_settings,
            out_of_order_action: config.out_of_order_action,
            service,
            protocol,
        })
    }

    async fn run_inner(self: Box<Self>, input: BoxStream<'_, Event>) -> Result<(), ()> {
        let mut encoder = self.encoder.clone();
        let mut filter = RecordFilter::new(self.out_of_order_action);

        // out_of_order_action's that require a complete ordering are limited to building 1 request
        // at a time
        let request_builder_concurrency = match self.out_of_order_action {
            OutOfOrderAction::Accept => default_request_builder_concurrency_limit(),
            OutOfOrderAction::Drop | OutOfOrderAction::RewriteTimestamp => {
                NonZeroUsize::new(1).expect("static")
            }
        };
        let batch_settings = self.batch_settings;

        input
            .map(|event| encoder.encode_event(event))
            .filter_map(|event| async { event })
            .map(|record| filter.filter_record(record))
            .batched_partitioned(RecordPartitioner, batch_settings.timeout, |_| {
                batch_settings.as_byte_size_config()
            })
            .filter_map(|(partition, batch)| async {
                if let Some(partition) = partition {
                    let mut count: usize = 0;
                    let result = batch
                        .into_iter()
                        .flatten()
                        .map(|event| {

View on GitHub (pinned to bdb87aeaa4)