{"record":{"id":"234b754ed92e57bd","repo":"XTLS/Xray-core","slug":"failed-to-find-an-available-destination-234b75","errorCode":null,"errorMessage":"failed to find an available destination","messagePattern":"failed to find an available destination","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/socks/client.go","lineNumber":75,"sourceCode":"\t// Destination of the inner request.\n\tdestination := ob.Target\n\n\t// Outbound server.\n\tserver := c.server\n\tdest := server.Destination\n\t// Connection to the outbound server.\n\tvar conn stat.Connection\n\n\tif err := retry.ExponentialBackoff(5, 100).On(func() error {\n\t\trawConn, err := dialer.Dial(ctx, dest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tconn = rawConn\n\n\t\treturn nil\n\t}); err != nil {\n\t\treturn errors.New(\"failed to find an available destination\").Base(err)\n\t}\n\n\tdefer func() {\n\t\tif err := conn.Close(); err != nil {\n\t\t\terrors.LogInfoInner(ctx, err, \"failed to closed connection\")\n\t\t}\n\t}()\n\n\tp := c.policyManager.ForLevel(0)\n\n\trequest := &protocol.RequestHeader{\n\t\tVersion: socks5Version,\n\t\tCommand: protocol.RequestCommandTCP,\n\t\tAddress: destination.Address,\n\t\tPort:    destination.Port,\n\t}\n\n\tif destination.Network == net.Network_UDP {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/socks/client.go#L57-L93","documentation":"Error \"failed to find an available destination\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/socks/client.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}