[GH-ISSUE #4651] [Bug]: Adding a client on master panel resets inbound TLS cert paths → Xray fails to start (exit status 23) every time #3202

Closed
opened 2026-10-31 20:30:46 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @x4mznbxmhm-eng on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4651

Describe the bug

In a multi-node setup, every time a new client is added to an inbound via the master panel UI, the inbound’s TLS certificateFile and keyFile paths are silently cleared from stream_settings in the database. Xray then fails to start with exit status 23 and loops indefinitely until the cert paths are manually re-injected via SQLite.

Error log (repeating loop):
ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json]
> infra/conf: failed to build inbound config with tag inbound-443->
ERROR - Failure in running xray-core: exit status 23
Additionally, a deprecation warning appears alongside the crash:
WARNING - XRAY: common/errors: The feature HTTPUpgrade transport
(with ALPN http/1.1, etc.) is deprecated, not recommended for using
and might be removed in the future.
Workaround required after every new client add:
sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set(
stream_settings,
'$.tlsSettings.certificates[0].certificateFile', '/root/cert//fullchain.pem',
'$.tlsSettings.certificates[0].keyFile', '/root/cert//privkey.pem'
) WHERE id=1;"

x-ui restart
Without this manual step, Xray stays in a crash loop and all clients lose connectivity.

How to reproduce the problem

1.	Configure an inbound (e.g. id=1, port 443) with TLS using certificate file paths (certificateFile / keyFile) — not inline pasted cert content.
2. Confirm Xray starts successfully.
3. From the master panel UI, add a new client to that inbound and save.
4. Observe Xray status turns red / crash loop begins.
5. Inspect the DB — certificateFile and keyFile are missing or empty in stream_settings.
6. 	Re-apply paths via the SQL workaround above → Xray recovers.

Expected behavior

Adding or editing a client should never modify the parent inbound’s stream_settings, including TLS certificate configuration. The cert paths should be preserved across all client CRUD operations.

Actual behavior

No response

Relevant logs

The OS release is: ubuntu
● x-ui.service - x-ui Service
     Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-05-29 16:14:15 +0630; 12min ago
   Main PID: 10930 (x-ui)
      Tasks: 10 (limit: 9483)
     Memory: 40.9M (peak: 54.3M)
        CPU: 4.328s
     CGroup: /system.slice/x-ui.service
             └─10930 /usr/local/x-ui/x-ui

May 29 16:26:44 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
root@srv1713837:~# sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set(stream_settings, '$.tlsSettings.certificates[0].certificateFile', '/root/cert/xxx.xxx.online/fullchain.pem', '$.tlsSettings.certificates[0].keyFile', '/root/cert/xxx.xxx.online/privkey.pem') WHERE id=1;"
root@srv1713837:~# x-ui restart-xray
The OS release is: ubuntu
[INF] xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully 
	xray state: Not Running
root@srv1713837:~# x-ui status
The OS release is: ubuntu
● x-ui.service - x-ui Service
     Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-05-29 16:14:15 +0630; 13min ago
    Process: 11951 ExecReload=kill -USR1 $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 10930 (x-ui)
      Tasks: 10 (limit: 9483)
     Memory: 44.0M (peak: 54.3M)
        CPU: 6.049s
     CGroup: /system.slice/x-ui.service
             └─10930 /usr/local/x-ui/x-ui

May 29 16:28:06 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:28:06 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo>
May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo>
May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443->
May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23
root@srv1713837:~# x-ui stop
The OS release is: ubuntu
[INF] x-ui and xray stopped successfully 
root@srv1713837:~# VERSION=v3.0.2 && bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/$VERSION/install.sh") $VERSION

root@srv1713837:~# sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set(stream_settings, '$.tlsSettings.certificates[0].certificateFile', '/root/cert/xxx.xxx.online/fullchain.pem', '$.tlsSettings.certificates[0].keyFile', '/root/cert/xxx.xxx.online/privkey.pem') WHERE id=1;"
root@srv1713837:~# x-ui restart-xray
The OS release is: ubuntu
[INF] xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully 
xray state: Running
root@srv1713837:~# x-ui status
The OS release is: ubuntu
● x-ui.service - x-ui Service
     Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-05-29 16:34:25 +0630; 3min 16s ago
    Process: 16046 ExecReload=kill -USR1 $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 14821 (x-ui)
      Tasks: 17 (limit: 9483)
     Memory: 77.5M (peak: 111.0M)
        CPU: 5.174s
     CGroup: /system.slice/x-ui.service
             ├─14821 /usr/local/x-ui/x-ui
             └─16049 bin/xray-linux-amd64 -c bin/config.json

May 29 16:37:33 srv1713837 /usr/local/x-ui/x-ui[14821]: ERROR - Failure in running xray-core: exit status 23
May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo>
May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: core: Xray 26.5.9 started
May 29 16:37:38 srv1713837 systemd[1]: Reloading x-ui.service - x-ui Service...
May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - Received USR1 signal, restarting xray-core...
May 29 16:37:38 srv1713837 systemd[1]: Reloaded x-ui.service - x-ui Service.
May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json}
May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo>
May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: core: Xray 26.5.9 started

Screenshots

No response

3x-ui version

3.2.0

Xray-core version

26.5.9

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Multi-node (sub-nodes)

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

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 @x4mznbxmhm-eng on GitHub (May 29, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4651 ### Describe the bug In a multi-node setup, every time a new client is added to an inbound via the master panel UI, the inbound’s TLS certificateFile and keyFile paths are silently cleared from stream_settings in the database. Xray then fails to start with exit status 23 and loops indefinitely until the cert paths are manually re-injected via SQLite. Error log (repeating loop): ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> ERROR - Failure in running xray-core: exit status 23 Additionally, a deprecation warning appears alongside the crash: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be removed in the future. Workaround required after every new client add: sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set( stream_settings, '$.tlsSettings.certificates[0].certificateFile', '/root/cert/<domain>/fullchain.pem', '$.tlsSettings.certificates[0].keyFile', '/root/cert/<domain>/privkey.pem' ) WHERE id=1;" x-ui restart Without this manual step, Xray stays in a crash loop and all clients lose connectivity. ### How to reproduce the problem 1. Configure an inbound (e.g. id=1, port 443) with TLS using certificate file paths (certificateFile / keyFile) — not inline pasted cert content. 2. Confirm Xray starts successfully. 3. From the master panel UI, add a new client to that inbound and save. 4. Observe Xray status turns red / crash loop begins. 5. Inspect the DB — certificateFile and keyFile are missing or empty in stream_settings. 6. Re-apply paths via the SQL workaround above → Xray recovers. ### Expected behavior Adding or editing a client should never modify the parent inbound’s stream_settings, including TLS certificate configuration. The cert paths should be preserved across all client CRUD operations. ### Actual behavior _No response_ ### Relevant logs ```shell The OS release is: ubuntu ● x-ui.service - x-ui Service Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled) Active: active (running) since Fri 2026-05-29 16:14:15 +0630; 12min ago Main PID: 10930 (x-ui) Tasks: 10 (limit: 9483) Memory: 40.9M (peak: 54.3M) CPU: 4.328s CGroup: /system.slice/x-ui.service └─10930 /usr/local/x-ui/x-ui May 29 16:26:44 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:26:46 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:26:48 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:26:50 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 root@srv1713837:~# sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set(stream_settings, '$.tlsSettings.certificates[0].certificateFile', '/root/cert/xxx.xxx.online/fullchain.pem', '$.tlsSettings.certificates[0].keyFile', '/root/cert/xxx.xxx.online/privkey.pem') WHERE id=1;" root@srv1713837:~# x-ui restart-xray The OS release is: ubuntu [INF] xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully xray state: Not Running root@srv1713837:~# x-ui status The OS release is: ubuntu ● x-ui.service - x-ui Service Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled) Active: active (running) since Fri 2026-05-29 16:14:15 +0630; 13min ago Process: 11951 ExecReload=kill -USR1 $MAINPID (code=exited, status=0/SUCCESS) Main PID: 10930 (x-ui) Tasks: 10 (limit: 9483) Memory: 44.0M (peak: 54.3M) CPU: 6.049s CGroup: /system.slice/x-ui.service └─10930 /usr/local/x-ui/x-ui May 29 16:28:06 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:28:06 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo> May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:28:08 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo> May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - XRAY: Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build inbound config with tag inbound-443-> May 29 16:28:10 srv1713837 /usr/local/x-ui/x-ui[10930]: ERROR - Failure in running xray-core: exit status 23 root@srv1713837:~# x-ui stop The OS release is: ubuntu [INF] x-ui and xray stopped successfully root@srv1713837:~# VERSION=v3.0.2 && bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/$VERSION/install.sh") $VERSION root@srv1713837:~# sqlite3 /etc/x-ui/x-ui.db "UPDATE inbounds SET stream_settings = json_set(stream_settings, '$.tlsSettings.certificates[0].certificateFile', '/root/cert/xxx.xxx.online/fullchain.pem', '$.tlsSettings.certificates[0].keyFile', '/root/cert/xxx.xxx.online/privkey.pem') WHERE id=1;" root@srv1713837:~# x-ui restart-xray The OS release is: ubuntu [INF] xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully xray state: Running root@srv1713837:~# x-ui status The OS release is: ubuntu ● x-ui.service - x-ui Service Loaded: loaded (/etc/systemd/system/x-ui.service; enabled; preset: enabled) Active: active (running) since Fri 2026-05-29 16:34:25 +0630; 3min 16s ago Process: 16046 ExecReload=kill -USR1 $MAINPID (code=exited, status=0/SUCCESS) Main PID: 14821 (x-ui) Tasks: 17 (limit: 9483) Memory: 77.5M (peak: 111.0M) CPU: 5.174s CGroup: /system.slice/x-ui.service ├─14821 /usr/local/x-ui/x-ui └─16049 bin/xray-linux-amd64 -c bin/config.json May 29 16:37:33 srv1713837 /usr/local/x-ui/x-ui[14821]: ERROR - Failure in running xray-core: exit status 23 May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo> May 29 16:37:35 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: core: Xray 26.5.9 started May 29 16:37:38 srv1713837 systemd[1]: Reloading x-ui.service - x-ui Service... May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - Received USR1 signal, restarting xray-core... May 29 16:37:38 srv1713837 systemd[1]: Reloaded x-ui.service - x-ui Service. May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: INFO - XRAY: infra/conf/serial: Reading config: &{Name:bin/config.json Format:json} May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: common/errors: The feature HTTPUpgrade transport (with ALPN http/1.1, etc.) is deprecated, not recommended for using and might be remo> May 29 16:37:38 srv1713837 /usr/local/x-ui/x-ui[14821]: WARNING - XRAY: core: Xray 26.5.9 started ``` ### Screenshots _No response_ ### 3x-ui version 3.2.0 ### Xray-core version 26.5.9 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Multi-node (sub-nodes) ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### 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:30:46 +07:00
  • closed this issue
  • added the
    bug
    label
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#3202
No description provided.