{"record":{"id":"982ee6a08d956a20","repo":"googleapis/mcp-toolbox","slug":"invalid-querytimeout-q-w-982ee6","errorCode":null,"errorMessage":"invalid queryTimeout %q: %w","messagePattern":"invalid queryTimeout %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/singlestore/singlestore.go","lineNumber":199,"sourceCode":"\t\tDBName:               cfg.Database,\n\t\tParseTime:            true,\n\t\tAllowNativePasswords: true,\n\t\tCheckConnLiveness:    true,\n\t\tMaxAllowedPacket:     64 << 20,\n\t\tConnectionAttributes: \"_connector_name:MCP toolbox for Databases\",\n\t\tParams: map[string]string{\n\t\t\t\"vector_type_project_format\": \"JSON\",\n\t\t},\n\t}\n\n\t// Default to TLS preferred; can be overridden via connectionParams.\n\tconnectionParams.Set(\"tls\", \"preferred\")\n\n\t// Derive readTimeout from queryTimeout when provided.\n\tif cfg.QueryTimeout != \"\" {\n\t\ttimeout, err := time.ParseDuration(cfg.QueryTimeout)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid queryTimeout %q: %w\", cfg.QueryTimeout, err)\n\t\t}\n\t\tconnectionParams.Set(\"readTimeout\", timeout.String())\n\t}\n\n\t// Custom user parameters (e.g. tls, compress) — may override defaults above.\n\tfor k, v := range cfg.ConnectionParams {\n\t\tif v == \"\" {\n\t\t\tcontinue // skip empty values\n\t\t}\n\t\tconnectionParams.Set(k, v)\n\t}\n\tdsn := mysqlCfg.FormatDSN()\n\tif enc := connectionParams.Encode(); enc != \"\" {\n\t\tdsn += \"&\" + enc\n\t}\n\n\t// Interact with the driver directly as you normally would\n\tpool, err := sql.Open(\"mysql\", dsn)","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/singlestore/singlestore.go#L181-L217","documentation":"initSingleStoreConnectionPool wraps time.ParseDuration errors for cfg.QueryTimeout with this message. QueryTimeout must be a valid Go duration string (e.g. \"30s\", \"2m\"); when it is not parseable, pool construction aborts before any network access, so Initialize fails immediately.","triggerScenarios":"Setting queryTimeout in the SingleStore source config to a value Go's time.ParseDuration cannot parse — missing unit (\"30\"), wrong unit (\"30 sec\"), negative, or free text (\"thirty seconds\").","commonSituations":"Copy-pasting timeout formats from other ecosystems (\"30s\" vs \"30000ms\" vs \"PT30S\"), forgetting the unit, or YAML quoting issues turning the value into something unexpected.","solutions":["Use a Go duration string with a unit: \"30s\", \"5m\", \"1h30m\".","Quote the value in YAML if it contains special characters: queryTimeout: \"30s\".","Remove the queryTimeout field to fall back to driver defaults if a timeout is not needed.","Check for hidden whitespace or BOM characters in the config value."],"exampleFix":"// before\nqueryTimeout: 30\n// after\nqueryTimeout: \"30s\"","handlingStrategy":"validation","validationCode":"// Validate queryTimeout before building the config\nfunc validateQueryTimeout(qt string) error {\n    if qt == \"\" { return nil }\n    _, err := time.ParseDuration(qt)\n    return err // must be like \"30s\", \"5m\", \"1h\"\n}","typeGuard":null,"tryCatchPattern":"if err := validateQueryTimeout(cfg.QueryTimeout); err != nil {\n    return fmt.Errorf(\"fix queryTimeout to Go duration format, e.g. 30s: %w\", err)\n}\nsrc, err := cfg.Initialize(ctx, tracer)","preventionTips":["Always include a unit: s, m, h (never bare numbers)","Quote duration values in YAML","Keep durations portable across teams; document the Go format","Lint configs for known duration fields"],"tags":["singlestore","config","validation","timeout"],"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"}