[GH-ISSUE #6312] [Bug]: TCP Test fails for VLESS outbounds with standard vnext configuration format ("No testable endpoint") #4286

Closed
opened 2026-10-31 20:38:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @catmarcus on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6312

Describe the bug

When creating a vless outbound that strictly follows the official Xray standard configuration format (using the vnext array for endpoints), the internal TCP test in the panel (/panel/api/xray/testOutbounds) fails to extract the address and port. It returns a "No testable endpoint" error or 0ms delay, even though the outbound is perfectly valid and actual proxy traffic (HTTP/SOCKS) flows through it flawlessly.

How to reproduce the problem

Create a vless outbound in the panel with a standard Xray vnext JSON structure in the settings block, for example:
json
{
"vnext": [
{
"address": "example.domain.com",
"port": 443,
"users": [
{
"id": "uuid-here",
"encryption": "none"
}
]
}
]
}
Click the "Test" (TCP ping) button for this outbound.
The UI will indicate that there is no testable endpoint, because the backend fails to parse the IP/Port.
Root Cause:
The bug is located in internal/web/service/outbound/outbound.go within the extractOutboundEndpoints function.

While the vmess protocol correctly iterates over the vnext array to extract endpoints, the vless protocol explicitly hardcodes the extraction to the root of the settings object (settings["address"]). This breaks compatibility with strict Xray configurations that correctly place the address inside the vnext array.

Current implementation (internal/web/service/outbound/outbound.go ~line 259):

go
case "vless":
addServer(settings["address"], settings["port"])
Proposed Fix:
Update the vless case in extractOutboundEndpoints to parse the vnext array identically to vmess, while keeping a fallback to the root address/port to preserve backward compatibility with legacy flat configurations generated by older versions of the panel.

go
case "vless":
if vnext, ok := settings["vnext"].([]any); ok {
for _, v := range vnext {
if vm, ok := v.(map[string]any); ok {
addServer(vm["address"], vm["port"])
}
}
}
// Fallback for legacy flat configs
if settings["address"] != nil {
addServer(settings["address"], settings["port"])
}

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.7.0

Xray-core version

26.6.27+

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @catmarcus on GitHub (Aug 25, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6312 ### Describe the bug When creating a vless outbound that strictly follows the official Xray standard configuration format (using the vnext array for endpoints), the internal TCP test in the panel (/panel/api/xray/testOutbounds) fails to extract the address and port. It returns a "No testable endpoint" error or 0ms delay, even though the outbound is perfectly valid and actual proxy traffic (HTTP/SOCKS) flows through it flawlessly. ### How to reproduce the problem Create a vless outbound in the panel with a standard Xray vnext JSON structure in the settings block, for example: json { "vnext": [ { "address": "example.domain.com", "port": 443, "users": [ { "id": "uuid-here", "encryption": "none" } ] } ] } Click the "Test" (TCP ping) button for this outbound. The UI will indicate that there is no testable endpoint, because the backend fails to parse the IP/Port. Root Cause: The bug is located in internal/web/service/outbound/outbound.go within the extractOutboundEndpoints function. While the vmess protocol correctly iterates over the vnext array to extract endpoints, the vless protocol explicitly hardcodes the extraction to the root of the settings object (settings["address"]). This breaks compatibility with strict Xray configurations that correctly place the address inside the vnext array. Current implementation (internal/web/service/outbound/outbound.go ~line 259): go case "vless": addServer(settings["address"], settings["port"]) Proposed Fix: Update the vless case in extractOutboundEndpoints to parse the vnext array identically to vmess, while keeping a fallback to the root address/port to preserve backward compatibility with legacy flat configurations generated by older versions of the panel. go case "vless": if vnext, ok := settings["vnext"].([]any); ok { for _, v := range vnext { if vm, ok := v.(map[string]any); ok { addServer(vm["address"], vm["port"]) } } } // Fallback for legacy flat configs if settings["address"] != nil { addServer(settings["address"], settings["port"]) } ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.7.0 ### Xray-core version 26.6.27+ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:33 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Aug 25, 2026):

Confirmed — your reading of the code is correct. extractOutboundEndpoints handles VLESS only in the panel's flat wire shape, so a vnext-shaped VLESS outbound yields zero endpoints and the TCP probe short-circuits with "No testable endpoint". It is still present on the default branch (v3.7.0).

The deciding lines, internal/web/service/outbound/outbound.go:251-260:

	case "vmess":
		if vnext, ok := settings["vnext"].([]any); ok {
			for _, v := range vnext {
				if vm, ok := v.(map[string]any); ok {
					addServer(vm["address"], vm["port"])
				}
			}
		}
	case "vless":
		addServer(settings["address"], settings["port"])

addServer only appends when host != "" && p > 0 (outbound.go:246), so with vnext present and no top-level address, out stays empty and testOutboundTCP returns at outbound.go:164-166:

	endpoints := extractOutboundEndpoints(ob)
	if len(endpoints) == 0 {
		return &TestOutboundResult{Tag: tag, Mode: "tcp", Success: false, Error: "No testable endpoint"}, nil
	}

This is the default path: the outbounds tab starts in TCP mode (frontend/src/pages/xray/outbounds/OutboundsTab.tsx:125 — useState<OutboundTestMode>('tcp')). Only TCP mode is affected; mode values other than "tcp" route through a temporary Xray instance (internal/web/service/outbound/probe_http.go:171) and never call the extractor.

Two workarounds, both available today:

  1. Switch the test mode toggle in the Outbounds toolbar from TCP to HTTP — that probe builds a real Xray instance and does not need endpoint extraction.
  2. Open the outbound in the panel's edit modal and save it once. The frontend adapter already reads vnext on load (frontend/src/lib/xray/outbound-form-adapter.ts:122-131) and writes the flat shape back out (vlessToWire, same file :507-514), so one save normalises the stored settings and the TCP test starts working.

One correction to the report's framing: 3x-ui's canonical VLESS outbound shape is the flat one, not vnext, and that is deliberate rather than an oversight. All three link implementations and the docs agree:

  • internal/util/link/outbound.go:282-288 emits {"address","port","id","flow","encryption"} when importing a vless:// link;
  • frontend/src/lib/xray/outbound-defaults.ts:60-68 seeds the flat shape for new VLESS outbounds;
  • docs/lib/xray/outbounds.ts:3 — // - VLESS uses the FLAT settings form {address,port,id,flow,encryption}.
  • TestSubJsonServiceVlessFlattened (internal/sub/json_service_test.go:139-150) fails the build if a VLESS outbound in a JSON subscription carries vnext;
  • the user docs state it outright at docs/content/docs/en/operations/outbounds-routing.mdx:42-43.

That does not make the report wrong — the panel's own form adapter accepts vnext for VLESS and converts it, so the backend refusing to read the very shape the frontend tolerates is a genuine inconsistency, and the Advanced JSON editor lets that shape reach the config untouched.

Verdict: Confirmed bug
Severity: Medium
Confidence: High
Root cause: extractOutboundEndpoints in internal/web/service/outbound/outbound.go:259-260 reads VLESS endpoints only from settings.address / settings.port. Triggered whenever a VLESS outbound's stored settings use the vnext[] shape (hand-written config, Advanced JSON editor, or an imported third-party config) and the outbound is probed in TCP mode. Introduced by 8834e5fb "feat(xray/outbounds): TCP probe mode + Test All + timing breakdown" (2026-05-11), the commit that added the extractor.
Already fixed: Still present on the default branch (f727d04f, v3.7.0). First shipped in v3.0.1 (git tag --contains 8834e5fb); no later commit touches the case "vless": arm — git log -S 'case "vless":' -- internal/web/service/outbound/outbound.go returns only the 41645255 file move.
Duplicate of: None. #5860 ("Freedom ping test in the outbound section") is a different root cause — freedom is excluded deliberately at outbound.go:159.
Evidence: internal/web/service/outbound/outbound.go:259-260 case "vless": addServer(settings["address"], settings["port"]); outbound.go:164-166 returns "No testable endpoint"; outbound.go:246 if host != "" && p > 0; probe_http.go:171 if mode == "tcp" && !outboundTransportIsUDP(ob); OutboundsTab.tsx:125 default 'tcp'; outbound-form-adapter.ts:122-131 (reads vnext) and :507-514 (vlessToWire emits flat); docs/lib/xray/outbounds.ts:3; internal/sub/json_service_test.go:139-150. No test currently pins extractOutboundEndpoints — grep -rn extractOutboundEndpoints matches only outbound.go, so nothing defends the current behaviour.
Not determined: Whether xray-core v26.6.27 still parses vnext for VLESS outbounds — the module source is outside this checkout, so I could not confirm your statement that traffic flows through the outbound normally. If it does not, the config is silently inert and the panel is right to find no endpoint; running xray -test -config <generated config> on the server would settle it in one command.

Suggested fix: extend the case "vless": arm in extractOutboundEndpoints to read settings.vnext[] before falling back to the flat address/port, which is what the frontend adapter already does. The symmetric gap is worth the same one-line treatment while the file is open: the vmess arm reads only vnext and misses the flat shape (the shape the panel's own JSON subscriptions emit — TestSubJsonServiceVmessFlattened, internal/sub/json_service_test.go:162-172), and trojan/shadowsocks/http/socks read only servers[]. A table-driven test over extractOutboundEndpoints would pin all of them at once.

There is also a matching frontend gap in the outbounds table itself: outboundAddresses reads VLESS flat-only at frontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts:33-34, so a vnext-shaped VLESS row renders its address column as a bare :.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5405415468 --> @github-actions[bot] commented on GitHub (Aug 25, 2026): Confirmed — your reading of the code is correct. `extractOutboundEndpoints` handles VLESS only in the panel's flat wire shape, so a `vnext`-shaped VLESS outbound yields zero endpoints and the TCP probe short-circuits with `"No testable endpoint"`. It is still present on the default branch (v3.7.0). The deciding lines, `internal/web/service/outbound/outbound.go:251-260`: ```go case "vmess": if vnext, ok := settings["vnext"].([]any); ok { for _, v := range vnext { if vm, ok := v.(map[string]any); ok { addServer(vm["address"], vm["port"]) } } } case "vless": addServer(settings["address"], settings["port"]) ``` `addServer` only appends when `host != "" && p > 0` (`outbound.go:246`), so with `vnext` present and no top-level `address`, `out` stays empty and `testOutboundTCP` returns at `outbound.go:164-166`: ```go endpoints := extractOutboundEndpoints(ob) if len(endpoints) == 0 { return &TestOutboundResult{Tag: tag, Mode: "tcp", Success: false, Error: "No testable endpoint"}, nil } ``` This is the default path: the outbounds tab starts in TCP mode (`frontend/src/pages/xray/outbounds/OutboundsTab.tsx:125` — `useState<OutboundTestMode>('tcp')`). Only TCP mode is affected; `mode` values other than `"tcp"` route through a temporary Xray instance (`internal/web/service/outbound/probe_http.go:171`) and never call the extractor. **Two workarounds, both available today:** 1. Switch the test mode toggle in the Outbounds toolbar from **TCP** to **HTTP** — that probe builds a real Xray instance and does not need endpoint extraction. 2. Open the outbound in the panel's edit modal and save it once. The frontend adapter already reads `vnext` on load (`frontend/src/lib/xray/outbound-form-adapter.ts:122-131`) and writes the flat shape back out (`vlessToWire`, same file `:507-514`), so one save normalises the stored settings and the TCP test starts working. **One correction to the report's framing:** 3x-ui's canonical VLESS outbound shape is the flat one, not `vnext`, and that is deliberate rather than an oversight. All three link implementations and the docs agree: - `internal/util/link/outbound.go:282-288` emits `{"address","port","id","flow","encryption"}` when importing a `vless://` link; - `frontend/src/lib/xray/outbound-defaults.ts:60-68` seeds the flat shape for new VLESS outbounds; - `docs/lib/xray/outbounds.ts:3` — `// - VLESS uses the FLAT settings form {address,port,id,flow,encryption}.` - `TestSubJsonServiceVlessFlattened` (`internal/sub/json_service_test.go:139-150`) fails the build if a VLESS outbound in a JSON subscription carries `vnext`; - the user docs state it outright at `docs/content/docs/en/operations/outbounds-routing.mdx:42-43`. That does not make the report wrong — the panel's own form adapter accepts `vnext` for VLESS and converts it, so the backend refusing to read the very shape the frontend tolerates is a genuine inconsistency, and the Advanced JSON editor lets that shape reach the config untouched. Verdict: Confirmed bug Severity: Medium Confidence: High Root cause: `extractOutboundEndpoints` in `internal/web/service/outbound/outbound.go:259-260` reads VLESS endpoints only from `settings.address` / `settings.port`. Triggered whenever a VLESS outbound's stored settings use the `vnext[]` shape (hand-written config, Advanced JSON editor, or an imported third-party config) and the outbound is probed in TCP mode. Introduced by 8834e5fb "feat(xray/outbounds): TCP probe mode + Test All + timing breakdown" (2026-05-11), the commit that added the extractor. Already fixed: Still present on the default branch (f727d04f, v3.7.0). First shipped in v3.0.1 (`git tag --contains 8834e5fb`); no later commit touches the `case "vless":` arm — `git log -S 'case "vless":' -- internal/web/service/outbound/outbound.go` returns only the 41645255 file move. Duplicate of: None. #5860 ("Freedom ping test in the outbound section") is a different root cause — `freedom` is excluded deliberately at `outbound.go:159`. Evidence: `internal/web/service/outbound/outbound.go:259-260` `case "vless": addServer(settings["address"], settings["port"])`; `outbound.go:164-166` returns `"No testable endpoint"`; `outbound.go:246` `if host != "" && p > 0`; `probe_http.go:171` `if mode == "tcp" && !outboundTransportIsUDP(ob)`; `OutboundsTab.tsx:125` default `'tcp'`; `outbound-form-adapter.ts:122-131` (reads `vnext`) and `:507-514` (`vlessToWire` emits flat); `docs/lib/xray/outbounds.ts:3`; `internal/sub/json_service_test.go:139-150`. No test currently pins `extractOutboundEndpoints` — `grep -rn extractOutboundEndpoints` matches only `outbound.go`, so nothing defends the current behaviour. Not determined: Whether xray-core v26.6.27 still parses `vnext` for VLESS outbounds — the module source is outside this checkout, so I could not confirm your statement that traffic flows through the outbound normally. If it does not, the config is silently inert and the panel is right to find no endpoint; running `xray -test -config <generated config>` on the server would settle it in one command. Suggested fix: extend the `case "vless":` arm in `extractOutboundEndpoints` to read `settings.vnext[]` before falling back to the flat `address`/`port`, which is what the frontend adapter already does. The symmetric gap is worth the same one-line treatment while the file is open: the `vmess` arm reads only `vnext` and misses the flat shape (the shape the panel's own JSON subscriptions emit — `TestSubJsonServiceVmessFlattened`, `internal/sub/json_service_test.go:162-172`), and `trojan`/`shadowsocks`/`http`/`socks` read only `servers[]`. A table-driven test over `extractOutboundEndpoints` would pin all of them at once. There is also a matching frontend gap in the outbounds table itself: `outboundAddresses` reads VLESS flat-only at `frontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts:33-34`, so a `vnext`-shaped VLESS row renders its address column as a bare `:`. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4286
No description provided.