{"record":{"id":"eb7d3681d48b52a0","repo":"t8y2/dbx","slug":"invalid-requesttimeout-w","errorCode":null,"errorMessage":"invalid requesttimeout: %w","messagePattern":"invalid requesttimeout: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":172,"sourceCode":"\t\treturn nil, fmt.Errorf(\"invalid Cassandra URL parameters: %w\", err)\n\t}\n\treturn values, nil\n}\n\nfunc applyCassandraURLParams(config *cassandraConfig, params url.Values) error {\n\tfor rawKey, values := range params {\n\t\tif len(values) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tkey := normalizeOptionName(rawKey)\n\t\tvalue := strings.TrimSpace(values[len(values)-1])\n\t\tswitch key {\n\t\tcase \"localdatacenter\", \"datacenter\", \"dc\":\n\t\t\tconfig.localDatacenter = value\n\t\tcase \"requesttimeout\", \"timeout\":\n\t\t\tduration, err := parseDurationOption(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid requesttimeout: %w\", err)\n\t\t\t}\n\t\t\tconfig.requestTimeout = duration\n\t\tcase \"connecttimeout\", \"logintimeout\":\n\t\t\tduration, err := parseDurationOption(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid connecttimeout: %w\", err)\n\t\t\t}\n\t\t\tconfig.connectTimeout = duration\n\t\tcase \"protocolversion\", \"protoversion\":\n\t\t\tversion, err := strconv.Atoi(value)\n\t\t\tif err != nil || version < 3 || version > 5 {\n\t\t\t\treturn fmt.Errorf(\"protocolversion must be between 3 and 5\")\n\t\t\t}\n\t\t\tconfig.protocolVersion = version\n\t\tcase \"consistency\":\n\t\t\tif _, err := gocql.ParseConsistencyWrapper(value); err != nil {\n\t\t\t\treturn err\n\t\t\t}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L154-L190","documentation":"The Cassandra driver's URL parser (applyCassandraURLParams) accepts 'requesttimeout' or 'timeout' query parameters and parses them with parseDurationOption. When the value is not a valid duration (or an unsupported duration format), the parse error is wrapped in this message. The URL is rejected and no Cassandra session/config is produced.","triggerScenarios":"Calling parseCassandraConfig on a cassandra:// URL whose query string contains requesttimeout=<value> (or timeout=<value>) where the value fails parseDurationOption, e.g. requesttimeout=abc, requesttimeout=5, or requesttimeout=5secs.","commonSituations":"Hand-edited DSNs with typo'd units (5000ms written as '5000' or '5sec'), values copy-pasted from Java/C# drivers that use different duration syntax, or config generated by scripts that interpolate empty or malformed values.","solutions":["Fix the requesttimeout/timeout value in the URL to a valid duration like 5s, 500ms, or 1m (parseDurationOption format).","Remove the timeout parameter entirely to use the driver's default timeout.","If the value comes from an environment variable or template, validate it with time.ParseDuration-style parsing before interpolating into the URL."],"exampleFix":"// before\ncassandra://host:9042?keyspace=ks&requesttimeout=5000\n// after\ncassandra://host:9042?keyspace=ks&requesttimeout=5s","handlingStrategy":"validation","validationCode":"func validDuration(v string) error {\n\t_, err := time.ParseDuration(v)\n\treturn err\n}\nif err := validDuration(reqTimeout); err != nil {\n\treturn fmt.Errorf(\"requesttimeout must be like 5s/500ms: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tvar msg string\n\tif strings.Contains(err.Error(), \"invalid requesttimeout\") {\n\t\tmsg = \"check requesttimeout/timeout query param (use e.g. 5s)\"\n\t}\n\treturn fmt.Errorf(\"cassandra DSN rejected: %v: %s\", err, msg)\n}","preventionTips":["Centralize DSN construction in one helper that validates durations with time.ParseDuration first","Never interpolate raw env vars into the URL; trim and validate each value","Prefer omitting timeout params to relying on hand-written values"],"tags":["cassandra","config","url-params","duration-parse"],"backgroundTag":"invalid-duration-format","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"}