rqlite/rqlite · error

-%s must not include a protocol scheme

Error message

-%s must not include a protocol scheme

What it means

The -otlp-endpoint flag expects a bare host:port; the transport scheme (gRPC/HTTP) is chosen internally by rqlited. Validate() rejects any endpoint containing "://" because a scheme would produce an invalid dial target.

Source

Thrown at cmd/rqlited/flags.go:192

		}
	}

	// Change-Data-Capture (CDC) OK?
	if c.CDCConfig != "" && c.RaftNonVoter {
		return errors.New("CDC cannot be enabled on non-voting nodes")
	}

	// OTLP metrics reporting OK?
	if !bothUnsetSet(c.OTLPCert, c.OTLPKey) {
		return fmt.Errorf("either both -%s and -%s must be set, or neither", OTLPCertFlag, OTLPKeyFlag)
	}
	if c.OTLPEndpoint == "" {
		if c.OTLPInsecure || c.OTLPNoVerify || c.OTLPCACert != "" || c.OTLPCert != "" {
			return fmt.Errorf("OTLP options require -%s", OTLPEndpointFlag)
		}
	} else {
		if strings.Contains(c.OTLPEndpoint, "://") {
			return fmt.Errorf("-%s must not include a protocol scheme", OTLPEndpointFlag)
		}
		if _, _, err := net.SplitHostPort(c.OTLPEndpoint); err != nil {
			return fmt.Errorf("-%s is not a valid address", OTLPEndpointFlag)
		}
		if c.OTLPMetricsInterval <= 0 {
			return fmt.Errorf("-%s must be greater than zero", OTLPIntervalFlag)
		}
		if c.OTLPInsecure && (c.OTLPNoVerify || c.OTLPCACert != "" || c.OTLPCert != "") {
			return fmt.Errorf("-%s cannot be used with other OTLP TLS options", OTLPInsecureFlag)
		}
	}

	// Valid disco mode?
	switch c.DiscoMode {
	case "":
	case DiscoModeEtcdKV, DiscoModeConsulKV:
		if c.BootstrapExpect > 0 {
			return fmt.Errorf("bootstrapping not applicable when using %s", c.DiscoMode)

View on GitHub (pinned to 7586a4d1bd)

Solutions

  1. Strip the scheme: use -otlp-endpoint=collector:4317
  2. Use -otlp-insecure if the collector is plaintext (http-style), or TLS flags for https-style
  3. Verify the resulting value contains no "://"

Example fix

# before
rqlited -otlp-endpoint http://collector:4317 ~/node
# after
rqlited -otlp-endpoint collector:4317 -otlp-insecure ~/node
Defensive patterns

Strategy: validation

Validate before calling

func validateOtlpEndpointFormat(ep string) error {
    if strings.Contains(ep, "://") {
        return fmt.Errorf("-otlp-endpoint must not include a scheme")
    }
    return nil
}

Try / catch

if err := validateOtlpEndpointFormat(otlpEndpoint); err != nil {
    log.Fatalf("invalid OTLP endpoint: %v", err)
}

Prevention

When it happens

Trigger: Passing -otlp-endpoint=http://collector:4317 or -otlp-endpoint=https://collector.example.com:4317.

Common situations: Copying the endpoint from an OpenTelemetry SDK config where a full URL is the norm; mixing exporter configs (e.g. from an OTel Collector YAML) into rqlite flags.

Related errors


AI-assisted analysis of rqlite/rqlite@7586a4d1bd (2026-09-03). Data as JSON: /api/errors/446c86e4ab53c2f0. Report an issue: GitHub.