googleapis/mcp-toolbox · error
unable to create connection client: %w
Error message
unable to create connection client: %w
What it means
initFalkorDBClient returns this when falkordb.FalkorDBNew(opts) fails to construct the connection client; Initialize then re-wraps it as 'unable to create client'. It covers errors raised while setting up the Redis-protocol client (options parsing, network setup).
Source
Thrown at internal/sources/falkordb/falkordb.go:129
//nolint:all // Reassigned ctx
ctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, r.Name)
defer span.End()
opts := &falkordb.ConnectionOption{
Addr: net.JoinHostPort(r.Host, r.Port),
Username: r.Username,
Password: r.Password,
}
if r.TLS.Enabled {
opts.TLSConfig = &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: r.TLS.InsecureSkipVerify,
}
}
client, err := falkordb.FalkorDBNew(opts)
if err != nil {
return nil, fmt.Errorf("unable to create connection client: %w", err)
}
return client, nil
}
var _ sources.Source = &Source{}
type Source struct {
Config
Client *falkordb.FalkorDB
}
func (s *Source) IsReadOnly() bool {
return false
}
func (s *Source) SourceType() string {
return SourceType
}View on GitHub (pinned to 8cc6e09de2)
Solutions
- Check the wrapped %w error from FalkorDBNew for the precise cause
- Validate host and port fields in tools.yaml (port as a numeric string)
- Ensure the address is resolvable from the machine running the toolbox
- Verify the falkordb-go v2 client version matches your deployment
Defensive patterns
Strategy: validation
Validate before calling
// Go: validate options the way FalkorDBNew will consume them
addr := net.JoinHostPort(cfg.Host, cfg.Port)
if cfg.Host == "" {
return fmt.Errorf("falkordb host is required")
}
if p, err := strconv.Atoi(cfg.Port); err != nil || p <= 0 || p > 65535 {
return fmt.Errorf("falkordb port %q is not a valid port number", cfg.Port)
} Try / catch
// Go: surface the wrapped cause
client, err := initFalkorDBClient(ctx, tracer, cfg)
if err != nil {
slog.ErrorContext(ctx, "falkordb client construction failed", "cause", err)
return err
} Prevention
- Validate host/port fields in tools.yaml before startup
- Ensure hostnames resolve from the toolbox's runtime environment
- Pin a compatible falkordb-go v2 client version
- Confirm TLS options only when tls.enabled is true
When it happens
Trigger: Invalid ConnectionOption (malformed Addr from net.JoinHostPort, bad TLS config), or FalkorDBNew failing during dial/address resolution at construction time.
Common situations: Malformed host/port values in tools.yaml; IPv6 hosts combined with odd port strings; TLS options the client library rejects; internal falkordb-go version incompatibilities.
Related errors
- unable to create client: %w
- unable to connect successfully: %w
- unable to create db connection: %w
- sql.Open: %w
- failed to list relationship types: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/75f6602bc2f06554.
Report an issue: GitHub.