t8y2/dbx · error

socks_proxy host and port are required

Error message

socks_proxy host and port are required

What it means

Returned by parseConnection in the rocketmq driver when a socks_proxy option is present but lacks host and/or port. The proxy configuration is validated at parse time so connections cannot proceed with a half-specified SOCKS endpoint; both connect and testConnection surface this.

Source

Thrown at agents/drivers/rocketmq/connection.go:65

		ClusterName:    stringValue(connection, "cluster_name", "clusterName"),
		BrokerAddr:     stringValue(connection, "broker_addr", "brokerAddr"),
		AccessKey:      stringValue(connection, "access_key", "accessKey"),
		SecretKey:      stringValue(connection, "secret_key", "secretKey"),
		RequestTimeout: time.Duration(intValue(connection, int(defaultRequestTimeout/time.Millisecond), "request_timeout_ms")) * time.Millisecond,
		ConnectTimeout: time.Duration(intValue(connection, int(defaultConnectTimeout/time.Millisecond), "connect_timeout_ms")) * time.Millisecond,
		TLSSkipVerify:  boolValue(connection, false, "tls_skip_verify"),
	}
	if config.RequestTimeout <= 0 {
		config.RequestTimeout = defaultRequestTimeout
	}
	if config.ConnectTimeout <= 0 {
		config.ConnectTimeout = defaultConnectTimeout
	}
	if proxy := nestedMap(connection, "socks_proxy"); proxy != nil {
		host := stringValue(proxy, "host")
		port := intValue(proxy, 0, "port")
		if host == "" || port <= 0 || port > 65535 {
			return connectionConfig{}, fmt.Errorf("socks_proxy host and port are required")
		}
		config.SocksProxy = &socksProxyConfig{
			Host: host, Port: port,
			Username: stringValue(proxy, "username"),
			Password: stringValue(proxy, "password"),
		}
	}
	return config, nil
}

func (a *rocketMQAgent) connect(params map[string]any) (any, error) {
	config, err := parseConnection(params)
	if err != nil {
		return nil, err
	}
	client, proxies, clusterInfo, err := buildClient(config)
	if err != nil {
		return nil, err

View on GitHub (pinned to c0390bff16)

Solutions

  1. Provide both 'host' and a numeric 'port' (1-65535) inside socks_proxy
  2. Check the port value type — a string port may not parse via intValue; use a number
  3. Remove the socks_proxy block entirely if no proxy is intended

Example fix

// before
"socks_proxy": {"host": "proxy.internal"}
// after
"socks_proxy": {"host": "proxy.internal", "port": 1080, "username": "u", "password": "p"}
Defensive patterns

Strategy: validation

Validate before calling

if proxy, ok := conn["socks_proxy"].(map[string]any); ok {
    h := proxy["host"]
    p, _ := proxy["port"].(float64)
    if h == "" || p <= 0 || p > 65535 {
        return errors.New("socks_proxy needs host and numeric port 1-65535")
    }
}

Type guard

func validSocksProxy(proxy map[string]any) bool {
    host := stringValue(proxy, "host")
    port := intValue(proxy, 0, "port")
    return host != "" && port > 0 && port <= 65535
}

Prevention

When it happens

Trigger: connection.socks_proxy provided with missing 'host', missing/zero 'port', or a port > 65535 (or negative).

Common situations: Proxy set via env templates where only some fields resolve; copying an HTTP proxy URL instead of structured host/port; typo'd nested key so host reads empty.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/ecffaea21098bb37. Report an issue: GitHub.