{"record":{"id":"2830272c52a254bb","repo":"vectordotdev/vector","slug":"global-log-schema-message-key-to-be-valid-path-283027","errorCode":null,"errorMessage":"global log_schema.message_key to be valid path","messagePattern":"global log_schema\\.message_key to be valid path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/docker_logs/mod.rs","lineNumber":1237,"sourceCode":"            // If event is partial, stash it and return `None`.\n            if is_partial {\n                // If we already have a partial event merge state, the current\n                // message has to be merged into that existing state.\n                // Otherwise, create a new partial event merge state with the\n                // current message being the initial one.\n                if let Some(partial_event_merge_state) = partial_event_merge_state {\n                    // Depending on the log namespace the actual contents of the log \"message\" will be\n                    // found in either the root of the event (\".\"), or at the globally configured \"message_key\".\n                    match log_namespace {\n                        LogNamespace::Vector => {\n                            partial_event_merge_state.merge_in_next_event(log, &[\".\"]);\n                        }\n                        LogNamespace::Legacy => {\n                            partial_event_merge_state.merge_in_next_event(\n                                log,\n                                &[log_schema()\n                                    .message_key()\n                                    .expect(\"global log_schema.message_key to be valid path\")\n                                    .to_string()],\n                            );\n                        }\n                    }\n                } else {\n                    *partial_event_merge_state = Some(LogEventMergeState::new(log));\n                };\n                return None;\n            };\n\n            // This is not a partial event. If we have a partial event merge\n            // state from before, the current event must be a final event, that\n            // would give us a merged event we can return.\n            // Otherwise it's just a regular event that we return as-is.\n            match partial_event_merge_state.take() {\n                // Depending on the log namespace the actual contents of the log \"message\" will be\n                // found in either the root of the event (\".\"), or at the globally configured \"message_key\".\n                Some(partial_event_merge_state) => match log_namespace {","sourceCodeStart":1219,"sourceCodeEnd":1255,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/src/sources/docker_logs/mod.rs#L1219-L1255","documentation":"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.","triggerScenarios":"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.","commonSituations":"Config generators (Helm/Kustomize) emitting an empty message_key, forks constructing LogSchema programmatically bypassing validation, or Vector versions with a validation gap.","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"],"exampleFix":"// before\n&[log_schema()\n    .message_key()\n    .expect(\"global log_schema.message_key to be valid path\")\n    .to_string()],\n\n// after\n&[log_schema()\n    .message_key()\n    .unwrap_or(\"message\")\n    .to_string()],","handlingStrategy":"validation","validationCode":"// fail fast at startup, before any log flows:\nlet key = log_schema().message_key();\nassert!(key.is_some_and(|k| !k.is_empty()),\n    \"log_schema.message_key must be a non-empty path\");","typeGuard":"fn message_key_or_default() -> String {\n    log_schema().message_key().unwrap_or(\"message\").to_string()\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["rust","panic","config","log-schema","docker-logs","multiline"],"backgroundTag":"missing-config-value","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}