Skip to content

[BUG] addClient API returns empty response (v2.6.0) #3052

Description

@keeldj

Describe the bug

Hello,

I'm experiencing an issue with the addClient API endpoint in 3x-ui v2.6.0.

Problem:
When attempting to add a client to an inbound via the /panel/inbound/addClient API endpoint, the server returns an empty string ("") as a response, instead of a JSON object (either success or error JSON).

Expected behavior:
The API should return a valid JSON response, indicating either successful client addition or an error message in JSON format.

How to repeat the problem?

Steps to reproduce:

  1. Access the 3x-ui panel via API (e.g., login).
  2. Send a POST request to /panel/inbound/addClient with a valid session token and a client configuration in the request body (as shown in "Request Body" below).
  3. Observe the response.

My setup:

  • 3x-ui Version: v2.6.0 (latest stable release from GitHub releases page)
  • Xray-core Version: 25.5.16 (from XUI logs)
  • Operating System: [Ubuntu 22.04 LTS]
  • Installation Method: bash <(curl -Ls https://raw.githubusercontent.com/MHSanaei/3x-ui/main/install.sh) (which currently installs v2.6.0)

Request Method: POST
Request URL Example: http://193.23.210.34:7030/IafRxicsn9yqpDN/panel/inbound/addClient
Request Headers:

  • Cookie: _xui_session=<session_token_obtained_from_login>
  • Content-Type: application/json

Request Body (example from bot logs):

{
   "id": "inbound-53459",
   "settings": {
      "clients": [
         {
            "id": "6309b9e8-cfc9-42f8-9957-c214704bdd1d",
            "flow": "",
            "email": "user_301404806_3_month",
            "limitIp": 0,
            "totalGB": 0,
            "expiryTime": 0,
            "enable": true,
            "tgId": "",
            "subId": "hbwj7dcw19gh66dkobpm",
            "comment": "",
            "reset": 0
         }
      ]
   }
}



Observed Response:

An empty string ("") is returned.
HTTP Status Code: Unknown, as no JSON response is provided, and no specific HTTP status code is logged by the bot.
Important: No errors related to this API call are logged in the 3x-ui journalctl -u x-ui logs when this happens.
Additional Information:

Logging into the 3x-ui panel via API (/login) works successfully and returns a valid session token.
Manually adding clients via the 3x-ui web interface works without any issues.
Disk space and inode usage on the server are healthy.
I noticed a potentially related issue: https://github.com/MHSanaei/3x-ui/issues/2888, where another user reported issues with addClient API from a bot, although with a different error message (Received HTTP/0.9 when not allowed). This suggests a broader problem with addClient API interactions.
This issue prevents automated client management via API. Any guidance or fix would be greatly appreciated.

Thank you.

### Expected action

The `addClient` API should return a JSON response (either success or an error message in JSON format) after successfully adding a client or encountering an issue.

### Received action

The `addClient` API returns an empty string ("") as a response. No JSON is returned.

### 3x-ui Version

v2.6.0

### Xray-core Version

25.5.16

### Checklist

- [x] This bug report is written entirely in English.
- [x] This bug report is new and no one has reported it before me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions