{"record":{"id":"d2270e61fa824b05","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-pool-w-d2270e","errorCode":null,"errorMessage":"unable to create pool: %w","messagePattern":"unable to create pool: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/mindsdb/mindsdb.go","lineNumber":67,"sourceCode":"type Config struct {\n\tName         string `yaml:\"name\" validate:\"required\"`\n\tType         string `yaml:\"type\" validate:\"required\"`\n\tHost         string `yaml:\"host\" validate:\"required\"`\n\tPort         string `yaml:\"port\" validate:\"required\"`\n\tUser         string `yaml:\"user\" validate:\"required\"`\n\tPassword     string `yaml:\"password\"`\n\tDatabase     string `yaml:\"database\" validate:\"required\"`\n\tQueryTimeout string `yaml:\"queryTimeout\"`\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\tpool, err := initMindsDBConnectionPool(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Database, r.QueryTimeout)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create pool: %w\", err)\n\t}\n\n\terr = pool.PingContext(ctx)\n\tif err != nil {\n\t\tpool.Close()\n\t\treturn nil, fmt.Errorf(\"unable to connect successfully: %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 {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/mindsdb/mindsdb.go#L49-L85","documentation":"MindsDB Config.Initialize builds a MySQL-compatible connection pool via initMindsDBConnectionPool; if pool construction fails (bad DSN parameters, unreachable host, driver error), the error is wrapped as \"unable to create pool\". Initialization aborts before any ping is attempted.","triggerScenarios":"Initialize called with a host/port that fails to resolve or connect, invalid user/password format producing a bad DSN, or invalid query timeout such that the go-sql-driver/mysql mysql.New() (or equivalent) fails.","commonSituations":"Wrong MindsDB host or port (default 47335); typo in hostname; DNS failure in containers; unsupported characters in credentials breaking DSN formatting.","solutions":["Verify the MindsDB host and port (default 47335 for MySQL protocol) are correct and reachable","Test connectivity: `nc -zv <host> <port>` or `mysql -h <host> -P <port> -u <user> -p`","Escape or sanitize special characters in user/password so the DSN is valid","Check that the MindsDB server is running and accepting connections"],"exampleFix":"// before\nhost: mindb.internal\nport: 3306\n// after\nhost: mindsdb.example.com\nport: 47335","handlingStrategy":"validation","validationCode":"conn, err := net.DialTimeout(\"tcp\", net.JoinHostPort(host, port), 3*time.Second)\nif err != nil {\n    return fmt.Errorf(\"mindsdb unreachable at %s:%s: %w\", host, port, err)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var ne net.Error\n    if errors.As(err, &ne) && ne.Timeout() {\n        // host/port or firewall issue\n    }\n    return fmt.Errorf(\"pool init failed: %w\", err)\n}","preventionTips":["Confirm MindsDB MySQL-protocol port (default 47335) before deploy","Escape special characters in DSN fields (user/password)","Pre-flight DNS/TCP checks in CI and container entrypoints"],"tags":["mindsdb","mysql","pool","connection","config"],"backgroundTag":"connection-pool-creation-failed","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"}