mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5565] [Bug]: Failed to connect using fragments #3885
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3885
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andyplop9 on GitHub (Jun 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5565
Describe the bug
config error: infra/conf/serial: failed to parse json config > infra/conf: failed to build outbound config with tag proxy > infra/conf: failed to build stream settings for outbound detour > infra/conf: failed to build mask with type fragment > infra/conf: LengthMin cant be 0
How to reproduce the problem
Use xhttp+vless+tls with tcp fragments
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.0
Xray-core version
26.6.1
How did you install 3x-ui?
Docker / Docker Compose
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
@github-actions[bot] commented on GitHub (Jun 25, 2026):
The error originates from xray-core's fragment mask validator on the client side: the outbound tagged `proxy` in the subscription JSON config (generated by the panel — source confirmed in `internal/sub/json_service.go:387`) has a fragment mask whose `LengthMin` is 0 or absent. xray-core rejects any fragment mask where `LengthMin` is not a positive integer; this is also documented in the panel's own frontend validator at `frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx:382`.
Why this happens in 3.4.0
v3.4.0 introduced per-segment `lengths`/`delays` arrays for fragment masks (following xray-core #6334, commit `
852b53db`), replacing the single `length` string field. A migration runs automatically when you open the inbound edit form — but only in the browser. If the inbound was previously saved with `length: ""` (empty) or with any value whose minimum parses to 0, the migration removes the old `length` key but produces no `lengths` array, leaving the stored fragment settings with no length field at all. The subscription JSON generator (`internal/sub/json_service.go`) passes the stored `finalmask` through to the client config without re-validating it, so the client receives a fragment mask that xray-core cannot build.Immediate fix
If you have a global subscription finalmask configured (panel Settings → Subscription → Sub JSON Finalmask), check it for the same issue.
Information needed to confirm the root cause
This reply was generated automatically; a maintainer may follow up.
@andyplop9 commented on GitHub (Jun 25, 2026):
I use this setting btw
"streamSettings": {
"finalmask": {
"tcp": [
{
"settings": {
"delays": [
"1"
],
"lengths": [
"1"
],
"maxSplit": "1500",
"packets": "1-1"
},
"type": "fragment"
}
]
@andyplop9 commented on GitHub (Jun 25, 2026):
When exporting a client config through the subscription system with finalmask + fragment enabled, 3X-UI generates incorrect field names and types for the fragment settings. This bug did not exist in previous versions of 3X-UI — the exported config used to be valid and loaded correctly in Xray clients.
Xray-core Source Proof
According to the official Xray-core source at:
https://github.com/XTLS/Xray-core/blob/main/infra/conf/transport_internet.go
The FragmentMask struct is defined as:
type FragmentMask struct { Packets stringjson:"packets"Length Int32Rangejson:"length"Delay Int32Rangejson:"delay"MaxSplit Int32Rangejson:"maxSplit"}Fields are singular strings with range values — not arrays.
What 3X-UI Currently Generates (Broken):
"settings": { "delays": ["1"], "lengths": ["1"], "maxSplit": "1500", "packets": "1-1" }