{"record":{"id":"71d13b78961c6744","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-create-dialer-for-proxy-url-q-connection","errorCode":null,"errorMessage":"cannot create dialer for proxy_url=%q connection: %w","messagePattern":"cannot create dialer for proxy_url=%q connection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/promscrape/client.go","lineNumber":86,"sourceCode":"\t\t}\n\t\t// case for direct http proxy connection.\n\t\t// must be used for http based scrape targets\n\t\t// since standard golang http.transport has special case for it\n\t\tif strings.HasPrefix(sw.ScrapeURL, \"http://\") {\n\t\t\tif proxyURL.URL.Scheme == \"https\" {\n\t\t\t\tac = sw.ProxyAuthConfig\n\t\t\t}\n\t\t\tproxyURLFunc = http.ProxyURL(proxyURL.URL)\n\t\t\tsetProxyHeaders = func(req *http.Request) error {\n\t\t\t\treturn proxyURL.SetHeaders(sw.ProxyAuthConfig, req)\n\t\t\t}\n\t\t} else {\n\t\t\t// HTTP-Connect or socks5 proxy tunnel\n\t\t\t// it makes possible to use separate tls configurations\n\t\t\t// for proxy and backend connections\n\t\t\tproxyDial, err := proxyURL.NewDialFunc(sw.ProxyAuthConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cannot create dialer for proxy_url=%q connection: %w\", proxyURL, err)\n\t\t\t}\n\t\t\tdialFunc = netutil.NewStatDialFuncWithDial(\"vm_promscrape\", proxyDial)\n\t\t}\n\t}\n\n\ttr := httputil.NewTransport(false, \"vm_promscrape\")\n\tif sw.UnixSocket != \"\" {\n\t\t// Unix sockets are direct local endpoints and cannot be reached via HTTP proxies.\n\t\t// Proxy could be set implicitly via global env variable HTTP_PROXY\n\t\ttr.Proxy = nil\n\t} else if proxyURLFunc != nil {\n\t\ttr.Proxy = proxyURLFunc\n\t}\n\ttr.TLSHandshakeTimeout = 10 * time.Second\n\ttr.IdleConnTimeout = 2 * sw.ScrapeInterval\n\ttr.DisableKeepAlives = *disableKeepAlive || sw.DisableKeepAlive\n\ttr.DialContext = dialFunc\n\ttr.MaxIdleConnsPerHost = 100","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/promscrape/client.go#L68-L104","documentation":"Returned by newClient (lib/promscrape/client.go) when it cannot build the network dialer for a scrape going through proxy_url (HTTP-Connect or SOCKS5 tunnel). It typically fires on invalid proxy_url scheme or proxy TLS/auth configuration; the wrapped error is the dialer construction failure.","triggerScenarios":"Thrown at lib/promscrape/client.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the `proxy_url` host:port is correct and reachable","Check DNS and firewall rules for the proxy from the VictoriaMetrics host"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}