{"record":{"id":"8f135ba8d6df96c4","repo":"XTLS/Xray-core","slug":"failed-to-find-an-available-destination-8f135b","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/hysteria/client.go","lineNumber":65,"sourceCode":"\treturn &Client{\n\t\tserver:        server,\n\t\tpolicyManager: p,\n\t}, nil\n}\n\nfunc (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {\n\toutbounds := session.OutboundsFromContext(ctx)\n\tob := outbounds[len(outbounds)-1]\n\tif !ob.Target.IsValid() {\n\t\treturn errors.New(\"target not specified\")\n\t}\n\tob.Name = \"hysteria\"\n\tob.CanSpliceCopy = 3\n\ttarget := ob.Target\n\n\tconn, err := dialer.Dial(hysteria.ContextWithDatagram(ctx, target.Network == net.Network_UDP), c.server.Destination)\n\tif err != nil {\n\t\treturn errors.New(\"failed to find an available destination\").AtWarning().Base(err)\n\t}\n\tdefer conn.Close()\n\terrors.LogInfo(ctx, \"tunneling request to \", target, \" via \", target.Network, \":\", c.server.Destination.NetAddr())\n\n\tvar newCtx context.Context\n\tvar newCancel context.CancelFunc\n\tif session.TimeoutOnlyFromContext(ctx) {\n\t\tnewCtx, newCancel = context.WithCancel(context.Background())\n\t}\n\n\tsessionPolicy := c.policyManager.ForLevel(0)\n\tctx, cancel := context.WithCancel(ctx)\n\ttimer := signal.CancelAfterInactivity(ctx, func() {\n\t\tcancel()\n\t\tif newCancel != nil {\n\t\t\tnewCancel()\n\t\t}\n\t}, sessionPolicy.Timeouts.ConnectionIdle)","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/hysteria/client.go#L47-L83","documentation":"Error \"failed to find an available destination\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/hysteria/client.go:65 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"}