{"record":{"id":"31b2cd121f847343","repo":"googleapis/mcp-toolbox","slug":"failed-to-open-connection-w","errorCode":null,"errorMessage":"failed to open connection: %w","messagePattern":"failed to open connection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/trino/trino.go","lineNumber":197,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unable to get logger from ctx: %s\", err)\n\t}\n\n\tif disableSslVerification {\n\t\tlogger.WarnContext(ctx, \"SSL verification is disabled for trino source %s. This is an insecure setting and should not be used in production.\\n\", name)\n\t\ttr := &http.Transport{\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t\t}\n\t\tclient := &http.Client{Transport: tr}\n\t\tclientName := fmt.Sprintf(\"insecure_trino_client_%s\", name)\n\t\tif err := trinogo.RegisterCustomClient(clientName, client); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to register custom client: %w\", err)\n\t\t}\n\t\tdsn = fmt.Sprintf(\"%s&custom_client=%s\", dsn, clientName)\n\t}\n\n\tdb, err := sql.Open(\"trino\", dsn)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open connection: %w\", err)\n\t}\n\n\t// Configure connection pool\n\tdb.SetMaxOpenConns(10)\n\tdb.SetMaxIdleConns(5)\n\tdb.SetConnMaxLifetime(time.Hour)\n\n\treturn db, nil\n}\n\nfunc buildTrinoDSN(host, port, user, password, catalog, schema, queryTimeout, accessToken string, kerberosEnabled, sslEnabled bool, sslCertPath, sslCert string) (string, error) {\n\t// Build query parameters\n\tquery := url.Values{}\n\tquery.Set(\"catalog\", catalog)\n\tquery.Set(\"schema\", schema)\n\tif queryTimeout != \"\" {\n\t\tquery.Set(\"queryTimeout\", queryTimeout)\n\t}","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/trino/trino.go#L179-L215","documentation":"sqlx.Open (via the Trino driver) failed in initTrinoConnectionPool — the DSN built from host/port/user/credentials/catalog/schema was rejected or the Trino coordinator was unreachable.","triggerScenarios":"Thrown at internal/sources/trino/trino.go:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify host, port, credentials, catalog and schema in the config","Confirm Trino coordinator reachability and TLS settings","Check Kerberos/access-token configuration if enabled"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}