mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5783] [Bug]: XRAY: Failed to start: failed to decode config (cannot unmarshal string into Go / keepAlivePeriod of type int64 ) #4021
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#4021
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 @ecionis on GitHub (Jul 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5783
Describe the bug
XRAY: Failed to start after sub was updated
How to reproduce the problem
set "keepAlivePeriod": "10s" at streamSettings.finalmask.quicParams
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.2
Xray-core version
26.6.27
How did you install 3x-ui?
install.sh script
Operating system
Linux raspberrypi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
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 (Jul 4, 2026):
Confirmed from the log: xray-core requires
streamSettings.finalmask.quicParams.keepAlivePeriodto be a plain JSON number of seconds (int64), not a duration string. A value like"10s"will always fail to decode — that field does not accept a unit suffix (unlikebrutalUp/brutalDownin the samequicParamsblock, which genuinely are strings, e.g."100 mbps"). This is consistent withfrontend/src/schemas/protocols/stream/finalmask.ts:73(keepAlivePeriod: z.number().int().min(2).max(60)) and the panel's own "Keep Alive Period (s)" field inFinalMaskForm.tsx:1156-1158, which is a plain number spinner — editing it through that field cannot produce a string.So the string most likely entered the outbound config through one of two paths that currently skip type validation for
finalmask/quicParams:internal/util/link/outbound.go'sapplyFinalMask()takes thefm=query parameter off each parsed share link and JSON-decodes it straight intostreamSettings.finalmaskwith no type checking (internal/util/link/outbound.go:656-663). The refresh job then forces an Xray restart (internal/web/job/outbound_subscription_job.go), which matches "failed to start after sub was updated." The panel's own config merge (mergeSubscriptionOutboundsininternal/web/service/xray.go:596-625) treats outbounds as an opaque raw JSON blob, so nothing on the 3x-ui side re-validates field types — the only place that actually enforceskeepAlivePeriodmust be a number is xray-core itself at startup, which is the error you're seeing.OutboundFormModal.tsx). Both paths bypass the Zod schema that would normally catch this (applyFinalMaskParaminfrontend/src/lib/xray/outbound-link-parser.ts:215-226copiesfm=the same way, andform.validateFields()doesn't have a rule attached tokeepAlivePeriodto reject a stray string).To help pin down which path produced it:
subN-)?As an immediate workaround, open the affected outbound in the panel and re-enter
Keep Alive Periodas a plain number in the spinner (e.g.10), then save — this will rewrite the field as an integer. If it's coming from a subscription, the bad value will return on the next refresh until the upstream provider's link stops sending it as a string.This reply was generated automatically and a maintainer may follow up.
@ecionis commented on GitHub (Jul 4, 2026):
I am using Outbound Subscriptions (not manual import)