{"record":{"id":"446c86e4ab53c2f0","repo":"rqlite/rqlite","slug":"s-must-not-include-a-protocol-scheme","errorCode":null,"errorMessage":"-%s must not include a protocol scheme","messagePattern":"-(.+?) must not include a protocol scheme","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/rqlited/flags.go","lineNumber":192,"sourceCode":"\t\t}\n\t}\n\n\t// Change-Data-Capture (CDC) OK?\n\tif c.CDCConfig != \"\" && c.RaftNonVoter {\n\t\treturn errors.New(\"CDC cannot be enabled on non-voting nodes\")\n\t}\n\n\t// OTLP metrics reporting OK?\n\tif !bothUnsetSet(c.OTLPCert, c.OTLPKey) {\n\t\treturn fmt.Errorf(\"either both -%s and -%s must be set, or neither\", OTLPCertFlag, OTLPKeyFlag)\n\t}\n\tif c.OTLPEndpoint == \"\" {\n\t\tif c.OTLPInsecure || c.OTLPNoVerify || c.OTLPCACert != \"\" || c.OTLPCert != \"\" {\n\t\t\treturn fmt.Errorf(\"OTLP options require -%s\", OTLPEndpointFlag)\n\t\t}\n\t} else {\n\t\tif strings.Contains(c.OTLPEndpoint, \"://\") {\n\t\t\treturn fmt.Errorf(\"-%s must not include a protocol scheme\", OTLPEndpointFlag)\n\t\t}\n\t\tif _, _, err := net.SplitHostPort(c.OTLPEndpoint); err != nil {\n\t\t\treturn fmt.Errorf(\"-%s is not a valid address\", OTLPEndpointFlag)\n\t\t}\n\t\tif c.OTLPMetricsInterval <= 0 {\n\t\t\treturn fmt.Errorf(\"-%s must be greater than zero\", OTLPIntervalFlag)\n\t\t}\n\t\tif c.OTLPInsecure && (c.OTLPNoVerify || c.OTLPCACert != \"\" || c.OTLPCert != \"\") {\n\t\t\treturn fmt.Errorf(\"-%s cannot be used with other OTLP TLS options\", OTLPInsecureFlag)\n\t\t}\n\t}\n\n\t// Valid disco mode?\n\tswitch c.DiscoMode {\n\tcase \"\":\n\tcase DiscoModeEtcdKV, DiscoModeConsulKV:\n\t\tif c.BootstrapExpect > 0 {\n\t\t\treturn fmt.Errorf(\"bootstrapping not applicable when using %s\", c.DiscoMode)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/rqlite/rqlite/blob/7586a4d1bdbd9a5a80021664c5a863cd850adb60/cmd/rqlited/flags.go#L174-L210","documentation":"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.","triggerScenarios":"Passing -otlp-endpoint=http://collector:4317 or -otlp-endpoint=https://collector.example.com:4317.","commonSituations":"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.","solutions":["Strip the scheme: use -otlp-endpoint=collector:4317","Use -otlp-insecure if the collector is plaintext (http-style), or TLS flags for https-style","Verify the resulting value contains no \"://\""],"exampleFix":"# before\nrqlited -otlp-endpoint http://collector:4317 ~/node\n# after\nrqlited -otlp-endpoint collector:4317 -otlp-insecure ~/node","handlingStrategy":"validation","validationCode":"func validateOtlpEndpointFormat(ep string) error {\n    if strings.Contains(ep, \"://\") {\n        return fmt.Errorf(\"-otlp-endpoint must not include a scheme\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := validateOtlpEndpointFormat(otlpEndpoint); err != nil {\n    log.Fatalf(\"invalid OTLP endpoint: %v\", err)\n}","preventionTips":["Write host:port only; use -otlp-insecure for plaintext","Strip schemes when templating endpoints from URLs","Document the scheme-free endpoint convention in runbooks"],"tags":["otlp","endpoint","configuration"],"backgroundTag":"invalid-endpoint-format","analyzedSha":"7586a4d1bdbd9a5a80021664c5a863cd850adb60","analyzedAt":"2026-09-03T07:03:02.260Z","contentChangedAt":"2026-09-03T07:03:02.260Z","schemaVersion":2},"datasetVersion":"2026-09-10T12:17:11.382Z"}