{"record":{"id":"0a11c5ac4357454b","repo":"vectordotdev/vector","slug":"static-default-endpoint-should-be-a-valid-http-s-url","errorCode":null,"errorMessage":"static default endpoint should be a valid http(s) URL","messagePattern":"static default endpoint should be a valid http\\(s\\) URL","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sinks/keep/config.rs","lineNumber":70,"sourceCode":"    request: TowerRequestConfig,\n\n    #[serde(default, skip_serializing_if = \"crate::serde::is_default\")]\n    encoding: Transformer,\n\n    #[serde(\n        default,\n        deserialize_with = \"crate::serde::bool_or_struct\",\n        skip_serializing_if = \"crate::serde::is_default\"\n    )]\n    acknowledgements: AcknowledgementsConfig,\n\n    #[serde(default)]\n    pub retry_strategy: RetryStrategy,\n}\n\nfn default_endpoint() -> HttpEndpoint {\n    HttpEndpoint::parse(\"http://localhost:8080/alerts/event/vectordev?provider_id=test\")\n        .expect(\"static default endpoint should be a valid http(s) URL\")\n}\n\n#[derive(Clone, Copy, Debug, Default)]\nstruct KeepDefaultBatchSettings;\n\nimpl SinkBatchSettings for KeepDefaultBatchSettings {\n    const MAX_EVENTS: Option<usize> = None;\n    const MAX_BYTES: Option<usize> = Some(100_000);\n    const TIMEOUT_SECS: f64 = 1.0;\n}\n\nimpl GenerateConfig for KeepConfig {\n    fn generate_config() -> serde_json::Value {\n        serde_yaml::from_str(indoc::indoc! {\n            r#\"api_key: ${KEEP_API_KEY}\n            \"#,\n        })\n        .unwrap()","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/keep/config.rs#L52-L88","documentation":"The Keep sink's default endpoint is a compile-time constant URL parsed with HttpEndpoint::parse and unwrapped with expect at function call time. The panic would mean the hardcoded string \"http://localhost:8080/alerts/event/vectordev?provider_id=test\" stopped being parseable as an http(s) URL, which is impossible without a code change. Users should never see this; it fires only if default_endpoint() is invoked and the constant is corrupted.","triggerScenarios":"serde default deserialization of the Keep sink endpoint field invokes default_endpoint(); the panic fires only if the static URL string in src/sinks/keep/config.rs is modified to something unparseable.","commonSituations":"Custom forks/patches of Vector that altered the constant; downstream distributors modifying default endpoints. End users on stock builds cannot trigger it.","solutions":["Verify the hardcoded default URL in src/sinks/keep/config.rs is intact and is a valid http(s) URL.","Set an explicit endpoint on the Keep sink config so the default is never used.","Rebuild from an unmodified Vector source tree."],"exampleFix":"// before\nHttpEndpoint::parse(\"htp:/broken\").expect(\"static default endpoint should be a valid http(s) URL\")\n// after\nHttpEndpoint::parse(\"http://localhost:8080/alerts/event/vectordev?provider_id=test\")\n    .expect(\"static default endpoint should be a valid http(s) URL\")","handlingStrategy":"validation","validationCode":"// set endpoint explicitly so the static default is never parsed\n// vector.yaml\nsinks:\n  keep:\n    endpoint: \"http://keep:8080/alerts/event/vectordev?provider_id=test\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure endpoint explicitly in the Keep sink.","Don't patch the hardcoded default URL without validating it.","Run `vector validate` on forked builds."],"tags":["rust","panic","url","config","sink"],"backgroundTag":"invalid-url-format","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"}