vectordotdev/vector · error
global log_schema.message_key to be valid path
Error message
global log_schema.message_key to be valid path
What it means
docker_logs can merge partial log events (message ends with an escaped continuation). When merging the next chunk in the Legacy log namespace, Vector reads the globally configured message key via log_schema().message_key().expect("global log_schema.message_key to be valid path") and merges into that path. The default schema supplies message_key = "message"; the Option is only None when the global log_schema was built without a usable message key, which startup validation is supposed to reject.
Source
Thrown at src/sources/docker_logs/mod.rs:1237
// If event is partial, stash it and return `None`.
if is_partial {
// If we already have a partial event merge state, the current
// message has to be merged into that existing state.
// Otherwise, create a new partial event merge state with the
// current message being the initial one.
if let Some(partial_event_merge_state) = partial_event_merge_state {
// Depending on the log namespace the actual contents of the log "message" will be
// found in either the root of the event ("."), or at the globally configured "message_key".
match log_namespace {
LogNamespace::Vector => {
partial_event_merge_state.merge_in_next_event(log, &["."]);
}
LogNamespace::Legacy => {
partial_event_merge_state.merge_in_next_event(
log,
&[log_schema()
.message_key()
.expect("global log_schema.message_key to be valid path")
.to_string()],
);
}
}
} else {
*partial_event_merge_state = Some(LogEventMergeState::new(log));
};
return None;
};
// This is not a partial event. If we have a partial event merge
// state from before, the current event must be a final event, that
// would give us a merged event we can return.
// Otherwise it's just a regular event that we return as-is.
match partial_event_merge_state.take() {
// Depending on the log namespace the actual contents of the log "message" will be
// found in either the root of the event ("."), or at the globally configured "message_key".
Some(partial_event_merge_state) => match log_namespace {View on GitHub (pinned to 3708c39b12)
Solutions
- Set log_schema.message_key explicitly to a non-empty path (the default is "message")
- Run `vector validate` on the deployed config and fix any schema errors it reports
- Patch: fall back to "message" instead of expecting
- Upgrade Vector to pick up schema-validation fixes
Example fix
// before
&[log_schema()
.message_key()
.expect("global log_schema.message_key to be valid path")
.to_string()],
// after
&[log_schema()
.message_key()
.unwrap_or("message")
.to_string()], Defensive patterns
Strategy: validation
Validate before calling
// fail fast at startup, before any log flows:
let key = log_schema().message_key();
assert!(key.is_some_and(|k| !k.is_empty()),
"log_schema.message_key must be a non-empty path"); Type guard
fn message_key_or_default() -> String {
log_schema().message_key().unwrap_or("message").to_string()
} Prevention
- Run `vector validate` on every config before deploy
- Set log_schema.message_key explicitly rather than relying on templated values
- Never render schema keys from empty environment variables
When it happens
Trigger: A global config whose log_schema.message_key is empty or absent (for example an env-var template rendering to ""), combined with Docker log lines that carry partial-continuation markers so this merge path actually executes.
Common situations: Config generators (Helm/Kustomize) emitting an empty message_key, forks constructing LogSchema programmatically bypassing validation, or Vector versions with a validation gap.
Understand the failure class
Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.
Related errors
- `.` must exist in the event
- `message` must exist in the event
- `docker_logs.stream` must exist in the metadata
- stream must exist in the event
- registered log schema required
AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20).
Data as JSON: /api/errors/2830272c52a254bb.
Report an issue: GitHub.