[GH-ISSUE #5821] [Bug]: settings: subUpdates silently capped at 168h in 3.x — blocks all settings saves after upgrade from 2.x #4042

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

Originally created by @igrek59rd-coder on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5821

Describe the bug

After upgrading from 2.x to 3.x, saving any panel settings fails with subUpdates: Invalid input. There is no hint in the UI about what value is invalid or what the allowed range is.

Root cause

The maximum allowed value for subUpdates (Profile Update Interval) was silently lowered in 3.x — values above 168 hours are now rejected. Users who had a value higher than 168 in 2.x (e.g. 720) are stuck: their stored value is no longer valid, but there is no migration, no clamp, and no error message indicating the allowed range.

How to reproduce the problem

  1. Install any 2.x version and set subUpdates to a value above 168 (e.g. 720).
  2. Upgrade to 3.x.
  3. Open Panel Settings and try to save anything — even an unrelated setting on a different tab.
  4. The panel shows: subUpdates: Invalid input

Expected behavior

One or more of the following:

  • The UI field shows the allowed range (e.g. 1–168 hours) next to the input.
  • The error message includes the allowed range: e.g. subUpdates: must be between 1 and 168.
  • The upgrade migration automatically clamps values above 168 down to 168.

Actual behavior

Saving any settings is blocked with a generic subUpdates: Invalid input error. The user has no way to know which tab contains the offending field or what value is acceptable without trial and error.

Relevant logs


Screenshots

Image

3x-ui version

3.3.4

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?

Frontend (UI / panel pages)

Browser (only if it is a UI bug)

Chrome 150.0.7871.46

Is the panel behind a reverse proxy or CDN?

Yes — Nginx

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 @igrek59rd-coder on GitHub (Jul 5, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5821 ### Describe the bug After upgrading from 2.x to 3.x, saving any panel settings fails with `subUpdates: Invalid input`. There is no hint in the UI about what value is invalid or what the allowed range is. **Root cause** The maximum allowed value for `subUpdates` (Profile Update Interval) was silently lowered in 3.x — values above 168 hours are now rejected. Users who had a value higher than 168 in 2.x (e.g. 720) are stuck: their stored value is no longer valid, but there is no migration, no clamp, and no error message indicating the allowed range. ### How to reproduce the problem 1. Install any 2.x version and set `subUpdates` to a value above 168 (e.g. 720). 2. Upgrade to 3.x. 3. Open Panel Settings and try to save anything — even an unrelated setting on a different tab. 4. The panel shows: `subUpdates: Invalid input` ### Expected behavior One or more of the following: - The UI field shows the allowed range (e.g. `1–168 hours`) next to the input. - The error message includes the allowed range: e.g. `subUpdates: must be between 1 and 168`. - The upgrade migration automatically clamps values above 168 down to 168. ### Actual behavior Saving any settings is blocked with a generic `subUpdates: Invalid input` error. The user has no way to know which tab contains the offending field or what value is acceptable without trial and error. ### Relevant logs ```shell ``` ### Screenshots <img width="310" height="75" alt="Image" src="https://github.com/user-attachments/assets/9c7bc826-fc2e-4c34-8d9f-b321a28ab585" /> ### 3x-ui version 3.3.4 ### 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? Frontend (UI / panel pages) ### Browser (only if it is a UI bug) Chrome 150.0.7871.46 ### Is the panel behind a reverse proxy or CDN? Yes — Nginx ### 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:36:44 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jul 5, 2026):

Confirmed in the current source — this is a frontend-only regression, not an intentional new limit.

Root cause

frontend/src/pages/settings/SettingsPage.tsx:126 validates the entire settings object in one shot before saving anything:

const result = AllSettingSchema.safeParse(allSetting);
if (!result.success) {
  const issue = result.error.issues[0];
  ...
  messageApi.error(`${fieldPath}: ${t(msgKey, { defaultValue: msgKey })}`);
  return;
}

AllSettingSchema (frontend/src/schemas/setting.ts:56) declares:

subUpdates: z.number().int().min(1).max(168).optional(),

Since this check runs against the whole settings payload on every save, one stale out-of-range field (subUpdates) blocks saving any tab — exactly what you're seeing.

That 168 cap does not match the server side at all:

  • Backend struct validation, internal/web/entity/entity.go:88: validate:"gte=0,lte=525600".
  • The auto-generated Zod schema mirrored from that same Go struct, frontend/src/generated/zod.ts:92: z.number().int().min(0).max(525600).

So the backend (and the generated schema derived from it) already accepts values well above 168 — the 168 ceiling exists only in the hand-maintained frontend/src/schemas/setting.ts, out of sync with the backend limit. It isn't a documented "1 week max" design change, and the InputNumber in frontend/src/pages/settings/SubscriptionGeneralTab.tsx:82 only sets min={1} with no max and no range hint in the UI, so there is no way to discover the limit except by triggering the error.

I checked the latest release (v3.4.2) and the current dev-latest build; the code is unchanged there, so this is not yet fixed in any released version.

Workaround until this is addressed

Since the UI itself cannot save while this value is out of range, you will need to clamp it directly in the database:

systemctl stop x-ui
cp /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak
sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value='168' WHERE key='subUpdates';"
systemctl start x-ui

(Adjust the path if you set a custom XUI_DB_FOLDER.) After that, the Panel Settings page should load and save normally again; you can then decide whether 168 hours is acceptable or wait for the frontend cap to be corrected to match the backend's actual limit.

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

<!-- gh-comment-id:4887002324 --> @github-actions[bot] commented on GitHub (Jul 5, 2026): Confirmed in the current source — this is a frontend-only regression, not an intentional new limit. **Root cause** `frontend/src/pages/settings/SettingsPage.tsx:126` validates the *entire* settings object in one shot before saving anything: ```ts const result = AllSettingSchema.safeParse(allSetting); if (!result.success) { const issue = result.error.issues[0]; ... messageApi.error(`${fieldPath}: ${t(msgKey, { defaultValue: msgKey })}`); return; } ``` `AllSettingSchema` (`frontend/src/schemas/setting.ts:56`) declares: ```ts subUpdates: z.number().int().min(1).max(168).optional(), ``` Since this check runs against the whole settings payload on every save, one stale out-of-range field (`subUpdates`) blocks saving *any* tab — exactly what you're seeing. That `168` cap does not match the server side at all: - Backend struct validation, `internal/web/entity/entity.go:88`: `validate:"gte=0,lte=525600"`. - The auto-generated Zod schema mirrored from that same Go struct, `frontend/src/generated/zod.ts:92`: `z.number().int().min(0).max(525600)`. So the backend (and the generated schema derived from it) already accepts values well above 168 — the `168` ceiling exists only in the hand-maintained `frontend/src/schemas/setting.ts`, out of sync with the backend limit. It isn't a documented "1 week max" design change, and the `InputNumber` in `frontend/src/pages/settings/SubscriptionGeneralTab.tsx:82` only sets `min={1}` with no `max` and no range hint in the UI, so there is no way to discover the limit except by triggering the error. I checked the latest release (v3.4.2) and the current `dev-latest` build; the code is unchanged there, so this is not yet fixed in any released version. **Workaround until this is addressed** Since the UI itself cannot save while this value is out of range, you will need to clamp it directly in the database: ```bash systemctl stop x-ui cp /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value='168' WHERE key='subUpdates';" systemctl start x-ui ``` (Adjust the path if you set a custom `XUI_DB_FOLDER`.) After that, the Panel Settings page should load and save normally again; you can then decide whether 168 hours is acceptable or wait for the frontend cap to be corrected to match the backend's actual limit. *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#4042
No description provided.