vectordotdev/vector · error

static default endpoint should be a valid http(s) URL

Error message

static default endpoint should be a valid http(s) URL

What it means

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.

Solutions

  1. Verify the hardcoded default URL in src/sinks/keep/config.rs is intact and is a valid http(s) URL.
  2. Set an explicit endpoint on the Keep sink config so the default is never used.
  3. Rebuild from an unmodified Vector source tree.

Example fix

// before
HttpEndpoint::parse("htp:/broken").expect("static default endpoint should be a valid http(s) URL")
// after
HttpEndpoint::parse("http://localhost:8080/alerts/event/vectordev?provider_id=test")
    .expect("static default endpoint should be a valid http(s) URL")
Defensive patterns

Strategy: validation

Validate before calling

// set endpoint explicitly so the static default is never parsed
// vector.yaml
sinks:
  keep:
    endpoint: "http://keep:8080/alerts/event/vectordev?provider_id=test"

Prevention

When it happens

Trigger: 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.

Common situations: Custom forks/patches of Vector that altered the constant; downstream distributors modifying default endpoints. End users on stock builds cannot trigger it.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at src/sinks/keep/config.rs:70

    request: TowerRequestConfig,

    #[serde(default, skip_serializing_if = "crate::serde::is_default")]
    encoding: Transformer,

    #[serde(
        default,
        deserialize_with = "crate::serde::bool_or_struct",
        skip_serializing_if = "crate::serde::is_default"
    )]
    acknowledgements: AcknowledgementsConfig,

    #[serde(default)]
    pub retry_strategy: RetryStrategy,
}

fn default_endpoint() -> HttpEndpoint {
    HttpEndpoint::parse("http://localhost:8080/alerts/event/vectordev?provider_id=test")
        .expect("static default endpoint should be a valid http(s) URL")
}

#[derive(Clone, Copy, Debug, Default)]
struct KeepDefaultBatchSettings;

impl SinkBatchSettings for KeepDefaultBatchSettings {
    const MAX_EVENTS: Option<usize> = None;
    const MAX_BYTES: Option<usize> = Some(100_000);
    const TIMEOUT_SECS: f64 = 1.0;
}

impl GenerateConfig for KeepConfig {
    fn generate_config() -> serde_json::Value {
        serde_yaml::from_str(indoc::indoc! {
            r#"api_key: ${KEEP_API_KEY}
            "#,
        })
        .unwrap()

View on GitHub (pinned to bdb87aeaa4)