{"record":{"id":"960fd538c18d10f8","repo":"t8y2/dbx","slug":"invalid-disableinitialhostlookup-option-w","errorCode":null,"errorMessage":"invalid disableinitialhostlookup option: %w","messagePattern":"invalid disableinitialhostlookup option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":272,"sourceCode":"\t\t\tconfig.retryCount = count\n\t\tcase \"retry\":\n\t\t\tpolicy, err := normalizeRetryPolicy(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.retryPolicy = policy\n\t\tcase \"reconnection\":\n\t\t\tpolicy, baseDelay, maxDelay, err := parseReconnectionPolicy(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.reconnectionPolicy = policy\n\t\t\tconfig.reconnectionBaseDelay = baseDelay\n\t\t\tconfig.reconnectionMaxDelay = maxDelay\n\t\tcase \"disableinitialhostlookup\":\n\t\t\tdisabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid disableinitialhostlookup option: %w\", err)\n\t\t\t}\n\t\t\tconfig.disableInitialHostLookup = disabled\n\t\tcase \"loadbalancing\":\n\t\t\tpolicy, err := normalizeLoadBalancingPolicy(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.loadBalancingPolicy = policy\n\t\tcase \"sslenginefactory\":\n\t\t\tif value != \"\" && !strings.EqualFold(simpleClassName(value), \"DefaultSslEngineFactory\") {\n\t\t\t\treturn fmt.Errorf(\"custom Cassandra sslenginefactory is not supported by the native agent: %s\", value)\n\t\t\t}\n\t\t\tconfig.ssl = true\n\t\tcase \"usekrb5\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid usekrb5 option: %w\", err)\n\t\t\t}","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L254-L290","documentation":"The 'disableinitialhostlookup' URL parameter must be a valid Go boolean parseable by strconv.ParseBool. When parsing fails, the library wraps and returns this error rather than silently defaulting the option.","triggerScenarios":"DSN contains disableinitialhostlookup=<value> with a non-boolean string such as 'yes', '1,' or a stray space, causing strconv.ParseBool to fail.","commonSituations":"Copy-pasted connection strings from Java driver docs using 'true '/'false ' with whitespace; using 'y'/'n' style flags; encoding issues injecting %20 into the value.","solutions":["Use one of strconv.ParseBool's accepted literals: 1/t/T/TRUE/true/True or 0/f/F/FALSE/false/False","Trim whitespace from the parameter value in the DSN","Omit the parameter if the default behavior is fine"],"exampleFix":"// before\ncassandra://127.0.0.1/myks?disableinitialhostlookup=y\n// after\ncassandra://127.0.0.1/myks?disableinitialhostlookup=true","handlingStrategy":"validation","validationCode":"func validBoolParam(v string) bool {\n\t_, err := strconv.ParseBool(strings.TrimSpace(v))\n\treturn err == true || err == nil // err == nil means valid\n}\n// use: _, err := strconv.ParseBool(strings.TrimSpace(q.Get(\"disableinitialhostlookup\"))); err == nil","typeGuard":null,"tryCatchPattern":"if err := parseCassandraConfig(dsn); err != nil {\n\tif strings.Contains(err.Error(), \"disableinitialhostlookup\") {\n\t\treturn sanitizeBoolParams(dsn)\n\t}\n\treturn err\n}","preventionTips":["Use canonical true/false in connection strings","Trim whitespace from parameter values before URL-building","URL-encode parameter values to avoid stray %20"],"tags":["config","url-params","boolean-parsing","cassandra"],"backgroundTag":"invalid-url-parameter","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}