[GH-ISSUE #3231] "Inbound traffic always zero + client quota not working" #2186

Closed
opened 2026-10-31 20:23:48 +07:00 by bsakaguchi · 11 comments
Owner

Originally created by @sadramv on GitHub (Jul 13, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3231

Describe the bug

Hello,
Thank you for your work on this panel. I'm facing a few issues:

  1. In the Inbound section, both incoming and outgoing traffic always show zero, even though actual traffic is being used. However, in the Overview section, the usage data is displayed correctly.

  2. The traffic and time limits set for clients are not being enforced. Clients continue using the service even after their quota or time limit is supposed to expire.

  3. Additionally, the individual traffic usage per client is not being calculated properly — it stays at zero.

I appreciate your help in fixing these bugs. Let me know if you need logs or more details.

Thanks again!

How to repeat the problem?

  1. Install and run the latest version of 3x-ui.

  2. Create a new inbound (e.g. VMess or VLESS).

  3. Add a client and set both traffic limit (e.g. 1GB) and expiry time (e.g. 1 day).

  4. Connect using the client and start generating traffic (e.g. download a file or stream video).

  5. Check the Inbound section — incoming and outgoing traffic stay at 0 B.

  6. Check the Overview section — traffic usage is displayed correctly there.

  7. Wait until the client hits the time or traffic limit — it still works and doesn't get disabled.

  8. Check the client traffic usage — it's still showing 0 B even after usage.

Expected action

No response

Received action

No response

3x-ui Version

2.6.2

Xray-core Version

25.6.8

Checklist

  • This bug report is written entirely in English.
  • This bug report is new and no one has reported it before me.
Originally created by @sadramv on GitHub (Jul 13, 2025). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3231 ### Describe the bug Hello, Thank you for your work on this panel. I'm facing a few issues: 1. In the Inbound section, both incoming and outgoing traffic always show zero, even though actual traffic is being used. However, in the Overview section, the usage data is displayed correctly. 2. The traffic and time limits set for clients are not being enforced. Clients continue using the service even after their quota or time limit is supposed to expire. 3. Additionally, the individual traffic usage per client is not being calculated properly — it stays at zero. I appreciate your help in fixing these bugs. Let me know if you need logs or more details. Thanks again! ### How to repeat the problem? 1. Install and run the latest version of 3x-ui. 2. Create a new inbound (e.g. VMess or VLESS). 3. Add a client and set both traffic limit (e.g. 1GB) and expiry time (e.g. 1 day). 4. Connect using the client and start generating traffic (e.g. download a file or stream video). 5. Check the Inbound section — incoming and outgoing traffic stay at 0 B. 6. Check the Overview section — traffic usage is displayed correctly there. 7. Wait until the client hits the time or traffic limit — it still works and doesn't get disabled. 8. Check the client traffic usage — it's still showing 0 B even after usage. ### Expected action _No response_ ### Received action _No response_ ### 3x-ui Version 2.6.2 ### Xray-core Version 25.6.8 ### Checklist - [x] This bug report is written entirely in English. - [x] This bug report is new and no one has reported it before me.
bsakaguchi 2026-10-31 20:23:48 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@xinhai-ai commented on GitHub (Jul 14, 2025):

You can manually change the policy value in xray configs -> advanced, so that traffic can be counted properly.

"policy": {
    "levels": {
      "0": {
        "statsUserUplink": true,
        "statsUserDownlink": true,
        "statsUserOnline": true
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true,
      "statsOutboundUplink": true,
      "statsOutboundDownlink": true
    }
  }
<!-- gh-comment-id:3067729604 --> @xinhai-ai commented on GitHub (Jul 14, 2025): You can manually change the policy value in xray configs -> advanced, so that traffic can be counted properly. ``` "policy": { "levels": { "0": { "statsUserUplink": true, "statsUserDownlink": true, "statsUserOnline": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true, "statsOutboundUplink": true, "statsOutboundDownlink": true } } ```
Author
Owner

@sadramv commented on GitHub (Jul 14, 2025):

Thanks for your response.
I already applied the changes you suggested to the policy section in the xray config under "advanced", but unfortunately, it didn’t work. The traffic is still not being counted properly.
Do you have any other suggestions?

Image

<!-- gh-comment-id:3067745146 --> @sadramv commented on GitHub (Jul 14, 2025): Thanks for your response. I already applied the changes you suggested to the policy section in the xray config under "advanced", but unfortunately, it didn’t work. The traffic is still not being counted properly. Do you have any other suggestions? ![Image](https://github.com/user-attachments/assets/20f30527-18e3-4dff-8798-91474ea9dabd)
Author
Owner

@xinhai-ai commented on GitHub (Jul 14, 2025):

Sorry, I don't know what to do either. I encountered the same issue you described. After I reviewed the xray-core documentation and added this section, the problem was resolved. Could you please share your config.json (make sure to hide any Confidential Information)?

<!-- gh-comment-id:3067756836 --> @xinhai-ai commented on GitHub (Jul 14, 2025): Sorry, I don't know what to do either. I encountered the same issue you described. After I reviewed the xray-core documentation and added this section, the problem was resolved. Could you please share your config.json (make sure to hide any Confidential Information)?
Author
Owner

@sadramv commented on GitHub (Jul 14, 2025):

Here’s my current config.json (with all sensitive information removed):

{
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "burstObservatory": null,
  "dns": null,
  "fakedns": null,
  "inbounds": [
    {
      "allocate": null,
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "sniffing": null,
      "streamSettings": null,
      "tag": "api"
    },
    {
      "allocate": {
        "concurrency": 3,
        "refresh": 5,
        "strategy": "always"
      },
      "port": 11246,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "email": "<EMAIL_1>",
            "flow": "",
            "id": "<UUID_1>",
            "level": 0
          }
        ],
        "decryption": "none",
        "fallbacks": []
      },
      "sniffing": {
        "destOverride": ["http", "tls", "quic", "fakedns"],
        "enabled": false
      },
      "streamSettings": {
        "network": "xhttp",
        "realitySettings": {
          "dest": "Rasekhoon.net:443",
          "privateKey": "<PRIVATE_KEY_1>",
          "serverNames": ["yahoo.com", "www.yahoo.com"],
          "shortIds": ["..."],
          "xver": 0
        },
        "security": "reality",
        "xhttpSettings": {
          "mode": "auto",
          "path": "/syndyjdykrymrumrukrukrukrukru",
          "scMaxBufferedPosts": 30,
          "scMaxEachPostBytes": "1000000",
          "scStreamUpServerSecs": "20-80",
          "xPaddingBytes": "100-1000"
        }
      },
      "tag": "inbound-11246"
    },
    {
      "allocate": {
        "concurrency": 3,
        "refresh": 5,
        "strategy": "always"
      },
      "port": 2060,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "email": "<EMAIL_2>",
            "flow": "",
            "id": "<UUID_2>",
            "level": 0
          }
        ],
        "decryption": "none",
        "fallbacks": []
      },
      "sniffing": {
        "destOverride": ["http", "tls", "quic", "fakedns"],
        "enabled": false
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none",
        "tcpSettings": {
          "header": { "type": "none" }
        }
      },
      "tag": "inbound-2060"
    },
    {
      "allocate": {
        "concurrency": 3,
        "refresh": 5,
        "strategy": "always"
      },
      "port": 14755,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "email": "<EMAIL_3>",
            "flow": "",
            "id": "<UUID_3>",
            "level": 0
          }
        ],
        "decryption": "none",
        "fallbacks": []
      },
      "sniffing": {
        "destOverride": ["http", "tls", "quic", "fakedns"],
        "enabled": false
      },
      "streamSettings": {
        "network": "xhttp",
        "realitySettings": {
          "dest": "yahoo.com:443",
          "privateKey": "<PRIVATE_KEY_2>",
          "serverNames": ["yahoo.com", "www.yahoo.com"],
          "shortIds": ["..."],
          "xver": 0
        },
        "security": "reality",
        "xhttpSettings": {
          "mode": "auto",
          "path": "/rkdulf",
          "scMaxBufferedPosts": 30,
          "scMaxEachPostBytes": "1000000",
          "scStreamUpServerSecs": "20-80",
          "xPaddingBytes": "100-1000"
        }
      },
      "tag": "inbound-14755"
    }
  ],
  "log": {
    "access": "none",
    "dnsLog": false,
    "error": "",
    "loglevel": "warning"
  },
  "metrics": {
    "listen": "127.0.0.1:11111",
    "tag": "metrics_out"
  },
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "levels": {
      "0": {
        "statsUserDownlink": true,
        "statsUserUplink": true,
        "statsUserOnline": true
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true,
      "statsOutboundDownlink": true,
      "statsOutboundUplink": true
    }
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "inboundTag": ["api"],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": ["geoip:private"],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "protocol": ["bittorrent"],
        "outboundTag": "blocked",
        "type": "field"
      }
    ]
  },
  "stats": {}
}

Let me know if you spot anything missing or incorrect.
Thanks again!

<!-- gh-comment-id:3067766483 --> @sadramv commented on GitHub (Jul 14, 2025): Here’s my current `config.json` (with all sensitive information removed): ```json { "api": { "services": [ "HandlerService", "LoggerService", "StatsService" ], "tag": "api" }, "burstObservatory": null, "dns": null, "fakedns": null, "inbounds": [ { "allocate": null, "listen": "127.0.0.1", "port": 62789, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "sniffing": null, "streamSettings": null, "tag": "api" }, { "allocate": { "concurrency": 3, "refresh": 5, "strategy": "always" }, "port": 11246, "protocol": "vless", "settings": { "clients": [ { "email": "<EMAIL_1>", "flow": "", "id": "<UUID_1>", "level": 0 } ], "decryption": "none", "fallbacks": [] }, "sniffing": { "destOverride": ["http", "tls", "quic", "fakedns"], "enabled": false }, "streamSettings": { "network": "xhttp", "realitySettings": { "dest": "Rasekhoon.net:443", "privateKey": "<PRIVATE_KEY_1>", "serverNames": ["yahoo.com", "www.yahoo.com"], "shortIds": ["..."], "xver": 0 }, "security": "reality", "xhttpSettings": { "mode": "auto", "path": "/syndyjdykrymrumrukrukrukrukru", "scMaxBufferedPosts": 30, "scMaxEachPostBytes": "1000000", "scStreamUpServerSecs": "20-80", "xPaddingBytes": "100-1000" } }, "tag": "inbound-11246" }, { "allocate": { "concurrency": 3, "refresh": 5, "strategy": "always" }, "port": 2060, "protocol": "vless", "settings": { "clients": [ { "email": "<EMAIL_2>", "flow": "", "id": "<UUID_2>", "level": 0 } ], "decryption": "none", "fallbacks": [] }, "sniffing": { "destOverride": ["http", "tls", "quic", "fakedns"], "enabled": false }, "streamSettings": { "network": "tcp", "security": "none", "tcpSettings": { "header": { "type": "none" } } }, "tag": "inbound-2060" }, { "allocate": { "concurrency": 3, "refresh": 5, "strategy": "always" }, "port": 14755, "protocol": "vless", "settings": { "clients": [ { "email": "<EMAIL_3>", "flow": "", "id": "<UUID_3>", "level": 0 } ], "decryption": "none", "fallbacks": [] }, "sniffing": { "destOverride": ["http", "tls", "quic", "fakedns"], "enabled": false }, "streamSettings": { "network": "xhttp", "realitySettings": { "dest": "yahoo.com:443", "privateKey": "<PRIVATE_KEY_2>", "serverNames": ["yahoo.com", "www.yahoo.com"], "shortIds": ["..."], "xver": 0 }, "security": "reality", "xhttpSettings": { "mode": "auto", "path": "/rkdulf", "scMaxBufferedPosts": 30, "scMaxEachPostBytes": "1000000", "scStreamUpServerSecs": "20-80", "xPaddingBytes": "100-1000" } }, "tag": "inbound-14755" } ], "log": { "access": "none", "dnsLog": false, "error": "", "loglevel": "warning" }, "metrics": { "listen": "127.0.0.1:11111", "tag": "metrics_out" }, "outbounds": [ { "protocol": "freedom", "settings": {} }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "policy": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true, "statsUserOnline": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true, "statsOutboundDownlink": true, "statsOutboundUplink": true } }, "routing": { "domainStrategy": "AsIs", "rules": [ { "inboundTag": ["api"], "outboundTag": "api", "type": "field" }, { "ip": ["geoip:private"], "outboundTag": "blocked", "type": "field" }, { "protocol": ["bittorrent"], "outboundTag": "blocked", "type": "field" } ] }, "stats": {} } ``` Let me know if you spot anything missing or incorrect. Thanks again!
Author
Owner

@xinhai-ai commented on GitHub (Jul 14, 2025):

It looks fine, no different from my configuration file, and I have no idea what the problem is

<!-- gh-comment-id:3067780792 --> @xinhai-ai commented on GitHub (Jul 14, 2025): It looks fine, no different from my configuration file, and I have no idea what the problem is
Author
Owner

@sadramv commented on GitHub (Jul 14, 2025):

Thank you so much for taking the time to check and compare it with your own config. I really appreciate your help — at least now I know the issue isn’t in the configuration itself. I’ll keep digging. Thanks again!

<!-- gh-comment-id:3067784688 --> @sadramv commented on GitHub (Jul 14, 2025): Thank you so much for taking the time to check and compare it with your own config. I really appreciate your help — at least now I know the issue isn’t in the configuration itself. I’ll keep digging. Thanks again!
Author
Owner

@lelekahobby commented on GitHub (Jul 24, 2025):

This routing rule should be at the very top.:

"routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      },
<!-- gh-comment-id:3114042352 --> @lelekahobby commented on GitHub (Jul 24, 2025): This routing rule should be at the very top.: ```json "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "inboundTag": [ "api" ], "outboundTag": "api" }, ```
Author
Owner

@petrosey commented on GitHub (Aug 12, 2025):

"concurrency": 3, I want to change this to accommodate more users but it keeps coming to 3 always and is it the panels fault that it gets weak and used by many users although I am using 2 gb ram lightsaill

<!-- gh-comment-id:3180303068 --> @petrosey commented on GitHub (Aug 12, 2025): "concurrency": 3, I want to change this to accommodate more users but it keeps coming to 3 always and is it the panels fault that it gets weak and used by many users although I am using 2 gb ram lightsaill
Author
Owner

@Ramiz69 commented on GitHub (Aug 27, 2025):

Same problem: Inbound traffic always zero

<!-- gh-comment-id:3226422816 --> @Ramiz69 commented on GitHub (Aug 27, 2025): Same problem: Inbound traffic always zero
Author
Owner

@evilnero commented on GitHub (Mar 2, 2026):

I had this issue because my iptables firewall was blocking loopback (127.0.0.1) connections.

3x-ui communicates with Xray via the local API (127.0.0.1).
If loopback traffic is blocked, the panel cannot read StatsService data.

You can check your rules with:
iptables -S

To make sure loopback traffic is allowed in the filter table, add following rule:
iptables -A INPUT -i lo -j ACCEPT

Command to add this above everything else:
iptables -I INPUT 1 -i lo -j ACCEPT

After fixing, my rules look like (iptables -S):

-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
...

You can try to reset all rules (careful!)

# flush all chains
iptables -F
iptables -t nat -F
iptables -t mangle -F
# delete all user-defined chains
iptables -X

Be careful when flushing firewall rules on a remote server — you may lock yourself out. I personally use netfilter-persistent and iptables-persistent to save and reload them.

<!-- gh-comment-id:3981700400 --> @evilnero commented on GitHub (Mar 2, 2026): I had this issue because my iptables firewall was blocking loopback (127.0.0.1) connections. 3x-ui communicates with Xray via the local API (127.0.0.1). If loopback traffic is blocked, the panel cannot read StatsService data. You can check your rules with: iptables -S To make sure loopback traffic is allowed in the filter table, add following rule: `iptables -A INPUT -i lo -j ACCEPT` Command to add this above everything else: `iptables -I INPUT 1 -i lo -j ACCEPT` After fixing, my rules look like (iptables -S): ``` -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -i lo -j ACCEPT ... ``` You can try to reset all rules (careful!) ``` # flush all chains iptables -F iptables -t nat -F iptables -t mangle -F # delete all user-defined chains iptables -X ``` Be careful when flushing firewall rules on a remote server — you may lock yourself out. I personally use netfilter-persistent and iptables-persistent to save and reload them.
Author
Owner

@Sameguyy commented on GitHub (Mar 26, 2026):

Sorry, I don't know what to do either. I encountered the same issue you described. After I reviewed the xray-core documentation and added this section, the problem was resolved. Could you please share your config.json (make sure to hide any Confidential Information)?

@xinhai-ai Please tell me, how did you edit the config.json, doesn't 3x-ui recreate it every time you start xray?

At the end of my config file, lines are constantly added:

  "stats": null

I don't understand where this line comes from
It seems to me that this line is why the calculation does not work

<!-- gh-comment-id:4130764918 --> @Sameguyy commented on GitHub (Mar 26, 2026): > Sorry, I don't know what to do either. I encountered the same issue you described. After I reviewed the xray-core documentation and added this section, the problem was resolved. Could you please share your config.json (make sure to hide any Confidential Information)? @xinhai-ai Please tell me, how did you edit the config.json, doesn't 3x-ui recreate it every time you start xray? At the end of my config file, lines are constantly added: ``` "stats": null ``` I don't understand where this line comes from It seems to me that this line is why the calculation does not work
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#2186
No description provided.