Describe the bug
When attempting to update an inbound connection via the /panel/api/inbounds/update endpoint, the API returns a 200 OK response with an empty body, which signals a successful operation. However, the actual changes are not written to the x-ui.db database.
For example, when programmatically changing the expiryTime for a client, this value remains unchanged in the database and the web interface.
Environment Information:
- Operating System:
Ubuntu 22.04.5 LTS
- Installation Method:
Docker
Important Notes:
- Updating the same client via the web panel's interface works correctly and saves the data.
- Creating new clients via the API (
/panel/api/inbounds/addClient) works correctly.
- The issue specifically occurs when trying to update an existing inbound connection via the API.
How to repeat the problem?
The issue can be reproduced using an external client (e.g., a Python script) that performs the following actions:
- Authentication: Successfully authenticates via
POST /login with valid credentials, receiving all necessary session cookies.
- Read: Performs a
GET /panel/api/inbounds/list to retrieve the current configuration of the desired inbound. The request is successful.
- Modification: Programmatically changes the
expiryTime value for one of the clients within the JSON string in the settings field.
- Data Filtering and Preparation: A payload for the update request is formed. To avoid errors with extra fields, only the fields that are part of the inbound configuration (such as
id, remark, port, settings, streamSettings, etc.) are included in the payload.
- Write: A
POST request is sent to /panel/api/inbounds/update with the prepared payload and all session cookies.
Expected action
The server should respond with 200 OK, and the new data (specifically, expiryTime) should be correctly saved to the database and reflected in the panel.
Received action
The server consistently responds to the request from step 5 with a 200 OK status and an empty response body. The external client's logs confirm a successful request/response cycle.
**Client Log Example:**INFO - UPDATE: Starting update for UUID 489f9b32-4b93-466c-af65-7916dcb3717d for 30 days.
INFO - API_REQUEST: Calling GET .../panel/api/inbounds/list
INFO - API_REQUEST: Response from .../panel/api/inbounds/list: Status 200
INFO - API_REQUEST: Calling POST .../panel/api/inbounds/update
INFO - API_REQUEST: Response from .../panel/api/inbounds/update: Status 200
Despite the 200 OK status, upon subsequent verification via the API or in the web interface, it is clear that the client's expiryTime value has not changed.
3x-ui Version
v2.6.0
Xray-core Version
25.5.16
Checklist
Describe the bug
When attempting to update an inbound connection via the
/panel/api/inbounds/updateendpoint, the API returns a200 OKresponse with an empty body, which signals a successful operation. However, the actual changes are not written to thex-ui.dbdatabase.For example, when programmatically changing the
expiryTimefor a client, this value remains unchanged in the database and the web interface.Environment Information:
Ubuntu 22.04.5 LTSDockerImportant Notes:
/panel/api/inbounds/addClient) works correctly.How to repeat the problem?
The issue can be reproduced using an external client (e.g., a Python script) that performs the following actions:
POST /loginwith valid credentials, receiving all necessary session cookies.GET /panel/api/inbounds/listto retrieve the current configuration of the desired inbound. The request is successful.expiryTimevalue for one of the clients within the JSON string in thesettingsfield.id,remark,port,settings,streamSettings, etc.) are included in the payload.POSTrequest is sent to/panel/api/inbounds/updatewith the prepared payload and all session cookies.Expected action
The server should respond with
200 OK, and the new data (specifically,expiryTime) should be correctly saved to the database and reflected in the panel.Received action
The server consistently responds to the request from step 5 with a
200 OKstatus and an empty response body. The external client's logs confirm a successful request/response cycle.**Client Log Example:**INFO - UPDATE: Starting update for UUID 489f9b32-4b93-466c-af65-7916dcb3717d for 30 days.
INFO - API_REQUEST: Calling GET .../panel/api/inbounds/list
INFO - API_REQUEST: Response from .../panel/api/inbounds/list: Status 200
INFO - API_REQUEST: Calling POST .../panel/api/inbounds/update
INFO - API_REQUEST: Response from .../panel/api/inbounds/update: Status 200
Despite the
200 OKstatus, upon subsequent verification via the API or in the web interface, it is clear that the client'sexpiryTimevalue has not changed.3x-ui Version
v2.6.0
Xray-core Version
25.5.16
Checklist