mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4946] [Bug]: subJsonPath: pages.settings.validation.pathLeadingSlash #3466
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#3466
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 @AndreyKaller on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4946
Describe the bug
When trying to make changes to the subscription information page, I get this error. All paths are correct, including the "/" in the path. Reinstalling the panel doesn't help, nor does completely reinstalling Ubuntu. I'm running version 3.2.7. Other servers are running version 3.2.6, and this error doesn't occur.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
3x-ui version
3.2.7
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
24.4
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 5, 2026):
Thanks for the detailed report. I traced the root cause in the source code.
What is happening
The error
subJsonPath: pages.settings.validation.pathLeadingSlashmeans the frontend's Zod schema (frontend/src/schemas/setting.ts:46) is rejecting the value ofsubJsonPathbecause it is an empty string (""), which does not match the required leading-slash regex (/^\//).There are two underlying problems:
1. Backend: empty string is returned as-is for string settings
In
web/service/setting.go,GetAllSetting()applieseffectiveSettingValue()(which falls back to the built-in default when the stored value is"") forintandboolfields — but not forstringfields (line 175–176). So ifsubJsonPathis stored as""in your database, the API returns""to the frontend instead of the default"/json/".The commit that fixed the empty-value crash for int/bool (fcc6787a) explicitly left string fields unchanged ("string getters are unchanged, so legitimately-empty string settings stay empty"), which creates this mismatch with the frontend schema.
2. Frontend: missing translation key causes raw key to be shown
pages.settings.validation.pathLeadingSlashdoes not exist in any translation file underweb/translation/, so the error toast shows the raw i18n key instead of a readable message like "Path must start with /".Immediate fix (server command)
Run the following on your server to restore the default path:
If you also have empty
subPathorsubClashPath, fix those too:UI-only workaround (no SSH needed)
onBlurhandler inSubscriptionFormatsTab.tsx:159callsnormalizePath(), which converts any empty value to/json/. Even just clicking in and then clicking out of the field is enough.The fix should apply
effectiveSettingValueto string path fields on the backend, or handle empty-string path values gracefully in the frontend schema (e.g.z.string().min(1).regex(...)or coerce""to the default before validation). The missing translation key should also be added toen-US.json(and other locales).@AndreyKaller commented on GitHub (Jun 5, 2026):
При попытке включить JSON нажимая на кнопку Save вылетает такая же ошибка. Он не дает сохранить изменения.
И не активирует кнопку перезапуска панели,внести изменения невозможно.
@MHSanaei commented on GitHub (Jun 5, 2026):
check your JSON URI Path
@petryaevve commented on GitHub (Jul 6, 2026):
In new versions there is no JSON URI Path setting in Subscription menu