{"record":{"id":"b8017af14404b01a","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-pool-w-b8017a","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/firebird/firebird.go","lineNumber":65,"sourceCode":"\ntype 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\" validate:\"required\"`\n\tDatabase string `yaml:\"database\" validate:\"required\"`\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 := initFirebirdConnectionPool(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Database)\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\tDb:     pool,\n\t}\n\treturn s, nil\n}\n\nvar _ sources.Source = &Source{}\n\ntype Source struct {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firebird/firebird.go#L47-L83","documentation":"Wrapped by Firebird Config.Initialize when initFirebirdConnectionPool fails to even open a database/sql pool via the firebirdsql driver. sql.Open only validates the DSN format and driver registration, so this almost always indicates a malformed connection string rather than a network problem.","triggerScenarios":"Initialize called with a Config whose Name/Host/Port/User/Password/Database produce an invalid DSN (e.g. empty fields, special chars like '@' or ':' in the password breaking user:password@host:port/db format), or the firebirdsql driver not registered.","commonSituations":"Password containing ':' or '@' unescaped; empty database path (must end in .fdb and include full path for embedded); blank host/port fields from missing config; blank import of the firebirdsql driver missing so sql.Open returns unknown driver.","solutions":["Check each DSN component is non-empty and properly escaped (URL-encode or escape ':' '@' '/' in user and password)","Confirm the database file path is absolute and ends in .fdb for local files, or host:port points at a running Firebird server","Ensure _ \"github.com/mattn/go-adodb\"-style blank import of firebirdsql driver is present (github.com/flygo/fb or mattn/go-firebirdsql per go.mod)","Test the DSN manually with a Firebird client (isql) using the same credentials"],"exampleFix":"// before\npool, err := initFirebirdConnectionPool(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Database)\nif err != nil {\n    return nil, fmt.Errorf(\"unable to create pool: %w\", err)\n}\n// after\nif r.Host == \"\" || r.Database == \"\" {\n    return nil, fmt.Errorf(\"invalid firebird config: host and database are required\")\n}\npool, err := initFirebirdConnectionPool(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Database)\nif err != nil {\n    return nil, fmt.Errorf(\"unable to create pool: %w\", err)\n}","handlingStrategy":"validation","validationCode":"// Validate DSN components before Initialize\nfunc validateFirebirdConfig(host, port, user, pass, db string) error {\n    if host == \"\" || port == \"\" || user == \"\" || db == \"\" {\n        return errors.New(\"firebird config: host, port, user and database are required\")\n    }\n    if strings.ContainsAny(user+pass, \":@/\") {\n        return errors.New(\"firebird config: user/password contain unescaped DSN characters (: @ /)\")\n    }\n    return nil\n}","typeGuard":"func isDriverMissing(err error) bool {\n    return strings.Contains(err.Error(), \"unknown driver\")\n}","tryCatchPattern":"pool, err := initFirebirdConnectionPool(ctx, tracer, name, host, port, user, pass, db)\nif err != nil {\n    if isDriverMissing(err) {\n        return nil, fmt.Errorf(\"firebirdsql driver not registered; add blank import: %w\", err)\n    }\n    return nil, fmt.Errorf(\"unable to create pool: %w\", err)\n}","preventionTips":["Blank-import the firebirdsql driver next to database/sql usage","Escape or forbid ':', '@', '/' in credentials used in DSNs","Fail fast with field-level config validation before building DSNs","Verify registered drivers with sql.Drivers() in a startup check"],"tags":["firebird","connection-pool","dsn","configuration"],"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"}