{"record":{"id":"d22bc8dea2087811","repo":"XTLS/Xray-core","slug":"cannot-understand-address-d22bc8","errorCode":null,"errorMessage":"cannot understand address","messagePattern":"cannot understand address","errorType":"console","errorClass":"errors.Error","httpStatus":null,"severity":"error","filePath":"app/observatory/observer.go","lineNumber":143,"sourceCode":"\t\t}\n\t}\n\to.status = pruned\n}\n\nfunc (o *Observer) probe(outbound string) ProbeResult {\n\terrorCollectorForRequest := newErrorCollector()\n\n\thttpTransport := http.Transport{\n\t\tProxy: func(*http.Request) (*url.URL, error) {\n\t\t\treturn nil, nil\n\t\t},\n\t\tDialContext: func(ctx context.Context, network string, addr string) (net.Conn, error) {\n\t\t\tvar connection net.Conn\n\t\t\ttaskErr := task.Run(ctx, func() error {\n\t\t\t\t// MUST use Xray's built in context system\n\t\t\t\tdest, err := v2net.ParseDestination(network + \":\" + addr)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.New(\"cannot understand address\").Base(err)\n\t\t\t\t}\n\t\t\t\ttrackedCtx := session.TrackedConnectionError(o.ctx, errorCollectorForRequest)\n\t\t\t\tconn, err := tagged.Dialer(trackedCtx, o.dispatcher, dest, outbound)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.New(\"cannot dial remote address \", dest).Base(err)\n\t\t\t\t}\n\t\t\t\tconnection = conn\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\tif taskErr != nil {\n\t\t\t\treturn nil, errors.New(\"cannot finish connection\").Base(taskErr)\n\t\t\t}\n\t\t\treturn connection, nil\n\t\t},\n\t\tTLSHandshakeTimeout: time.Second * 5,\n\t}\n\thttpClient := &http.Client{\n\t\tTransport: &httpTransport,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/app/observatory/observer.go#L125-L161","documentation":"Thrown in app/observatory/observer.go:143 inside the HTTP transport's DialContext: net.ParseDestination failed to parse the 'network:addr' string built from Go's http package (e.g. 'tcp:www.google.com:443') into an Xray destination. This is an internal translation step between Go's dialer interface and Xray's net types, and failure means the address Xray derived was structurally invalid.","triggerScenarios":"The probe URL resolves to a form ParseDestination cannot handle — practically limited to exotic/unparseable host:port combinations or non-tcp networks; for normal hostnames and ports this never fires. It can also fire if the proxy layer rewrites the address to something malformed.","commonSituations":"Extremely rare in stock configs; appears when ProbeUrl has a malformed authority (bad port, stray characters) or when embedding code supplies a custom transport with unusual address formats.","solutions":["Check the observatory ProbeUrl string for typos — especially the port and scheme separator.","Verify you are on a recent xray-core version where ParseDestination handles the address forms your setup produces.","Test the URL with curl to confirm it yields a normal host:port."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate probe URL before use\nif _, err := url.Parse(probeURL); err != nil {\n    return fmt.Errorf(\"invalid probe URL %q: %w\", probeURL, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use standard https://host/generate_204 style probe URLs.","Upgrade xray-core if embedding older versions with address-parsing gaps."],"tags":["go","xray","observatory","address-parsing"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}