{"record":{"id":"993c4d8c7cdb141d","repo":"t8y2/dbx","slug":"unsupported-file-uri-scheme-s","errorCode":null,"errorMessage":"unsupported file URI scheme: %s","messagePattern":"unsupported file URI scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":350,"sourceCode":"\t} else if ok {\n\t\tconfig.kerberos.useTicketCache = value\n\t\tconfig.kerberos.useTicketCacheSet = true\n\t}\n\treturn nil\n}\n\nfunc normalizeLocalFilePath(raw string) (string, error) {\n\tvalue := strings.TrimSpace(raw)\n\tif value == \"\" {\n\t\treturn \"\", nil\n\t}\n\tif strings.Contains(value, \"://\") || strings.HasPrefix(strings.ToLower(value), \"file:\") {\n\t\tparsed, err := url.Parse(value)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif parsed.Scheme != \"file\" {\n\t\t\treturn \"\", fmt.Errorf(\"unsupported file URI scheme: %s\", parsed.Scheme)\n\t\t}\n\t\tif parsed.Host != \"\" && !strings.EqualFold(parsed.Host, \"localhost\") {\n\t\t\treturn \"\", fmt.Errorf(\"remote file URI hosts are not supported: %s\", parsed.Host)\n\t\t}\n\t\tvalue, err = url.PathUnescape(parsed.Path)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif runtime.GOOS == \"windows\" && len(value) >= 3 && value[0] == '/' && value[2] == ':' {\n\t\t\tvalue = value[1:]\n\t\t}\n\t}\n\treturn filepath.Clean(filepath.FromSlash(value)), nil\n}\n\nfunc hoconString(config *hocon.Config, path string) (string, bool, error) {\n\tif config.Get(path) == nil {\n\t\treturn \"\", false, nil","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L332-L368","documentation":"normalizeLocalFilePath (config_file.go:350) parses any path that looks like a URI (contains '://' or starts with 'file:') and requires the scheme to be `file`. URLs with other schemes (http://, https://, s3://, hdfs://, jar:, etc.) are rejected because configuration file paths (TLS certs, Kerberos keytabs, JAAS configs) must be local files the driver can open directly.","triggerScenarios":"Passing a value like `https://example.com/ca.pem`, `s3://bucket/keytab`, `hdfs://nn/keytab`, or `http://host/file` as a config-file path option (dbx.cassandra.tls.*-path, kerberos.keytab, kerberos.config, etc.) or inside the parsed config file; applyCassandraConfigFile and normalizeKerberos* call this.","commonSituations":"Config templated from an environment where cert paths are URLs served by a secrets manager; someone assuming remote fetch support; using object-storage URIs copied from Hadoop/Spark configs.","solutions":["Download the file locally first (e.g. `curl -o ca.pem https://example.com/ca.pem`) and pass the local path `file:///etc/ssl/ca.pem` or `/etc/ssl/ca.pem`.","Use the `file:` URI scheme if a URI is required: `file:///path/to/file` (host must be empty or 'localhost').","For Kerberos keytabs/ccache, fetch them with your deployment tooling before the driver starts and reference local paths.","If you don't intend a URI, remove any '://' or leading 'file:' from the string and pass a plain filesystem path."],"exampleFix":"// before\ncaPath := \"https://internal.example.com/pki/cassandra-ca.pem\"\n// after\ncert, err := fetchToFile(\"https://internal.example.com/pki/cassandra-ca.pem\", \"/tmp/cassandra-ca.pem\") // download first\nif err != nil { log.Fatal(err) }\ncaPath := \"/tmp/cassandra-ca.pem\"","handlingStrategy":"validation","validationCode":"func validateLocalFileURI(raw string) error {\n    v := strings.TrimSpace(raw)\n    if v == \"\" || !(strings.Contains(v, \"://\") || strings.HasPrefix(strings.ToLower(v), \"file:\")) {\n        return nil\n    }\n    u, err := url.Parse(v)\n    if err != nil {\n        return err\n    }\n    if u.Scheme != \"file\" {\n        return fmt.Errorf(\"scheme %q not supported; stage the file locally or use file://\", u.Scheme)\n    }\n    return nil\n}","typeGuard":"func isFileURI(raw string) bool {\n    u, err := url.Parse(strings.TrimSpace(raw))\n    return err == nil && strings.Contains(raw, \"://\") && u.Scheme == \"file\"\n}","tryCatchPattern":"if err := applyCassandraConfigFile(cfgPath); err != nil {\n    var schemeErr = \"unsupported file URI scheme\"\n    if strings.Contains(err.Error(), schemeErr) {\n        log.Fatalf(\"download remote artifacts before startup and pass a local file:// path\")\n    }\n    return err\n}","preventionTips":["Stage certs/keytabs onto the local disk during deployment; never reference http/s3/hdfs URLs in path options.","Use plain filesystem paths when a URI is unnecessary.","Validate path options in startup code with url.Parse before handing them to the library."],"tags":["config","file-uri","path","cassandra"],"backgroundTag":"unsupported-uri-scheme","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}