{"record":{"id":"4c0c797d82ea204a","repo":"googleapis/mcp-toolbox","slug":"invalid-retrybasedelay-w","errorCode":null,"errorMessage":"invalid retryBaseDelay: %w","messagePattern":"invalid retryBaseDelay: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cockroachdb/cockroachdb.go","lineNumber":103,"sourceCode":"\tReadOnlyMode    bool `yaml:\"readOnlyMode\"`    // Default: true (enforced in Initialize)\n\tEnableWriteMode bool `yaml:\"enableWriteMode\"` // Explicit opt-in for write operations\n\tMaxRowLimit     int  `yaml:\"maxRowLimit\"`     // Default: 1000\n\tQueryTimeoutSec int  `yaml:\"queryTimeoutSec\"` // Default: 30\n\n\t// Observability\n\tEnableTelemetry  bool   `yaml:\"enableTelemetry\"`  // Default: true\n\tTelemetryVerbose bool   `yaml:\"telemetryVerbose\"` // Default: false\n\tClusterID        string `yaml:\"clusterID\"`        // Optional cluster identifier for telemetry\n}\n\nfunc (r Config) SourceConfigType() string {\n\treturn SourceType\n}\n\nfunc (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\tretryBaseDelay, err := time.ParseDuration(r.RetryBaseDelay)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid retryBaseDelay: %w\", err)\n\t}\n\n\tpool, err := initCockroachDBConnectionPoolWithRetry(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Database, r.QueryParams, r.MaxRetries, retryBaseDelay)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create pool: %w\", err)\n\t}\n\n\ts := &Source{\n\t\tConfig: r,\n\t\tPool:   pool,\n\t}\n\treturn s, nil\n}\n\nvar _ sources.Source = &Source{}\n\ntype Source struct {\n\tConfig","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cockroachdb/cockroachdb.go#L85-L121","documentation":"CockroachDB source Config.Initialize parses the RetryBaseDelay config string with time.ParseDuration and wraps any parse failure as 'invalid retryBaseDelay'. The library throws it when the configured duration string is not a valid Go duration literal.","triggerScenarios":"Configuring a cockroachdb source with RetryBaseDelay set to something time.ParseDuration rejects: missing unit (\"5\" instead of \"5ms\"), misspelled unit (\"5sec\"), empty string, negative without sign handling, or whitespace.","commonSituations":"YAML config where the value was quoted as a bare number, users assuming seconds are the default unit, copying configs between sources with different delay formats, or environment-variable interpolation producing an empty string.","solutions":["Use a valid Go duration string with a unit: e.g. \"500ms\", \"1s\", \"2m\"","Check the rendered config value (env var interpolation may leave it empty or partial)","Remember Go durations require units — a bare \"100\" is invalid; use \"100ms\"","Remove surrounding whitespace/quotes artifacts from YAML or templated config"],"exampleFix":"// before (yaml)\nretryBaseDelay: 500\n// after\nretryBaseDelay: 500ms","handlingStrategy":"validation","validationCode":"if _, err := time.ParseDuration(cfg.RetryBaseDelay); err != nil {\n    return fmt.Errorf(\"retryBaseDelay must be a Go duration like '500ms' or '1s', got %q\", cfg.RetryBaseDelay)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a time unit in duration config values (e.g. \"1s\", not \"1\")","Add a config pre-flight check that parses every duration field at startup","Beware env-var interpolation leaving duration fields empty","Keep a validated example config in the repo for reference"],"tags":["config","duration","validation","cockroachdb"],"backgroundTag":"invalid-duration-format","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}