{"record":{"id":"8000898886cc1af8","repo":"googleapis/mcp-toolbox","slug":"sql-open-w-800089","errorCode":null,"errorMessage":"sql.Open: %w","messagePattern":"sql\\.Open: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/singlestore/singlestore.go","lineNumber":219,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"sql.Open: %w\", err)\n\t}\n\treturn pool, nil\n}\n","sourceCodeStart":201,"sourceCodeEnd":223,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/singlestore/singlestore.go#L201-L223","documentation":"initSingleStoreConnectionPool wraps sql.Open errors with this message. sql.Open validates the driver name and performs minimal DSN parsing; a failure here means the DSN built from the config (user, password, host, port, database, connection params) is malformed or the mysql driver is not registered.","triggerScenarios":"Malformed DSN caused by bad config values (unescaped characters in password, invalid connectionParams keys/values, bad host format) or, rarely, the mysql driver failing to register.","commonSituations":"Passwords containing special characters like @ or / without URL-escaping, invalid characters in connection params that break the encoded query string, empty host, or stray whitespace in config fields.","solutions":["Check the wrapped error for the exact DSN parse failure point.","URL-escape special characters in the password or change it to an alphanumeric value temporarily.","Validate connectionParams keys/values; remove exotic or duplicated params one at a time to isolate the offender.","Confirm host/port formatting (no scheme, no trailing slash) in the source config.","Ensure go-sql-driver/mysql is imported/registered (it is in this build; a custom binary build may lack it)."],"exampleFix":"// before (unescaped password with @)\npassword: p@ss word\n// after\npassword: \"p%40ss%20word\"  # or change password to avoid special chars","handlingStrategy":"validation","validationCode":"// Validate DSN-relevant fields before Initialize\nfunc validateSSConfig(cfg Config) error {\n    if cfg.Host == \"\" { return errors.New(\"host required\") }\n    if strings.ContainsAny(cfg.Password, \"@/ \") { return errors.New(\"password contains DSN-unsafe chars; URL-escape it\") }\n    for k := range cfg.ConnectionParams {\n        if strings.ContainsAny(k, \"=& \") { return fmt.Errorf(\"invalid connection param key %q\", k) }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil && strings.Contains(err.Error(), \"sql.Open:\") {\n    return fmt.Errorf(\"DSN invalid — check host/port/password escaping/params: %w\", err)\n}","preventionTips":["URL-escape special characters in passwords","Keep connection params simple and documented","Verify with the mysql CLI before wiring config","Avoid stray whitespace in config fields"],"tags":["singlestore","config","dsn","validation"],"backgroundTag":"invalid-dsn","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"}