{"record":{"id":"e1b74d7fbb75acfa","repo":"googleapis/mcp-toolbox","slug":"failed-to-register-custom-client-w","errorCode":null,"errorMessage":"failed to register custom client: %w","messagePattern":"failed to register custom client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/trino/trino.go","lineNumber":190,"sourceCode":"\tdsn, err := buildTrinoDSN(host, port, user, password, catalog, schema, queryTimeout, accessToken, kerberosEnabled, sslEnabled, sslCertPath, sslCert)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to build DSN: %w\", err)\n\t}\n\n\tlogger, err := util.LoggerFromContext(ctx)\n\tif err != nil {\n\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) {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/trino/trino.go#L172-L208","documentation":"trinogo.RegisterCustomClient failed while registering the insecure HTTP client created because disableSslVerification was set — the derived client name (insecure_trino_client_<name>) collides with an already-registered client.","triggerScenarios":"Thrown at internal/sources/trino/trino.go:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use unique source names when multiple sources disable SSL verification","Restart the process to clear the global client registry","Prefer proper TLS certificates over disabling verification"],"exampleFix":null,"handlingStrategy":"fallback","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"}