vectordotdev/vector · critical

HTTPS initialization failed

Error message

HTTPS initialization failed

What it means

The apache_metrics source builds an HttpClient inside the streaming closure for every URL tick and unwraps with expect("HTTPS initialization failed"). HttpClient::new returns an error when the TLS/HTTPS backend cannot initialize (e.g. OpenSSL/alpn-rustls setup failure, bad proxy configuration), and that panic aborts the source task.

Solutions

  1. Correct the proxy configuration for the apache_metrics source (or remove it if not needed).
  2. Ensure the system CA certificates are installed and SSL_CERT_FILE/SSL_CERT_DIR are valid.
  3. Hoist HttpClient::new out of the closure to build once, and propagate the error in the source's build() instead of panicking per tick.

Example fix

// before
let client = HttpClient::new(None, &proxy).expect("HTTPS initialization failed");
// after (in build())
let client = HttpClient::new(None, &proxy)?;
Defensive patterns

Strategy: fallback

Validate before calling

// at source build time
let client = HttpClient::new(None, &proxy).map_err(|e| BuildError::from(e))?;

Try / catch

HttpClient::new(None, &proxy).unwrap_or_else(|_| HttpClient::new(None, &None).expect("default client"))

Prevention

When it happens

Trigger: HttpClient::new(None, &proxy) failing — typically due to a misconfigured proxy setting or TLS backend initialization error — evaluated each time the interval stream emits a URL.

Common situations: Invalid proxy config in the source; container images missing CA certificates or TLS roots; environment (SSL_CERT_FILE/SSL_CERT_DIR) pointing at unreadable files.

Related errors


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

Appendix: source

Thrown at src/sources/apache_metrics/mod.rs:158

        s
    }
}

fn apache_metrics(
    urls: Vec<http::Uri>,
    interval: Duration,
    namespace: Option<String>,
    shutdown: ShutdownSignal,
    mut out: SourceSender,
    proxy: ProxyConfig,
) -> super::Source {
    Box::pin(async move {
        let mut stream = IntervalStream::new(tokio::time::interval(interval))
            .take_until(shutdown)
            .map(move |_| stream::iter(urls.clone()))
            .flatten()
            .map(move |url| {
                let client = HttpClient::new(None, &proxy).expect("HTTPS initialization failed");
                let sanitized_url = url.to_sanitized_string();

                let request = Request::get(&url)
                    .body(Body::empty())
                    .expect("error creating request");

                let tags = metric_tags! {
                    "endpoint" => sanitized_url.to_string(),
                    "host" => url.sanitized_authority(),
                };

                let namespace = namespace.clone();
                client
                    .send(request)
                    .map_err(crate::Error::from)
                    .and_then(|response| async {
                        let (header, body) = response.into_parts();
                        let body = http_body::Body::collect(body).await?.to_bytes();

View on GitHub (pinned to bdb87aeaa4)