[GH-ISSUE #6796] [Bug]: Fix Xray startup failure caused by ProtectKernelTunables=yes and read-only rp_filter after panel updates / گزارش باگ: اجرا نشدن Xray به دلیل فقط‌خواندنی شدن rp_filter پس از آپدیت پنل #4526

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

Originally created by @montiego on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6796

Describe the bug

Bug Report: Xray Fails to Start Due to Read-Only rp_filter After Panel Updates

Description

After updating the 3X-UI panel, Xray fails to start and reports the following error in the logs:

Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system

Root Cause

The issue appears to be related to the ProtectKernelTunables=yes setting in the x-ui.service systemd unit. This setting can make /proc/sys read-only for the service, preventing Xray from modifying the IPv4 rp_filter kernel parameter during startup.

Workaround

Currently, I manually edit /etc/systemd/system/x-ui.service and change:

ProtectKernelTunables=yes

to:

ProtectKernelTunables=no

After reloading the systemd configuration and restarting the service, Xray starts successfully.

However, after each panel update, the problem returns and I have to repeat this modification.

Expected Behavior

Xray should start successfully after a panel update without requiring manual changes to the systemd service configuration. Panel updates should also preserve any required service configuration changes, or the default service configuration should allow Xray to modify rp_filter when necessary.

Actual Behavior

Xray fails to start because it cannot access /proc/sys/net/ipv4/conf/all/rp_filter for writing. The issue reappears after panel updates.

Environment

  • Panel: 3X-UI
  • Operating System: Ubuntu 26.04 LTS
  • Service: x-ui.service
  • Component: Xray

Request

Could you please investigate the systemd service configuration and the handling of the ProtectKernelTunables setting during panel updates, and provide a permanent fix?

Thank you for your work on this project.

گزارش باگ: اجرا نشدن Xray به دلیل فقط‌خواندنی شدن rp_filter پس از آپدیت پنل

شرح مشکل

پس از هر بار آپدیت پنل 3X-UI، سرویس Xray اجرا نمی‌شود و خطای زیر در لاگ‌ها نمایش داده می‌شود:

Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system

علت احتمالی

به نظر می‌رسد این مشکل به تنظیم ProtectKernelTunables=yes در فایل سرویس systemd مربوط باشد. این گزینه می‌تواند دسترسی نوشتن سرویس به /proc/sys را محدود کند و مانع تغییر پارامتر کرنل rp_filter توسط Xray هنگام راه‌اندازی شود.

راه‌حل موقت

در حال حاضر، فایل زیر را به‌صورت دستی ویرایش می‌کنم:

/etc/systemd/system/x-ui.service

و مقدار زیر را:

ProtectKernelTunables=yes

به مقدار زیر تغییر می‌دهم:

ProtectKernelTunables=no

سپس تنظیمات systemd را بارگذاری مجدد کرده و سرویس را راه‌اندازی مجدد می‌کنم. پس از این تغییر، Xray با موفقیت اجرا می‌شود.

بااین‌حال، پس از هر آپدیت پنل، مشکل دوباره ظاهر می‌شود و مجبورم این تغییر را تکرار کنم.

رفتار مورد انتظار

پس از آپدیت پنل، Xray باید بدون نیاز به تغییر دستی فایل سرویس systemd اجرا شود. همچنین، تنظیمات ضروری سرویس نباید در جریان آپدیت از بین بروند؛ یا پیکربندی پیش‌فرض سرویس باید اجازه تغییر rp_filter توسط Xray را فراهم کند.

رفتار فعلی

Xray به دلیل نداشتن دسترسی نوشتن به مسیر /proc/sys/net/ipv4/conf/all/rp_filter اجرا نمی‌شود و این مشکل بعد از آپدیت‌های پنل تکرار می‌شود.

مشخصات محیط

  • پنل: 3X-UI
  • سیستم‌عامل: Ubuntu 26.04 LTS
  • سرویس: x-ui.service
  • مؤلفه مرتبط: Xray

درخواست

لطفاً پیکربندی systemd سرویس و نحوه مدیریت گزینه ProtectKernelTunables هنگام آپدیت پنل را بررسی کنید و یک راه‌حل دائمی برای این مشکل ارائه دهید.

با تشکر از توسعه‌دهندگان این پروژه.

How to reproduce the problem

Bug Report: Xray Fails to Start Due to Read-Only rp_filter After Panel Updates

Description

After updating the 3X-UI panel, Xray fails to start and reports the following error in the logs:

Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system

Root Cause

The issue appears to be related to the ProtectKernelTunables=yes setting in the x-ui.service systemd unit. This setting can make /proc/sys read-only for the service, preventing Xray from modifying the IPv4 rp_filter kernel parameter during startup.

Workaround

Currently, I manually edit /etc/systemd/system/x-ui.service and change:

ProtectKernelTunables=yes

to:

ProtectKernelTunables=no

After reloading the systemd configuration and restarting the service, Xray starts successfully.

However, after each panel update, the problem returns and I have to repeat this modification.

Expected Behavior

Xray should start successfully after a panel update without requiring manual changes to the systemd service configuration. Panel updates should also preserve any required service configuration changes, or the default service configuration should allow Xray to modify rp_filter when necessary.

Actual Behavior

Xray fails to start because it cannot access /proc/sys/net/ipv4/conf/all/rp_filter for writing. The issue reappears after panel updates.

Environment

  • Panel: 3X-UI
  • Operating System: Ubuntu 26.04 LTS
  • Service: x-ui.service
  • Component: Xray

Request

Could you please investigate the systemd service configuration and the handling of the ProtectKernelTunables setting during panel updates, and provide a permanent fix?

Thank you for your work on this project.

گزارش باگ: اجرا نشدن Xray به دلیل فقط‌خواندنی شدن rp_filter پس از آپدیت پنل

شرح مشکل

پس از هر بار آپدیت پنل 3X-UI، سرویس Xray اجرا نمی‌شود و خطای زیر در لاگ‌ها نمایش داده می‌شود:

Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system

علت احتمالی

به نظر می‌رسد این مشکل به تنظیم ProtectKernelTunables=yes در فایل سرویس systemd مربوط باشد. این گزینه می‌تواند دسترسی نوشتن سرویس به /proc/sys را محدود کند و مانع تغییر پارامتر کرنل rp_filter توسط Xray هنگام راه‌اندازی شود.

راه‌حل موقت

در حال حاضر، فایل زیر را به‌صورت دستی ویرایش می‌کنم:

/etc/systemd/system/x-ui.service

و مقدار زیر را:

ProtectKernelTunables=yes

به مقدار زیر تغییر می‌دهم:

ProtectKernelTunables=no

سپس تنظیمات systemd را بارگذاری مجدد کرده و سرویس را راه‌اندازی مجدد می‌کنم. پس از این تغییر، Xray با موفقیت اجرا می‌شود.

بااین‌حال، پس از هر آپدیت پنل، مشکل دوباره ظاهر می‌شود و مجبورم این تغییر را تکرار کنم.

رفتار مورد انتظار

پس از آپدیت پنل، Xray باید بدون نیاز به تغییر دستی فایل سرویس systemd اجرا شود. همچنین، تنظیمات ضروری سرویس نباید در جریان آپدیت از بین بروند؛ یا پیکربندی پیش‌فرض سرویس باید اجازه تغییر rp_filter توسط Xray را فراهم کند.

رفتار فعلی

Xray به دلیل نداشتن دسترسی نوشتن به مسیر /proc/sys/net/ipv4/conf/all/rp_filter اجرا نمی‌شود و این مشکل بعد از آپدیت‌های پنل تکرار می‌شود.

مشخصات محیط

  • پنل: 3X-UI
  • سیستم‌عامل: Ubuntu 26.04 LTS
  • سرویس: x-ui.service
  • مؤلفه مرتبط: Xray

درخواست

لطفاً پیکربندی systemd سرویس و نحوه مدیریت گزینه ProtectKernelTunables هنگام آپدیت پنل را بررسی کنید و یک راه‌حل دائمی برای این مشکل ارائه دهید.

با تشکر از توسعه‌دهندگان این پروژه.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

dev

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 26

Which parts of the panel are affected?

No response

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 @montiego on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6796 ### Describe the bug ### Bug Report: Xray Fails to Start Due to Read-Only `rp_filter` After Panel Updates **Description** After updating the 3X-UI panel, Xray fails to start and reports the following error in the logs: ```text Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system ``` **Root Cause** The issue appears to be related to the `ProtectKernelTunables=yes` setting in the `x-ui.service` systemd unit. This setting can make `/proc/sys` read-only for the service, preventing Xray from modifying the IPv4 `rp_filter` kernel parameter during startup. **Workaround** Currently, I manually edit `/etc/systemd/system/x-ui.service` and change: ```ini ProtectKernelTunables=yes ``` to: ```ini ProtectKernelTunables=no ``` After reloading the systemd configuration and restarting the service, Xray starts successfully. However, after each panel update, the problem returns and I have to repeat this modification. **Expected Behavior** Xray should start successfully after a panel update without requiring manual changes to the systemd service configuration. Panel updates should also preserve any required service configuration changes, or the default service configuration should allow Xray to modify `rp_filter` when necessary. **Actual Behavior** Xray fails to start because it cannot access `/proc/sys/net/ipv4/conf/all/rp_filter` for writing. The issue reappears after panel updates. **Environment** - Panel: 3X-UI - Operating System: Ubuntu 26.04 LTS - Service: `x-ui.service` - Component: Xray **Request** Could you please investigate the systemd service configuration and the handling of the `ProtectKernelTunables` setting during panel updates, and provide a permanent fix? Thank you for your work on this project. ### گزارش باگ: اجرا نشدن Xray به دلیل فقط‌خواندنی شدن `rp_filter` پس از آپدیت پنل **شرح مشکل** پس از هر بار آپدیت پنل 3X-UI، سرویس Xray اجرا نمی‌شود و خطای زیر در لاگ‌ها نمایش داده می‌شود: ```text Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system ``` **علت احتمالی** به نظر می‌رسد این مشکل به تنظیم `ProtectKernelTunables=yes` در فایل سرویس systemd مربوط باشد. این گزینه می‌تواند دسترسی نوشتن سرویس به `/proc/sys` را محدود کند و مانع تغییر پارامتر کرنل `rp_filter` توسط Xray هنگام راه‌اندازی شود. **راه‌حل موقت** در حال حاضر، فایل زیر را به‌صورت دستی ویرایش می‌کنم: `/etc/systemd/system/x-ui.service` و مقدار زیر را: ```ini ProtectKernelTunables=yes ``` به مقدار زیر تغییر می‌دهم: ```ini ProtectKernelTunables=no ``` سپس تنظیمات systemd را بارگذاری مجدد کرده و سرویس را راه‌اندازی مجدد می‌کنم. پس از این تغییر، Xray با موفقیت اجرا می‌شود. بااین‌حال، پس از هر آپدیت پنل، مشکل دوباره ظاهر می‌شود و مجبورم این تغییر را تکرار کنم. **رفتار مورد انتظار** پس از آپدیت پنل، Xray باید بدون نیاز به تغییر دستی فایل سرویس systemd اجرا شود. همچنین، تنظیمات ضروری سرویس نباید در جریان آپدیت از بین بروند؛ یا پیکربندی پیش‌فرض سرویس باید اجازه تغییر `rp_filter` توسط Xray را فراهم کند. **رفتار فعلی** Xray به دلیل نداشتن دسترسی نوشتن به مسیر `/proc/sys/net/ipv4/conf/all/rp_filter` اجرا نمی‌شود و این مشکل بعد از آپدیت‌های پنل تکرار می‌شود. **مشخصات محیط** - پنل: 3X-UI - سیستم‌عامل: Ubuntu 26.04 LTS - سرویس: `x-ui.service` - مؤلفه مرتبط: Xray **درخواست** لطفاً پیکربندی systemd سرویس و نحوه مدیریت گزینه `ProtectKernelTunables` هنگام آپدیت پنل را بررسی کنید و یک راه‌حل دائمی برای این مشکل ارائه دهید. با تشکر از توسعه‌دهندگان این پروژه. ### How to reproduce the problem ### Bug Report: Xray Fails to Start Due to Read-Only `rp_filter` After Panel Updates **Description** After updating the 3X-UI panel, Xray fails to start and reports the following error in the logs: ```text Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system ``` **Root Cause** The issue appears to be related to the `ProtectKernelTunables=yes` setting in the `x-ui.service` systemd unit. This setting can make `/proc/sys` read-only for the service, preventing Xray from modifying the IPv4 `rp_filter` kernel parameter during startup. **Workaround** Currently, I manually edit `/etc/systemd/system/x-ui.service` and change: ```ini ProtectKernelTunables=yes ``` to: ```ini ProtectKernelTunables=no ``` After reloading the systemd configuration and restarting the service, Xray starts successfully. However, after each panel update, the problem returns and I have to repeat this modification. **Expected Behavior** Xray should start successfully after a panel update without requiring manual changes to the systemd service configuration. Panel updates should also preserve any required service configuration changes, or the default service configuration should allow Xray to modify `rp_filter` when necessary. **Actual Behavior** Xray fails to start because it cannot access `/proc/sys/net/ipv4/conf/all/rp_filter` for writing. The issue reappears after panel updates. **Environment** - Panel: 3X-UI - Operating System: Ubuntu 26.04 LTS - Service: `x-ui.service` - Component: Xray **Request** Could you please investigate the systemd service configuration and the handling of the `ProtectKernelTunables` setting during panel updates, and provide a permanent fix? Thank you for your work on this project. ### گزارش باگ: اجرا نشدن Xray به دلیل فقط‌خواندنی شدن `rp_filter` پس از آپدیت پنل **شرح مشکل** پس از هر بار آپدیت پنل 3X-UI، سرویس Xray اجرا نمی‌شود و خطای زیر در لاگ‌ها نمایش داده می‌شود: ```text Failed to start: main: failed to create server > failed to disable ipv4 rp_filter for all: open /proc/sys/net/ipv4/conf/all/rp_filter: read-only file system ``` **علت احتمالی** به نظر می‌رسد این مشکل به تنظیم `ProtectKernelTunables=yes` در فایل سرویس systemd مربوط باشد. این گزینه می‌تواند دسترسی نوشتن سرویس به `/proc/sys` را محدود کند و مانع تغییر پارامتر کرنل `rp_filter` توسط Xray هنگام راه‌اندازی شود. **راه‌حل موقت** در حال حاضر، فایل زیر را به‌صورت دستی ویرایش می‌کنم: `/etc/systemd/system/x-ui.service` و مقدار زیر را: ```ini ProtectKernelTunables=yes ``` به مقدار زیر تغییر می‌دهم: ```ini ProtectKernelTunables=no ``` سپس تنظیمات systemd را بارگذاری مجدد کرده و سرویس را راه‌اندازی مجدد می‌کنم. پس از این تغییر، Xray با موفقیت اجرا می‌شود. بااین‌حال، پس از هر آپدیت پنل، مشکل دوباره ظاهر می‌شود و مجبورم این تغییر را تکرار کنم. **رفتار مورد انتظار** پس از آپدیت پنل، Xray باید بدون نیاز به تغییر دستی فایل سرویس systemd اجرا شود. همچنین، تنظیمات ضروری سرویس نباید در جریان آپدیت از بین بروند؛ یا پیکربندی پیش‌فرض سرویس باید اجازه تغییر `rp_filter` توسط Xray را فراهم کند. **رفتار فعلی** Xray به دلیل نداشتن دسترسی نوشتن به مسیر `/proc/sys/net/ipv4/conf/all/rp_filter` اجرا نمی‌شود و این مشکل بعد از آپدیت‌های پنل تکرار می‌شود. **مشخصات محیط** - پنل: 3X-UI - سیستم‌عامل: Ubuntu 26.04 LTS - سرویس: `x-ui.service` - مؤلفه مرتبط: Xray **درخواست** لطفاً پیکربندی systemd سرویس و نحوه مدیریت گزینه `ProtectKernelTunables` هنگام آپدیت پنل را بررسی کنید و یک راه‌حل دائمی برای این مشکل ارائه دهید. با تشکر از توسعه‌دهندگان این پروژه. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version dev ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 26 ### Which parts of the panel are affected? _No response_ ### 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:40:16 +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#4526
No description provided.