[GH-ISSUE #5302] [Question]: mistake subJsonPath: pages.settings.validation.pathLeadingSlash #3714

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

Originally created by @Flix790 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5302

What are you trying to do?

It does not allow you to save anything, an error always crashes

subJsonPath: pages.settings.validation.pathLeadingSlash

Image

What have you already tried?

No response

3x-ui version

3.3.1

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @Flix790 on GitHub (Jun 13, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5302 ### What are you trying to do? It does not allow you to save anything, an error always crashes subJsonPath: pages.settings.validation.pathLeadingSlash <img width="347" height="40" alt="Image" src="https://github.com/user-attachments/assets/43d69e56-bedb-4db4-ab46-f282a1e57b91" /> ### What have you already tried? _No response_ ### 3x-ui version 3.3.1 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:34:25 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 13, 2026):

This is a duplicate of #4946, which describes the same error and root cause.

The validation message subJsonPath: pages.settings.validation.pathLeadingSlash means the frontend Zod schema (frontend/src/schemas/setting.ts:5-6) is rejecting the JSON subscription path because it is empty or missing a leading slash. The backend returns an empty string when no value is stored, rather than the default /json/, so the field fails the /^\// regex check on every save attempt.

UI workaround (no SSH needed)

  1. Go to Settings → Subscription Formats.
  2. Click into the JSON Path field. Even without typing, the onBlur handler in SubscriptionFormatsTab.tsx calls normalizePath(), which converts an empty value to /json/ automatically.
  3. Click or tab out of the field, then save.

If the field still shows empty or a path without a leading slash, type a valid absolute path (e.g. /json/) manually before saving.

Command-line fix (if the UI workaround does not work)

sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value='/json/' WHERE key='subJsonPath' AND (value='' OR value IS NULL);"
systemctl restart x-ui

Further discussion and additional context are in #4946.

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

<!-- gh-comment-id:4700039586 --> @github-actions[bot] commented on GitHub (Jun 13, 2026): This is a duplicate of #4946, which describes the same error and root cause. The validation message `subJsonPath: pages.settings.validation.pathLeadingSlash` means the frontend Zod schema (`frontend/src/schemas/setting.ts:5-6`) is rejecting the JSON subscription path because it is empty or missing a leading slash. The backend returns an empty string when no value is stored, rather than the default `/json/`, so the field fails the `/^\//` regex check on every save attempt. **UI workaround (no SSH needed)** 1. Go to **Settings → Subscription Formats**. 2. Click into the **JSON Path** field. Even without typing, the `onBlur` handler in `SubscriptionFormatsTab.tsx` calls `normalizePath()`, which converts an empty value to `/json/` automatically. 3. Click or tab out of the field, then save. If the field still shows empty or a path without a leading slash, type a valid absolute path (e.g. `/json/`) manually before saving. **Command-line fix (if the UI workaround does not work)** ``` sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value='/json/' WHERE key='subJsonPath' AND (value='' OR value IS NULL);" systemctl restart x-ui ``` Further discussion and additional context are in #4946. *This reply was generated automatically; a maintainer may follow up.*
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#3714
No description provided.