{"record":{"id":"ecffaea21098bb37","repo":"t8y2/dbx","slug":"socks-proxy-host-and-port-are-required","errorCode":null,"errorMessage":"socks_proxy host and port are required","messagePattern":"socks_proxy host and port are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rocketmq/connection.go","lineNumber":65,"sourceCode":"\t\tClusterName:    stringValue(connection, \"cluster_name\", \"clusterName\"),\n\t\tBrokerAddr:     stringValue(connection, \"broker_addr\", \"brokerAddr\"),\n\t\tAccessKey:      stringValue(connection, \"access_key\", \"accessKey\"),\n\t\tSecretKey:      stringValue(connection, \"secret_key\", \"secretKey\"),\n\t\tRequestTimeout: time.Duration(intValue(connection, int(defaultRequestTimeout/time.Millisecond), \"request_timeout_ms\")) * time.Millisecond,\n\t\tConnectTimeout: time.Duration(intValue(connection, int(defaultConnectTimeout/time.Millisecond), \"connect_timeout_ms\")) * time.Millisecond,\n\t\tTLSSkipVerify:  boolValue(connection, false, \"tls_skip_verify\"),\n\t}\n\tif config.RequestTimeout <= 0 {\n\t\tconfig.RequestTimeout = defaultRequestTimeout\n\t}\n\tif config.ConnectTimeout <= 0 {\n\t\tconfig.ConnectTimeout = defaultConnectTimeout\n\t}\n\tif proxy := nestedMap(connection, \"socks_proxy\"); proxy != nil {\n\t\thost := stringValue(proxy, \"host\")\n\t\tport := intValue(proxy, 0, \"port\")\n\t\tif host == \"\" || port <= 0 || port > 65535 {\n\t\t\treturn connectionConfig{}, fmt.Errorf(\"socks_proxy host and port are required\")\n\t\t}\n\t\tconfig.SocksProxy = &socksProxyConfig{\n\t\t\tHost: host, Port: port,\n\t\t\tUsername: stringValue(proxy, \"username\"),\n\t\t\tPassword: stringValue(proxy, \"password\"),\n\t\t}\n\t}\n\treturn config, nil\n}\n\nfunc (a *rocketMQAgent) connect(params map[string]any) (any, error) {\n\tconfig, err := parseConnection(params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient, proxies, clusterInfo, err := buildClient(config)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rocketmq/connection.go#L47-L83","documentation":"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.","triggerScenarios":"connection.socks_proxy provided with missing 'host', missing/zero 'port', or a port > 65535 (or negative).","commonSituations":"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.","solutions":["Provide both 'host' and a numeric 'port' (1-65535) inside socks_proxy","Check the port value type — a string port may not parse via intValue; use a number","Remove the socks_proxy block entirely if no proxy is intended"],"exampleFix":"// before\n\"socks_proxy\": {\"host\": \"proxy.internal\"}\n// after\n\"socks_proxy\": {\"host\": \"proxy.internal\", \"port\": 1080, \"username\": \"u\", \"password\": \"p\"}","handlingStrategy":"validation","validationCode":"if proxy, ok := conn[\"socks_proxy\"].(map[string]any); ok {\n    h := proxy[\"host\"]\n    p, _ := proxy[\"port\"].(float64)\n    if h == \"\" || p <= 0 || p > 65535 {\n        return errors.New(\"socks_proxy needs host and numeric port 1-65535\")\n    }\n}","typeGuard":"func validSocksProxy(proxy map[string]any) bool {\n    host := stringValue(proxy, \"host\")\n    port := intValue(proxy, 0, \"port\")\n    return host != \"\" && port > 0 && port <= 65535\n}","tryCatchPattern":null,"preventionTips":["Store port as a JSON number, not a string","Omit the socks_proxy key entirely when no proxy is used","Test proxy config in a dry-run/validation step before connect"],"tags":["proxy","validation","configuration"],"backgroundTag":"invalid-proxy-config","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}