{"record":{"id":"94133638f70dbcb2","repo":"vectordotdev/vector","slug":"global-log-schema-source-type-key-to-be-valid-path","errorCode":null,"errorMessage":"global log_schema.source_type_key to be valid path","messagePattern":"global log_schema\\.source_type_key to be valid path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sinks/influxdb/logs.rs","lineNumber":322,"sourceCode":"        let client = HttpClient::new(tls_settings, cx.proxy())?;\n        let healthcheck = self.healthcheck(client.clone())?;\n\n        let request = self.request.into_settings();\n\n        // Resolve the `log_schema()` fallbacks here, after the global log schema\n        // has been initialized, so custom global log schema keys are honored.\n        let host_key = host_key\n            .clone()\n            .or_else(|| log_schema().host_key().cloned())\n            .expect(\"global log_schema.host_key to be valid path\");\n        let message_key = message_key\n            .clone()\n            .or_else(|| log_schema().message_key().cloned())\n            .expect(\"global log_schema.message_key to be valid path\");\n        let source_type_key = source_type_key\n            .clone()\n            .or_else(|| log_schema().source_type_key().cloned())\n            .expect(\"global log_schema.source_type_key to be valid path\");\n\n        let sink = InfluxDbLogsSink {\n            uri: uri.clone(),\n            token: token.inner().to_owned(),\n            protocol_version: *protocol_version,\n            measurement: measurement.clone(),\n            tags: tags.clone(),\n            transformer: self.encoding.clone(),\n            host_key,\n            message_key,\n            source_type_key,\n        };\n\n        let sink = BatchedHttpSink::new(\n            sink,\n            Buffer::new(batch.size, Compression::None),\n            request,\n            batch.timeout,","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/influxdb/logs.rs#L304-L340","documentation":"This panic occurs during InfluxDB logs sink construction when neither a user-configured source_type_key nor the global log_schema().source_type_key() yields a value. Vector requires every event to have a source_type key path to build its line-protocol output, so the code treats the absence as an unrecoverable configuration invariant. The message comes from Rust's Option::expect, meaning an internally guaranteed value was None.","triggerScenarios":"Building the InfluxDB logs sink (InfluxDbLogsSink::new / healthcheck setup) with no explicit source_type_key on the sink and log_schema().source_type_key() returning None, e.g. a customized global log_schema configuration that omits or nulls the source_type key.","commonSituations":"Deployments where the global log_schema section in vector.toml/vector.yaml overrides keys and accidentally removes source_type; copying a minimal config that assumes defaults after a Vector version changed default schema handling; programmatic config generation that drops schema defaults.","solutions":["Set source_type_key explicitly on the influxdb logs sink configuration (e.g. source_type_key: \"source_type\").","Restore the default global log_schema so log_schema().source_type_key() returns the default \"source_type\" path.","Check for config preprocessing/templating that strips the log_schema block, and fix the generator."],"exampleFix":"// before (vector.yaml)\nlog_schema:\n  message_key: message\n\n// after\nlog_schema:\n  message_key: message\n  source_type_key: source_type","handlingStrategy":"validation","validationCode":"// vector.yaml — ensure the key exists before deploying\ngrep -q 'source_type_key' vector.yaml || echo 'source_type_key: source_type' >> vector.yaml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always keep a complete log_schema block in your config when overriding any key.","Run `vector validate` before deploying configs.","Pin and review config templates that generate log_schema sections."],"tags":["rust","panic","config","influxdb","sink"],"backgroundTag":"missing-config-value","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}