[GH-ISSUE #4830] [Bug]: Inbounds page does not load after update #3361

Closed
opened 2026-10-31 20:31:55 +07:00 by bsakaguchi · 2 comments
Owner

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

Describe the bug

An error occurred while retrieving parameters. (strconv.Atoi: parsing "": invalid syntax)

Image

How to reproduce the problem

  1. Use the following database: [xxxxx

  2. In the panel, select Inbounds from the sidebar.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.5

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Backend (API endpoints, login, settings)

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

Yes — Caddy

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 @maa3x on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4830 ### Describe the bug > An error occurred while retrieving parameters. (`strconv.Atoi`: parsing \"\": invalid syntax) <img width="615" height="214" alt="Image" src="https://github.com/user-attachments/assets/a1008898-7a1e-4fae-a2df-44b8f3e862b8" /> ### How to reproduce the problem 1. Use the following database: [xxxxx 2. In the panel, select `Inbounds` from the sidebar. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.5 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Backend (API endpoints, login, settings) ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? Yes — Caddy ### 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:31:55 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report and the database file — that makes this much easier to diagnose.

Root cause

When the Inbounds page loads it calls the /defaultSettings endpoint, which reads several integer settings from the database (pageSize, expireDiff, trafficDiff, etc.). The setting service falls back to its built-in defaults only when a key is absent from the database; if the row exists but its value column is an empty string "", strconv.Atoi("") is called directly, producing the error you see:

strconv.Atoi: parsing "": invalid syntax

Your migrated database likely contains one or more setting rows with an empty value for a key that is now expected to be an integer.

Workaround

You can fix the affected rows directly with the SQLite CLI (stop the panel first):

x-ui stop
sqlite3 /etc/x-ui/x-ui.db <<'SQL'
UPDATE settings SET value = '0'  WHERE key IN ('expireDiff','trafficDiff') AND (value = '' OR value IS NULL);
UPDATE settings SET value = '25' WHERE key = 'pageSize'                    AND (value = '' OR value IS NULL);
UPDATE settings SET value = '0'  WHERE key IN ('tgCpu','webPort','subPort','sessionMaxAge') AND (value = '' OR value IS NULL);
SQL
x-ui start

Adjust the path to x-ui.db if you used a custom install location. After the update the Inbounds page should load normally.

Underlying issue

The getInt helper should treat an empty stored value the same as a missing row and fall back to the default — it currently does not. This is a code-level fix that should prevent the crash for any setting whose value ends up empty in the database.

<!-- gh-comment-id:4606483153 --> @github-actions[bot] commented on GitHub (Jun 2, 2026): Thanks for the detailed report and the database file — that makes this much easier to diagnose. **Root cause** When the Inbounds page loads it calls the `/defaultSettings` endpoint, which reads several integer settings from the database (`pageSize`, `expireDiff`, `trafficDiff`, etc.). The setting service falls back to its built-in defaults only when a key is **absent** from the database; if the row exists but its `value` column is an empty string `""`, `strconv.Atoi("")` is called directly, producing the error you see: ``` strconv.Atoi: parsing "": invalid syntax ``` Your migrated database likely contains one or more setting rows with an empty value for a key that is now expected to be an integer. **Workaround** You can fix the affected rows directly with the SQLite CLI (stop the panel first): ```bash x-ui stop sqlite3 /etc/x-ui/x-ui.db <<'SQL' UPDATE settings SET value = '0' WHERE key IN ('expireDiff','trafficDiff') AND (value = '' OR value IS NULL); UPDATE settings SET value = '25' WHERE key = 'pageSize' AND (value = '' OR value IS NULL); UPDATE settings SET value = '0' WHERE key IN ('tgCpu','webPort','subPort','sessionMaxAge') AND (value = '' OR value IS NULL); SQL x-ui start ``` Adjust the path to `x-ui.db` if you used a custom install location. After the update the Inbounds page should load normally. **Underlying issue** The `getInt` helper should treat an empty stored value the same as a missing row and fall back to the default — it currently does not. This is a code-level fix that should prevent the crash for any setting whose value ends up empty in the database.
Author
Owner

@MHSanaei commented on GitHub (Jun 2, 2026):

Fixed.

Root cause: Your database had a pageSize setting row whose value column was NULL (a few other rows too). The panel reads such a row as an empty string and parsed it directly, so strconv.Atoi("") failed with parsing "": invalid syntax. The Inbounds page triggers this via /defaultSettings → GetPageSize, which is why the page didn't load. The Settings page had the same exposure.

Fix: The setting service now treats an empty/NULL value the same as a missing row and falls back to the built-in default at the integer/bool parse sites (getInt, getBool, and the settings reflection path). String settings that are legitimately empty (e.g. Sub Domain) are left untouched.

Verified end-to-end using the database you shared: after the fix, /panel/setting/defaultSettings and /panel/setting/all both load and pageSize resolves to the default 25 — no DB editing needed, the panel self-heals any empty/NULL setting value.

Thanks for attaching the database — it made the root cause unambiguous. Will ship in the next release.

<!-- gh-comment-id:4606733858 --> @MHSanaei commented on GitHub (Jun 2, 2026): Fixed. **Root cause:** Your database had a `pageSize` setting row whose `value` column was **NULL** (a few other rows too). The panel reads such a row as an empty string and parsed it directly, so `strconv.Atoi("")` failed with `parsing "": invalid syntax`. The Inbounds page triggers this via `/defaultSettings` → `GetPageSize`, which is why the page didn't load. The Settings page had the same exposure. **Fix:** The setting service now treats an empty/NULL value the same as a missing row and falls back to the built-in default at the integer/bool parse sites (`getInt`, `getBool`, and the settings reflection path). String settings that are legitimately empty (e.g. Sub Domain) are left untouched. Verified end-to-end using the database you shared: after the fix, `/panel/setting/defaultSettings` and `/panel/setting/all` both load and `pageSize` resolves to the default `25` — no DB editing needed, the panel self-heals any empty/NULL setting value. Thanks for attaching the database — it made the root cause unambiguous. Will ship in the next release.
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#3361
No description provided.