{"record":{"id":"4e728ba1ba9d5daf","repo":"googleapis/mcp-toolbox","slug":"unable-to-connect-successfully-w-4e728b","errorCode":null,"errorMessage":"unable to connect successfully: %w","messagePattern":"unable to connect successfully: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/falkordb/falkordb.go","lineNumber":100,"sourceCode":"\t\treturn nil, 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\tif r.TLS.InsecureSkipVerify {\n\t\tlogger.WarnContext(ctx, fmt.Sprintf(\"TLS certificate verification is skipped (insecureSkipVerify: true) for FalkorDB source %s. This exposes traffic for this source to man-in-the-middle attacks. Do not use in production.\", r.Name))\n\t}\n\n\tclient, err := initFalkorDBClient(ctx, tracer, r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create client: %w\", err)\n\t}\n\n\tif err := client.Conn.Ping(ctx).Err(); err != nil {\n\t\tclient.Conn.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\tClient: client,\n\t}\n\treturn s, nil\n}\n\nfunc initFalkorDBClient(ctx context.Context, tracer trace.Tracer, r Config) (*falkordb.FalkorDB, error) {\n\t//nolint:all // Reassigned ctx\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, r.Name)\n\tdefer span.End()\n\n\topts := &falkordb.ConnectionOption{\n\t\tAddr:     net.JoinHostPort(r.Host, r.Port),\n\t\tUsername: r.Username,\n\t\tPassword: r.Password,","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/falkordb/falkordb.go#L82-L118","documentation":"After constructing the client, Initialize pings the FalkorDB (Redis-compatible) connection; if PING fails, the client is closed and this error is returned with the underlying cause wrapped. The client object was created but no live connection could be established.","triggerScenarios":"Server unreachable at host:port (connection refused/timeout), wrong credentials (Redis NOAUTH/WRONGPASS), TLS handshake failure against a plaintext server or vice versa, or the instance not yet ready.","commonSituations":"FalkorDB container not started or wrong port; password set via requirepass but missing in config; enabling tls.enabled against a server without TLS (or the reverse); startup ordering in Kubernetes before the DB is ready.","solutions":["Confirm the server is up and reachable: `redis-cli -h <host> -p <port> PING`","Check username/password match the server's auth requirements","Match tls.enabled to the server (enable only if the server actually speaks TLS)","Inspect the wrapped error: connection refused vs NOAUTH vs TLS handshake tells you which fix applies"],"exampleFix":"// before\n    tls:\n      enabled: true   # server has no TLS\n// after\n    tls:\n      enabled: false","handlingStrategy":"retry","validationCode":"// preflight: server must accept a PING before toolbox startup\nredis-cli -u redis://:\"$FALKOR_PASS\"@\"$FALKOR_HOST\":\"$FALKOR_PORT\" PING","typeGuard":null,"tryCatchPattern":"// Go: distinguish auth/TLS errors (no retry) from transient connectivity (retry)\nsrc, err := cfg.Initialize(ctx, tracer)\nif err != nil && strings.Contains(err.Error(), \"unable to connect successfully\") {\n    if strings.Contains(err.Error(), \"WRONGPASS\") || strings.Contains(err.Error(), \"tls\") {\n        return err // fix credentials or tls.enabled; retrying won't help\n    }\n    return retryWithBackoff(ctx, func() error { _, err := cfg.Initialize(ctx, tracer); return err })\n}","preventionTips":["Ensure FalkorDB is running and ready before toolbox starts (readiness gates)","Set username/password when the server requires auth","Match tls.enabled to the server's actual TLS capability","Check the wrapped error: refused → server/port, NOAUTH → credentials, handshake → TLS mismatch"],"tags":["network","falkordb","connection","ping","tls"],"backgroundTag":"connection-refused","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"}