[GH-ISSUE #4218] Fail2Ban fails to start due to unescaped '%' in 3x-ipl.conf date format #2870

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

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

Describe the bug

Describe the bug

When configuring Fail2Ban via the panel, the generated configuration files (like /etc/fail2ban/action.d/3x-ipl.conf) use unescaped % characters in the date command for logging. Fail2Ban uses % for variable interpolation, so encountering a single % causes a configuration parsing error, and the fail2ban.service completely crashes and fails to start.

Error Logs

fail2ban-server[55925]: ERROR  Failed during configuration: Error in action definition '3x-ipl': '%' must be followed by '%' or '(', found: '%Y/%m/%d %H:%M:%S")   BAN   [Email] = <F-USER> [IP] = <ip> banned for <bantime> seconds." >> /var/log/x-ui/3xipl-banned.log'
fail2ban-server[55925]: ERROR  Async configuration of server failed
systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION

### How to repeat the problem?


- Enable the Fail2Ban integration.
- Attempt to restart the service via sudo systemctl restart fail2ban.
- Check the status sudo systemctl status fail2ban to see the crash.

### Expected action

_No response_

### Received action

_No response_

### 3x-ui Version

v3.0.0

### Xray-core Version

v26.4.25

### Checklist

- [x] This bug report is written entirely in English.
- [x] This bug report is new and no one has reported it before me.
Originally created by @xAlokyx on GitHub (May 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4218 ### Describe the bug ### Describe the bug When configuring Fail2Ban via the panel, the generated configuration files (like `/etc/fail2ban/action.d/3x-ipl.conf`) use unescaped `%` characters in the `date` command for logging. Fail2Ban uses `%` for variable interpolation, so encountering a single `%` causes a configuration parsing error, and the `fail2ban.service` completely crashes and fails to start. ### Error Logs ```text fail2ban-server[55925]: ERROR Failed during configuration: Error in action definition '3x-ipl': '%' must be followed by '%' or '(', found: '%Y/%m/%d %H:%M:%S") BAN [Email] = <F-USER> [IP] = <ip> banned for <bantime> seconds." >> /var/log/x-ui/3xipl-banned.log' fail2ban-server[55925]: ERROR Async configuration of server failed systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION ### How to repeat the problem? - Enable the Fail2Ban integration. - Attempt to restart the service via sudo systemctl restart fail2ban. - Check the status sudo systemctl status fail2ban to see the crash. ### Expected action _No response_ ### Received action _No response_ ### 3x-ui Version v3.0.0 ### Xray-core Version v26.4.25 ### 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:28:33 +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#2870
No description provided.