Fail2Ban Failed

Hello Everyone, I am having an issue with Fail2Ban after the latest updates to FreePBX 16.0.40.4. My FreePBX console is displaying the following error:

When I run an fwconsole restart command, I get the following related to Fail2ban:
Restarting fail2ban
fail2ban Restart failed Failed: The command “systemctl restart fail2ban” failed.

Exit Code: 1(General error)

Working directory: /root

Output:

Error Output:

Job for fail2ban.service failed because the control process exited with error co de. See “systemctl status fail2ban.service” and “journalctl -xe” for details.

[root@pbx ~]# systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2023-07-04 20:37:11 CDT; 2min 53s ago
Process: 16573 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
Process: 16572 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, status=0/SUCCESS)
Main PID: 19980 (code=killed, signal=TERM)

Jul 04 20:37:10 pbx.cctechhost.com fail2ban-client[16573]: ERROR Failed during configuration: Have not found any log file for … jail
Jul 04 20:37:10 pbx.cctechhost.com systemd[1]: Failed to start Fail2Ban Service.
Jul 04 20:37:10 pbx.cctechhost.com systemd[1]: Unit fail2ban.service entered failed state.
Jul 04 20:37:10 pbx.cctechhost.com systemd[1]: fail2ban.service failed.
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: Stopped Fail2Ban Service.
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: start request repeated too quickly for fail2ban.service
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: Failed to start Fail2Ban Service.
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: Unit fail2ban.service entered failed state.
Jul 04 20:37:11 pbx.cctechhost.com systemd[1]: fail2ban.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

[root@pbx ~]# journalctl -xe
– Support: systemd-devel Info Page

– Unit session-197178.scope has finished starting up.

– The start-up result is done.
Jul 04 20:40:01 pbx.cctechhost.com systemd[1]: Started Session 197177 of user asterisk.
– Subject: Unit session-197177.scope has finished start-up
– Defined-By: systemd
– Support: systemd-devel Info Page

– Unit session-197177.scope has finished starting up.

– The start-up result is done.
Jul 04 20:40:01 pbx.cctechhost.com CROND[18569]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwcons
Jul 04 20:40:01 pbx.cctechhost.com CROND[18571]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwcons
Jul 04 20:40:01 pbx.cctechhost.com CROND[18570]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jul 04 20:40:08 pbx.cctechhost.com runuser[18592]: pam_unix(runuser:session): session opened for user asterisk by (uid=0)
Jul 04 20:40:08 pbx.cctechhost.com runuser[18592]: pam_unix(runuser:session): session closed for user asterisk
Jul 04 20:40:10 pbx.cctechhost.com crontab[18628]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18630]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18647]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18649]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18651]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18652]: (asterisk) REPLACE (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18654]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18656]: (asterisk) LIST (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18657]: (asterisk) REPLACE (asterisk)
Jul 04 20:40:10 pbx.cctechhost.com crontab[18659]: (asterisk) LIST (asterisk)
Jul 04 20:40:25 pbx.cctechhost.com systemd[1]: Removed slice User Slice of asterisk.
– Subject: Unit user-995.slice has finished shutting down
– Defined-By: systemd
– Support: systemd-devel Info Page

– Unit user-995.slice has finished shutting down.
Jul 04 20:40:43 pbx.cctechhost.com runuser[18831]: pam_unix(runuser:session): session opened for user asterisk by (uid=0)
Jul 04 20:40:43 pbx.cctechhost.com runuser[18831]: pam_unix(runuser:session): session closed for user asterisk

Jul 04 20:37:10 pbx.cctechhost.com fail2ban-client[16573]: ERROR Failed during configuration: Have not found any log file for … jail

I can’t help you unless you tell us what the ... jail is :wink:

How do I do that? I am just posting what the logs show.

Note

Hint: Some lines were ellipsized, use -l to show in full.

Failing that, look in the fail2ban log file, which might be /var/log/asterisk/fail2ban* or /var/log/fail2ban.log depending on how you installed FreePBX and fail2ban

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.