{"record":{"id":"c8ed3b83ee5cc949","repo":"googleapis/mcp-toolbox","slug":"invalid-querytimeout-q-w-c8ed3b","errorCode":null,"errorMessage":"invalid queryTimeout %q: %w","messagePattern":"invalid queryTimeout %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/oceanbase/oceanbase.go","lineNumber":169,"sourceCode":"\t}\n\n\tif err := results.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"errors encountered during row iteration: %w\", err)\n\t}\n\n\treturn out, nil\n}\n\nfunc initOceanBaseConnectionPool(ctx context.Context, tracer trace.Tracer, name, host, port, user, pass, dbname, queryTimeout string) (*sql.DB, error) {\n\t_, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)\n\tdefer span.End()\n\n\tdsn := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?parseTime=true\", user, pass, host, port, dbname)\n\n\tif queryTimeout != \"\" {\n\t\ttimeout, err := time.ParseDuration(queryTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid queryTimeout %q: %w\", queryTimeout, err)\n\t\t}\n\t\tdsn += \"&readTimeout=\" + timeout.String()\n\t}\n\n\tpool, err := sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"sql.Open: %w\", err)\n\t}\n\treturn pool, nil\n}\n","sourceCodeStart":151,"sourceCodeEnd":180,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/oceanbase/oceanbase.go#L151-L180","documentation":"initOceanBaseConnectionPool parses the queryTimeout string as a Go duration and appends it to the DSN as readTimeout. A malformed value (e.g. '30' without a unit) fails time.ParseDuration and aborts pool creation with this wrapped error.","triggerScenarios":"Configuring the OceanBase source with a queryTimeout value that is not a valid Go duration string, such as '30' or 'thirty seconds'.","commonSituations":"Users porting configs from other tools that accept plain seconds ('30'); YAML values quoted or unquoted incorrectly; mixing 's'/'m' units.","solutions":["Provide a valid duration string with a unit, e.g. '30s' or '5m'","Quote the value in YAML to avoid parser coercion (\"30s\")","Remove queryTimeout to use the driver default"],"exampleFix":"// before\nqueryTimeout: 30\n// after\nqueryTimeout: \"30s\"","handlingStrategy":"validation","validationCode":"import \"time\"\nfunc validTimeout(s string) bool {\n    if s == \"\" { return true }\n    _, err := time.ParseDuration(s)\n    return err == nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include units in durations ('30s', '5m')","Validate config values with time.ParseDuration before deployment","Quote duration strings in YAML","Add a CI check that parses all duration config fields"],"tags":["configuration","duration-parsing","oceanbase"],"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"}