{"record":{"id":"8ffc5e007582509d","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-pool-w-8ffc5e","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/trino/trino.go","lineNumber":77,"sourceCode":"\tCatalog                string `yaml:\"catalog\" validate:\"required\"`\n\tSchema                 string `yaml:\"schema\" validate:\"required\"`\n\tQueryTimeout           string `yaml:\"queryTimeout\"`\n\tAccessToken            string `yaml:\"accessToken\"`\n\tKerberosEnabled        bool   `yaml:\"kerberosEnabled\"`\n\tSSLEnabled             bool   `yaml:\"sslEnabled\"`\n\tSSLCertPath            string `yaml:\"sslCertPath\"`\n\tSSLCert                string `yaml:\"sslCert\"`\n\tDisableSslVerification bool   `yaml:\"disableSslVerification\"`\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 := initTrinoConnectionPool(ctx, tracer, r.Name, r.Host, r.Port, r.User, r.Password, r.Catalog, r.Schema, r.QueryTimeout, r.AccessToken, r.KerberosEnabled, r.SSLEnabled, r.SSLCertPath, r.SSLCert, r.DisableSslVerification)\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":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/trino/trino.go#L59-L95","documentation":"Trino Config.Initialize wraps any failure from initTrinoConnectionPool. Pool creation involves building the Trino DSN, sql.Open, and setting driver-level connector options, so failures here mean the pool could not be constructed at all (not a connectivity issue yet — that is the following PingContext error). The underlying cause is preserved via %w.","triggerScenarios":"Initialize on a Trino source where initTrinoConnectionPool returns an error: buildTrinoDSN failure, sql.Open failure, or errors configuring the connector (e.g. invalid SSL cert material).","commonSituations":"Invalid sslCertPath or inline sslCert content; malformed host/port values from config; unsupported combination of kerberosEnabled/accessToken/SSL flags passed to buildTrinoDSN.","solutions":["Inspect the wrapped cause for the exact failing step (DSN build vs sql.Open)","Validate trino source config: host, port, user, catalog, schema, queryTimeout are well-formed","If SSL is enabled, verify the certificate file exists and is PEM-encoded at sslCertPath","Check for invalid auth combos (e.g. both accessToken and kerberos enabled)"],"exampleFix":"// before\nsslCertPath: \"./certs/trino.crt\"  // file missing\n// after\nsslCertPath: \"/etc/trino/tls/ca.pem\" // verify: ls -l /etc/trino/tls/ca.pem","handlingStrategy":"validation","validationCode":"func validateTrinoConfig(r trino.Config) error {\n    if r.Host == \"\" || r.Port == \"\" || r.User == \"\" { return errors.New(\"trino: host, port and user are required\") }\n    if _, err := strconv.Atoi(r.Port); err != nil { return fmt.Errorf(\"trino: bad port %q\", r.Port) }\n    if r.SSLEnabled && r.SSLCertPath != \"\" {\n        if _, err := os.ReadFile(r.SSLCertPath); err != nil { return fmt.Errorf(\"trino: cert unreadable: %w\", err) }\n    }\n    if r.KerberosEnabled && r.AccessToken != \"\" { return errors.New(\"trino: kerberos and accessToken are mutually exclusive\") }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil && strings.Contains(err.Error(), \"unable to create pool\") {\n    return fmt.Errorf(\"trino source misconfigured: %w\", err)\n}","preventionTips":["Validate all trino config fields (host, port, catalog, schema) before calling Initialize","Pre-check SSL cert files exist and are readable PEM","Avoid enabling both kerberos and access token auth","Keep queryTimeout a plain numeric string"],"tags":["database","trino","connection-pool","initialization"],"backgroundTag":"connection-pool-init-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"}