[GH-ISSUE #5160] [Bug]: BBR enable #3630

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

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

Describe the bug

When I enable the BBR setting via a script on the server, I get a response stating that two parameters have incorrect values

sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument
sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument

How to reproduce the problem

│ 24. Enable BBR │
│ 25. Update Geo Files │
│ 26. Speedtest by Ookla │
│────────────────────────────────────────────────│
│ 27. PostgreSQL Management │
╚────────────────────────────────────────────────╝

Panel state: Running
Start automatically: Yes
xray state: Running

Please enter your selection [0-27]: 24
1. Enable BBR
2. Disable BBR
0. Back to Main Menu
Choose an option: 1

Expected behavior

No response

Actual behavior

Please enter your selection [0-27]: 24
1. Enable BBR
2. Disable BBR
0. Back to Main Menu
Choose an option: 1

  • Applying /etc/sysctl.d/10-console-messages.conf ...
    kernel.printk = 4 4 1 7
  • Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
    net.ipv6.conf.all.use_tempaddr = 2
    net.ipv6.conf.default.use_tempaddr = 2
  • Applying /etc/sysctl.d/10-kernel-hardening.conf ...
    kernel.kptr_restrict = 1
  • Applying /etc/sysctl.d/10-magic-sysrq.conf ...
    kernel.sysrq = 176
  • Applying /etc/sysctl.d/10-network-security.conf ...
    net.ipv4.conf.default.rp_filter = 2
    net.ipv4.conf.all.rp_filter = 2
  • Applying /etc/sysctl.d/10-ptrace.conf ...
    kernel.yama.ptrace_scope = 1
  • Applying /etc/sysctl.d/10-zeropage.conf ...
    vm.mmap_min_addr = 65536
  • Applying /usr/lib/sysctl.d/50-default.conf ...
    kernel.core_uses_pid = 1
    net.ipv4.conf.default.rp_filter = 2
    net.ipv4.conf.default.accept_source_route = 0
    sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument
    net.ipv4.conf.default.promote_secondaries = 1
    sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument
    net.ipv4.ping_group_range = 0 2147483647
    net.core.default_qdisc = fq_codel
    fs.protected_hardlinks = 1
    fs.protected_symlinks = 1
    fs.protected_regular = 1
    fs.protected_fifos = 1
  • Applying /usr/lib/sysctl.d/50-pid-max.conf ...
    kernel.pid_max = 4194304
  • Applying /etc/sysctl.d/99-bbr-x-ui.conf ...
    net.core.default_qdisc = fq
    net.ipv4.tcp_congestion_control = bbr
  • Applying /usr/lib/sysctl.d/99-protect-links.conf ...
    fs.protected_fifos = 1
    fs.protected_hardlinks = 1
    fs.protected_regular = 2
    fs.protected_symlinks = 1
  • Applying /etc/sysctl.d/99-sysctl.conf ...
  • Applying /etc/sysctl.conf ...
    BBR has been enabled successfully.

Relevant logs


Screenshots

No response

3x-ui version

3.3.0

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 22.04

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

Yandex Browser

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 @vrcher on GitHub (Jun 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5160 ### Describe the bug When I enable the BBR setting via a script on the server, I get a response stating that two parameters have incorrect values sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument ### How to reproduce the problem │ 24. Enable BBR │ │ 25. Update Geo Files │ │ 26. Speedtest by Ookla │ │────────────────────────────────────────────────│ │ 27. PostgreSQL Management │ ╚────────────────────────────────────────────────╝ Panel state: Running Start automatically: Yes xray state: Running Please enter your selection [0-27]: 24 1. Enable BBR 2. Disable BBR 0. Back to Main Menu Choose an option: 1 ### Expected behavior _No response_ ### Actual behavior Please enter your selection [0-27]: 24 1. Enable BBR 2. Disable BBR 0. Back to Main Menu Choose an option: 1 * Applying /etc/sysctl.d/10-console-messages.conf ... kernel.printk = 4 4 1 7 * Applying /etc/sysctl.d/10-ipv6-privacy.conf ... net.ipv6.conf.all.use_tempaddr = 2 net.ipv6.conf.default.use_tempaddr = 2 * Applying /etc/sysctl.d/10-kernel-hardening.conf ... kernel.kptr_restrict = 1 * Applying /etc/sysctl.d/10-magic-sysrq.conf ... kernel.sysrq = 176 * Applying /etc/sysctl.d/10-network-security.conf ... net.ipv4.conf.default.rp_filter = 2 net.ipv4.conf.all.rp_filter = 2 * Applying /etc/sysctl.d/10-ptrace.conf ... kernel.yama.ptrace_scope = 1 * Applying /etc/sysctl.d/10-zeropage.conf ... vm.mmap_min_addr = 65536 * Applying /usr/lib/sysctl.d/50-default.conf ... kernel.core_uses_pid = 1 net.ipv4.conf.default.rp_filter = 2 net.ipv4.conf.default.accept_source_route = 0 sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument net.ipv4.conf.default.promote_secondaries = 1 sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument net.ipv4.ping_group_range = 0 2147483647 net.core.default_qdisc = fq_codel fs.protected_hardlinks = 1 fs.protected_symlinks = 1 fs.protected_regular = 1 fs.protected_fifos = 1 * Applying /usr/lib/sysctl.d/50-pid-max.conf ... kernel.pid_max = 4194304 * Applying /etc/sysctl.d/99-bbr-x-ui.conf ... net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr * Applying /usr/lib/sysctl.d/99-protect-links.conf ... fs.protected_fifos = 1 fs.protected_hardlinks = 1 fs.protected_regular = 2 fs.protected_symlinks = 1 * Applying /etc/sysctl.d/99-sysctl.conf ... * Applying /etc/sysctl.conf ... BBR has been enabled successfully. ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.0 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 22.04 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) Yandex Browser ### 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:33:49 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report.

The errors are harmless — BBR is actually enabled successfully. Your output confirms this with the final line: "BBR has been enabled successfully."

Root cause: The enable_bbr function in x-ui.sh (line 729) runs sysctl --system, which re-applies all sysctl configuration files on the system, not just the BBR-specific one. This includes Ubuntu 22.04's system-provided file /usr/lib/sysctl.d/50-default.conf (from the procps package), which attempts to set two parameters that are no longer valid on Ubuntu 22.04's kernel (5.15+):

  • net.ipv4.conf.all.promote_secondaries — removed in Linux kernel 5.14+
  • net.ipv4.conf.all.accept_source_route — returns Invalid argument when written via the all pseudo-interface on newer kernels

These errors originate from Ubuntu's own system packages, not from x-ui's 99-bbr-x-ui.conf. They would appear any time sysctl --system is invoked on this Ubuntu version — it is a known upstream issue with the procps package's sysctl defaults on newer kernels.

The underlying fix would be to replace the sysctl --system call with a targeted sysctl -p /etc/sysctl.d/99-bbr-x-ui.conf in x-ui.sh, so only the BBR settings are applied and the unrelated Ubuntu system sysctl errors are never surfaced. A PR for this change would be welcome.

For now, you don't need to do anything — your BBR is working correctly. You can verify with:

sysctl net.ipv4.tcp_congestion_control
# Expected: net.ipv4.tcp_congestion_control = bbr
sysctl net.core.default_qdisc
# Expected: net.core.default_qdisc = fq
<!-- gh-comment-id:4668563456 --> @github-actions[bot] commented on GitHub (Jun 10, 2026): Thanks for the detailed report. **The errors are harmless — BBR is actually enabled successfully.** Your output confirms this with the final line: *"BBR has been enabled successfully."* **Root cause:** The `enable_bbr` function in `x-ui.sh` (line 729) runs `sysctl --system`, which re-applies *all* sysctl configuration files on the system, not just the BBR-specific one. This includes Ubuntu 22.04's system-provided file `/usr/lib/sysctl.d/50-default.conf` (from the `procps` package), which attempts to set two parameters that are no longer valid on Ubuntu 22.04's kernel (5.15+): - `net.ipv4.conf.all.promote_secondaries` — removed in Linux kernel 5.14+ - `net.ipv4.conf.all.accept_source_route` — returns `Invalid argument` when written via the `all` pseudo-interface on newer kernels These errors originate from Ubuntu's own system packages, not from x-ui's `99-bbr-x-ui.conf`. They would appear any time `sysctl --system` is invoked on this Ubuntu version — it is a known upstream issue with the `procps` package's sysctl defaults on newer kernels. **The underlying fix** would be to replace the `sysctl --system` call with a targeted `sysctl -p /etc/sysctl.d/99-bbr-x-ui.conf` in `x-ui.sh`, so only the BBR settings are applied and the unrelated Ubuntu system sysctl errors are never surfaced. A PR for this change would be welcome. **For now, you don't need to do anything** — your BBR is working correctly. You can verify with: ```bash sysctl net.ipv4.tcp_congestion_control # Expected: net.ipv4.tcp_congestion_control = bbr sysctl net.core.default_qdisc # Expected: net.core.default_qdisc = fq ```
Author
Owner

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

Fixed in 2db48174: enable_bbr now applies only /etc/sysctl.d/99-bbr-x-ui.conf (sysctl -p) instead of sysctl --system, and disable_bbr drops the redundant sysctl --system re-apply. The "Invalid argument" messages came from Ubuntu's own sysctl defaults being re-applied, not from x-ui — BBR was enabled correctly all along. With this change those unrelated errors no longer appear.

<!-- gh-comment-id:4683915797 --> @MHSanaei commented on GitHub (Jun 11, 2026): Fixed in 2db48174: `enable_bbr` now applies only `/etc/sysctl.d/99-bbr-x-ui.conf` (`sysctl -p`) instead of `sysctl --system`, and `disable_bbr` drops the redundant `sysctl --system` re-apply. The "Invalid argument" messages came from Ubuntu's own sysctl defaults being re-applied, not from x-ui — BBR was enabled correctly all along. With this change those unrelated errors no longer appear.
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#3630
No description provided.