vectordotdev/vector · error

validation events are encoded by Vector

Error message

validation events are encoded by Vector

What it means

In the validation gRPC receiver, each PushEventsRequest event wrapper is converted back into a Vector Event via Event::try_from. The expect asserts that only Vector itself encodes these protobuf events, so conversion must succeed; a panic means the received protobuf event wrapper is malformed or produced by a non-Vector encoder.

Solutions

  1. Ensure the gRPC client encodes events with the same vector protobuf definitions/version as the server.
  2. Regenerate/align protobuf bindings on both sides of the validation pipeline.
  3. Log the failed wrapper (e.g. with prost Debug) instead of a bare expect to identify the malformed event.

Example fix

// before
Event::try_from(wrapper).expect("validation events are encoded by Vector")
// after
Event::try_from(wrapper).unwrap_or_else(|e| panic!("bad event wrapper: {e:?}"))
Defensive patterns

Strategy: try-catch

Type guard

fn is_valid_event_wrapper(w: &pb::EventWrapper) -> bool {
    Event::try_from(w.clone()).is_ok()
}

Try / catch

match Event::try_from(wrapper) {
    Ok(ev) => ev,
    Err(e) => return Status::invalid_argument(format!("malformed event wrapper: {e:?}")),
}

Prevention

When it happens

Trigger: push_events receives a PushEventsRequest whose event wrapper fails Event::try_from — corrupt/foreign protobuf payload, mismatched protobuf definitions between client and server, or a non-Vector gRPC client posting events.

Common situations: Version skew between the validation client and server crates (protobuf schema drift); a custom test client that does not encode events exactly as Vector does.

Understand the failure class

Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.

Related errors


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

Appendix: source

Thrown at src/components/validation/runner/io.rs:50

impl From<mpsc::Sender<Vec<Event>>> for EventForwardService {
    fn from(tx: mpsc::Sender<Vec<Event>>) -> Self {
        Self { tx }
    }
}

#[tonic::async_trait]
impl VectorService for EventForwardService {
    async fn push_events(
        &self,
        request: tonic::Request<PushEventsRequest>,
    ) -> Result<tonic::Response<PushEventsResponse>, Status> {
        let events = request
            .into_inner()
            .events
            .into_iter()
            .map(|wrapper| {
                Event::try_from(wrapper).expect("validation events are encoded by Vector")
            })
            .collect();

        self.tx
            .send(events)
            .await
            .expect("event forward rx should not close first");

        Ok(tonic::Response::new(PushEventsResponse {}))
    }

    async fn health_check(
        &self,
        _: tonic::Request<HealthCheckRequest>,
    ) -> Result<tonic::Response<HealthCheckResponse>, Status> {
        let message = HealthCheckResponse {
            status: ServingStatus::Serving.into(),
        };

View on GitHub (pinned to bdb87aeaa4)