{"record":{"id":"595675964bf57c62","repo":"t8y2/dbx","slug":"unsupported-cassandra-connection-scheme-s","errorCode":null,"errorMessage":"unsupported Cassandra connection scheme: %s","messagePattern":"unsupported Cassandra connection scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":122,"sourceCode":"\t}\n\tif len(config.hosts) > 0 && !config.disableInitialHostLookup && allLoopbackHosts(config.hosts) {\n\t\tconfig.disableInitialHostLookup = true\n\t}\n\treturn config, nil\n}\n\nfunc applyConnectionString(config *cassandraConfig, params url.Values, raw string) error {\n\tvalue := strings.TrimSpace(raw)\n\tvalue = strings.TrimPrefix(value, \"jdbc:\")\n\tif !strings.Contains(value, \"://\") {\n\t\treturn fmt.Errorf(\"unsupported Cassandra connection string: %s\", raw)\n\t}\n\tparsed, err := url.Parse(value)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid Cassandra connection string: %w\", err)\n\t}\n\tif parsed.Scheme != \"cassandra\" {\n\t\treturn fmt.Errorf(\"unsupported Cassandra connection scheme: %s\", parsed.Scheme)\n\t}\n\tif parsed.User != nil {\n\t\tconfig.username = parsed.User.Username()\n\t\tif password, ok := parsed.User.Password(); ok {\n\t\t\tconfig.password = password\n\t\t}\n\t}\n\tconfig.hosts = splitHosts(parsed.Host)\n\tif port := parsed.Port(); port != \"\" {\n\t\tparsedPort, parseErr := strconv.Atoi(port)\n\t\tif parseErr != nil || parsedPort < 1 || parsedPort > 65535 {\n\t\t\treturn fmt.Errorf(\"invalid Cassandra port: %s\", port)\n\t\t}\n\t\tconfig.port = parsedPort\n\t}\n\tif keyspace := strings.Trim(strings.TrimSpace(parsed.Path), \"/\"); keyspace != \"\" {\n\t\tconfig.keyspace = keyspace\n\t}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L104-L140","documentation":"applyConnectionString rejects URLs whose scheme is not \"cassandra\" with \"unsupported Cassandra connection scheme: %s\". The driver reserves its URL space for the cassandra scheme (after optional jdbc: prefix); http, cassandrads, or other schemes are refused even if otherwise well-formed.","triggerScenarios":"Calling parseCassandraConfig with strings like \"http://host:9042\", \"cql://host\", \"cassandra+ssl://host\", or \"jdbc:postgresql://host/db\" — anything where parsed.Scheme != \"cassandra\".","commonSituations":"Reusing a URL from another driver/HTTP endpoint; inventing a scheme like cassandras or cqls for TLS instead of using the ssl parameter; leaving a placeholder scheme from example code.","solutions":["Change the scheme to \"cassandra\" exactly (lowercase).","Enable TLS via the ssl=true parameter instead of an https-style scheme.","If it's a jdbc: string, ensure it is jdbc:cassandra://... not another product's JDBC URL.","Route other protocols to their correct drivers, not the Cassandra one."],"exampleFix":"// before\ndriver.Open(\"cql+ssl://10.0.0.5:9042/sales\")\n// after\ndriver.Open(\"cassandra://10.0.0.5:9042/sales?ssl=true\")","handlingStrategy":"validation","validationCode":"v := strings.TrimPrefix(strings.TrimSpace(dsn), \"jdbc:\")\nif u, err := url.Parse(v); err == nil && u.Scheme != \"cassandra\" {\n    return fmt.Errorf(\"scheme must be cassandra (got %q); use ?ssl=true for TLS\", u.Scheme)\n}","typeGuard":null,"tryCatchPattern":"conn, err := driver.Open(dsn)\nif err != nil && strings.Contains(err.Error(), \"unsupported Cassandra connection scheme\") {\n    return nil, fmt.Errorf(\"use scheme 'cassandra' and enable TLS via ssl=true parameter: %w\", err)\n}","preventionTips":["Always use the exact lowercase scheme cassandra://.","Enable TLS with the ssl parameter, never by changing the scheme to https/cql+ssl.","Centralize DSN construction so the scheme is set in one place.","Add a lint/test that rejects non-cassandra schemes in configuration."],"tags":["configuration","cassandra","connection-string","scheme"],"backgroundTag":"invalid-connection-string","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"}