{"record":{"id":"059058f0f18e9232","repo":"micro/go-micro","slug":"failed-to-parse-client-pool-close-timeout-v","errorCode":null,"errorMessage":"failed to parse client_pool_close_timeout: %v","messagePattern":"failed to parse client_pool_close_timeout: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cmd.go","lineNumber":653,"sourceCode":"\t\tclientOpts = append(clientOpts, client.RequestTimeout(d))\n\t}\n\n\tif r := ctx.Int(\"client_pool_size\"); r > 0 {\n\t\tclientOpts = append(clientOpts, client.PoolSize(r))\n\t}\n\n\tif t := ctx.String(\"client_pool_ttl\"); len(t) > 0 {\n\t\td, err := time.ParseDuration(t)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse client_pool_ttl: %v\", t)\n\t\t}\n\t\tclientOpts = append(clientOpts, client.PoolTTL(d))\n\t}\n\n\tif t := ctx.String(\"client_pool_close_timeout\"); len(t) > 0 {\n\t\td, err := time.ParseDuration(t)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse client_pool_close_timeout: %v\", t)\n\t\t}\n\t\tclientOpts = append(clientOpts, client.PoolCloseTimeout(d))\n\t}\n\n\t// We have some command line opts for the server.\n\t// Lets set it up\n\tif len(serverOpts) > 0 {\n\t\tif err := (*c.opts.Server).Init(serverOpts...); err != nil {\n\t\t\tlogger.Fatalf(\"Error configuring server: %v\", err)\n\t\t}\n\t}\n\n\t// Use an init option?\n\tif len(clientOpts) > 0 {\n\t\tif err := (*c.opts.Client).Init(clientOpts...); err != nil {\n\t\t\tlogger.Fatalf(\"Error configuring client: %v\", err)\n\t\t}\n\t}","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/cmd/cmd.go#L635-L671","documentation":"Returned by cmd/cmd.go when the --client_pool_close_timeout flag value fails time.ParseDuration. This timeout bounds how long the client waits when draining and closing pooled connections, and invalid values abort startup before any connection is made.","triggerScenarios":"Passing --client_pool_close_timeout with an invalid duration like 10 (missing unit) or 'ten seconds'.","commonSituations":"Copy-paste from docs where the unit was lost; scripts generating flags with default numeric values; typo like 5S (capital S is not accepted... actually 'S' is invalid; use 5s).","solutions":["Provide a valid duration: 10s, 500ms.","Correct the unit casing: 10s not 10S.","Check env/config interpolation for empty or numeric-only values.","Omit the flag to accept the library default."],"exampleFix":"// before\n--client_pool_close_timeout 10\n// after\n--client_pool_close_timeout 10s","handlingStrategy":"validation","validationCode":"func validDuration(s string) bool { _, err := time.ParseDuration(s); return err == nil }\nif !validDuration(closeTimeout) { return fmt.Errorf(\"--client_pool_close_timeout must be a Go duration like 10s, got %q\", closeTimeout) }","typeGuard":null,"tryCatchPattern":"if _, err := time.ParseDuration(t); err != nil { return fmt.Errorf(\"invalid client_pool_close_timeout %q: %v\", t, err) }","preventionTips":["Use lowercase unit suffixes: 10s, 500ms.","Never pass bare integers from env vars without a unit.","Add smoke tests that launch the binary with production flag values.","Omit the flag entirely when the default is acceptable."],"tags":["cli","configuration","duration-parsing"],"backgroundTag":"invalid-duration-format","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}