{"record":{"id":"d84d7378f008b316","repo":"t8y2/dbx","slug":"connection-pool-local-size-must-be-between-1-and-3","errorCode":null,"errorMessage":"connection pool local size must be between 1 and 32","messagePattern":"connection pool local size must be between 1 and 32","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":111,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\tconfig.loadBalancingPolicy = policy\n\t}\n\tif value, ok, err := hoconString(parsed, javaDriverConfigPrefix+\"basic.cloud.secure-connect-bundle\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.secureConnectBundle = value\n\t}\n\tif value, ok, err := hoconDuration(parsed, javaDriverConfigPrefix+\"advanced.connection.connect-timeout\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.connectTimeout = value\n\t}\n\tif value, ok, err := hoconInt(parsed, javaDriverConfigPrefix+\"advanced.connection.pool.local.size\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tif value < 1 || value > 32 {\n\t\t\treturn fmt.Errorf(\"connection pool local size must be between 1 and 32\")\n\t\t}\n\t\tconfig.numConnections = value\n\t}\n\tif value, ok, err := hoconBool(parsed, javaDriverConfigPrefix+\"advanced.socket.tcp-no-delay\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.tcpNoDelay = value\n\t}\n\tif value, ok, err := hoconBool(parsed, javaDriverConfigPrefix+\"advanced.socket.keep-alive\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.keepAlive = value\n\t}\n\tif value, ok, err := hoconProtocolVersion(parsed, javaDriverConfigPrefix+\"advanced.protocol.version\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.protocolVersion = value\n\t}","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L93-L129","documentation":"The `advanced.connection.pool.local.size` value read from the Java driver HOCON config must be between 1 and 32 inclusive. applyJavaDriverHOCON (config_file.go:111) rejects values outside that range because the Go driver caps per-host connections to a sane maximum (32) and requires at least one connection. The error aborts config-file application.","triggerScenarios":"A HOCON file sets `datastax-java-driver.advanced.connection.pool.local.size` to 0, a negative number, or anything greater than 32; applyCassandraConfigFile triggers applyJavaDriverHOCON which validates via `value < 1 || value > 32`.","commonSituations":"Tuning pool size for high throughput and setting 64 or 100 copied from a JVM recommendation; a leftover 0 from a disabled template; confusion between local size and remote size limits.","solutions":["Set `advanced.connection.pool.local.size` to an integer between 1 and 32 in the HOCON config file.","If you need more total connections, increase the number of hosts/IO threads instead of the per-host pool size beyond 32.","Remove the key to use the driver default (1) if custom pooling is not required.","Split oversized values across application instances rather than a single client's connection pool."],"exampleFix":"// before (application.conf)\ndatastax-java-driver {\n  advanced.connection.pool.local.size = 64\n}\n// after\ndatastax-java-driver {\n  advanced.connection.pool.local.size = 8\n}","handlingStrategy":"validation","validationCode":"func validatePoolSize(cfg *hocon.Config) error {\n    const key = \"datastax-java-driver.advanced.connection.pool.local.size\"\n    if cfg.Get(key) == nil {\n        return nil\n    }\n    v, err := cfg.GetIntE(key)\n    if err != nil {\n        return err\n    }\n    if v < 1 || v > 32 {\n        return fmt.Errorf(\"%s must be in [1,32], got %d\", key, v)\n    }\n    return nil\n}","typeGuard":"func isValidPoolSize(v int) bool { return v >= 1 && v <= 32 }","tryCatchPattern":"if err := applyCassandraConfigFile(cfgPath); err != nil {\n    if strings.Contains(err.Error(), \"connection pool local size\") {\n        log.Fatalf(\"config %s: pool.local.size must be between 1 and 32\", cfgPath)\n    }\n    return err\n}","preventionTips":["Clamp pool sizes in config generation: min(max(v,1),32) before writing the file.","Remember per-host caps; scale horizontally instead of raising the pool beyond 32.","Keep distinct tuned configs per fleet; don't copy JVM pool numbers into shared configs blindly."],"tags":["cassandra","config-validation","hocon","connection-pool"],"backgroundTag":"config-validation-failed","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"}