{"record":{"id":"3dafe6716dd21c63","repo":"t8y2/dbx","slug":"remote-file-uri-hosts-are-not-supported-s","errorCode":null,"errorMessage":"remote file URI hosts are not supported: %s","messagePattern":"remote file URI hosts are not supported: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":353,"sourceCode":"\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\n\t}\n\tvalue, err := config.GetStringE(path)\n\tif err != nil {","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L335-L371","documentation":"normalizeLocalFilePath (config_file.go:353) accepts `file:` URIs only when the URI host is empty or 'localhost' (case-insensitive). A file URI with a remote hostname such as `file://fileserver/share/keytab` implies a network share rather than a local file and is rejected, since the driver must read the file from the local filesystem. Note that `file://host/path` puts the host part before the path, so this error often indicates a malformed file URI (one slash too few).","triggerScenarios":"Passing `file://server/share/keytab`, `file://nas.mycompany.com/certs/ca.pem`, or a similarly malformed URI (e.g. `file:///etc/keytab` is fine, but `file://etc/keytab` yields host='etc') as a config path value to applyCassandraConfigFile or a kerberos path option.","commonSituations":"Windows UNC paths converted naively to file URIs (`file://server/share` instead of `file:////server/share`); dropping one slash from `file:///`; config templating that concatenates host + path into a file URI.","solutions":["Use a three-slash file URI for local files: `file:///etc/cassandra/ca.pem` (empty host), not `file://host/path`.","Replace the remote-host URI with a genuine local path after copying the file onto the client machine.","On Windows UNC shares, use `file:////server/share/path` or the plain path `\\\\server\\share\\path` — the share is a remote host and may still need local staging.","'localhost' as host is allowed (`file://localhost/path`), so fix hostnames to 'localhost' only if the file truly is local."],"exampleFix":"// before\nkeytab := \"file://fileserver.internal.example.com/kerberos/client.keytab\"\n// after (copy locally, then use local path)\nexec.Command(\"scp\", \"fileserver:/kerberos/client.keytab\", \"/etc/krb5/client.keytab\").Run()\nkeytab := \"file:///etc/krb5/client.keytab\"","handlingStrategy":"validation","validationCode":"func validateFileURIHost(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\" && u.Host != \"\" && !strings.EqualFold(u.Host, \"localhost\") {\n        return fmt.Errorf(\"file URI host %q not allowed; use file:///path (three slashes)\", u.Host)\n    }\n    return nil\n}","typeGuard":"func isLocalFileURI(raw string) bool {\n    u, err := url.Parse(strings.TrimSpace(raw))\n    return err == nil && u.Scheme == \"file\" && (u.Host == \"\" || strings.EqualFold(u.Host, \"localhost\"))\n}","tryCatchPattern":"if err := applyCassandraConfigFile(cfgPath); err != nil {\n    if strings.Contains(err.Error(), \"remote file URI hosts are not supported\") {\n        log.Fatalf(\"file URIs must be local: use file:///path with three slashes, and stage remote files locally\")\n    }\n    return err\n}","preventionTips":["Always write file URIs with three slashes: file:///absolute/path.","Remember host-in-URI means a network resource; UNC shares must be staged locally.","Lint config templates for 'file://' followed by anything other than '/' or 'localhost/'."],"tags":["config","file-uri","path","cassandra","kerberos"],"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"}