{"record":{"id":"7195e134fb0a34de","repo":"t8y2/dbx","slug":"invalid-cassandra-reconnection-policy-delay-s","errorCode":null,"errorMessage":"invalid Cassandra reconnection policy delay: %s","messagePattern":"invalid Cassandra reconnection policy delay: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":548,"sourceCode":"\nfunc parseReconnectionPolicy(value string) (string, time.Duration, time.Duration, error) {\n\ttrimmed := strings.TrimSpace(value)\n\tname := simpleClassName(trimmed)\n\tparameters := \"\"\n\tif open := strings.IndexByte(name, '('); open >= 0 {\n\t\tparameters = strings.TrimSuffix(name[open+1:], \")\")\n\t\tname = name[:open]\n\t}\n\tpolicy := strings.ToLower(strings.TrimSpace(name))\n\tbaseDelay := time.Second\n\tmaxDelay := 60 * time.Second\n\tif parameters != \"\" {\n\t\tparts := strings.Split(parameters, \",\")\n\t\tfor index, part := range parts {\n\t\t\tpart = strings.TrimSpace(strings.ReplaceAll(strings.ToLower(part), \"(long)\", \"\"))\n\t\t\tseconds, err := strconv.Atoi(part)\n\t\t\tif err != nil || seconds < 0 {\n\t\t\t\treturn \"\", 0, 0, fmt.Errorf(\"invalid Cassandra reconnection policy delay: %s\", part)\n\t\t\t}\n\t\t\tif index == 0 {\n\t\t\t\tbaseDelay = time.Duration(seconds) * time.Second\n\t\t\t} else if index == 1 {\n\t\t\t\tmaxDelay = time.Duration(seconds) * time.Second\n\t\t\t} else {\n\t\t\t\treturn \"\", 0, 0, fmt.Errorf(\"too many Cassandra reconnection policy parameters\")\n\t\t\t}\n\t\t}\n\t}\n\tswitch policy {\n\tcase \"\", \"constantreconnectionpolicy\":\n\t\treturn \"constant\", baseDelay, baseDelay, nil\n\tcase \"exponentialreconnectionpolicy\":\n\t\treturn \"exponential\", baseDelay, maxDelay, nil\n\tdefault:\n\t\treturn \"\", 0, 0, fmt.Errorf(\"unsupported Cassandra reconnection policy: %s\", value)\n\t}","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L530-L566","documentation":"parseReconnectionPolicy extracts numeric delay parameters from policy class arguments like ConstantReconnectionPolicy(1000, 10000). Each comma-separated part (with \"(long)\" casts stripped) must parse as a non-negative integer of seconds; otherwise this error names the offending part.","triggerScenarios":"A reconnection policy parameter string containing a non-numeric or negative value, e.g. \"ConstantReconnectionPolicy(abc, 10)\" or \"(1000, -1)\".","commonSituations":"Copying HOCON arguments with units like \"1000ms\" or \"1s\" instead of plain numbers, extra spaces/typos, or negative delays.","solutions":["Supply plain integer seconds, e.g. ConstantReconnectionPolicy(1, 10) for 1s base and 10s max","Remove any unit suffixes or casts other than \"(long)\"","Ensure no parameter is negative"],"exampleFix":"// before\nreconnectionPolicy = ConstantReconnectionPolicy(1000ms, 10s)\n// after\nreconnectionPolicy = ConstantReconnectionPolicy(1000, 10)","handlingStrategy":"validation","validationCode":"func validPolicyArgs(args string) bool {\n\tfor _, p := range strings.Split(args, \",\") {\n\t\tp = strings.TrimSpace(strings.ReplaceAll(strings.ToLower(p), \"(long)\", \"\"))\n\t\tn, err := strconv.Atoi(p)\n\t\tif err != nil || n < 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}","typeGuard":null,"tryCatchPattern":"base, max, _, err := parseReconnectionPolicy(raw)\nif err != nil {\n\treturn fmt.Errorf(\"reconnection args must be non-negative integer seconds: %w\", err)\n}","preventionTips":["Write delay arguments as plain integer seconds, no unit suffixes","Strip Java-style casts except (long)","Keep negative delays out of templates"],"tags":["cassandra","config","reconnection-policy","parsing"],"backgroundTag":"unsupported-config-value","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"}