• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Issue ERROR Error in FilterPyinotify callback: must be string without null bytes, not str

daanse

Regular Pleskian
Hi,

just noticed that my Fail2Ban is not banning any IPs.
so i looked into fail2ban.log and noticed thousands of fails, as followed:

Code:
2017-03-19 07:08:01,992 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:08,143 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,221 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,240 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,266 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,285 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,322 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,340 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,641 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:15,671 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:16,261 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:16,442 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str
2017-03-19 07:08:16,458 fail2ban.filterpyinotify[6530]: ERROR Error in FilterPyinotify callback: must be string without null bytes, not str

what i the world happened here?
I didn't changed anything.

fail2ban status is active.
PLesk Onyx latest and Debian 8.x

EDIT: After restart and applying this here: https://www.howtoforge.com/community/threads/fail2ban-error-in-log-files.66369/
i noticed some more Fails (see Screenshot)

Still have no clue what to do.
Any Advice?
 

Attachments

  • Bildschirmfoto 2017-03-22 um 00.01.27.jpg
    Bildschirmfoto 2017-03-22 um 00.01.27.jpg
    264.2 KB · Views: 4
  • Bildschirmfoto 2017-03-22 um 00.02.17.jpg
    Bildschirmfoto 2017-03-22 um 00.02.17.jpg
    1.1 MB · Views: 4
Last edited:
Hi daanse,

did you consider to RE-INSTALL Fail2Ban, to solve your issue(s) ?

Code:
plesk installer --select-product-id plesk --select-release-current --remove-component fail2ban
plesk installer --select-product-id plesk --select-release-current --install-component fail2ban


In addition, I would never recommend suggestions from external sources in the first place. Consider to redo your changes to "auto", if you don't want to re-install Fail2Ban and restart it.
 
Hi @UFHH01 ,
i did exactly as you said, no changes. Moreover, i can switch on f2b Jails without waiting, which is not normal, cause it took always longer, at about 30 seconds.
Anyways, i still get these same errors and i want to point out, that i didn't changed any Jail, CONF.
Only thing i made is to update linux several days ago, as i always do, if there are new Updates.
 
Hi daanse,

Only thing i made is to update linux several days ago, as i always do, if there are new Updates.
You seem to have updated/upgraded the "python" package on your server. Correct?

Pls. post the output of ( as user "root" over SSH ):
Code:
which python
python -v

AND

python -V
 
Hi @UFHH01 ,

thanks for help:

Code:
root@ ~ # which python
/usr/bin/python
root@ ~ # python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
import site # precompiled from /usr/lib/python2.7/site.pyc
# /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
import os # precompiled from /usr/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
import posixpath # precompiled from /usr/lib/python2.7/posixpath.pyc
# /usr/lib/python2.7/stat.pyc matches /usr/lib/python2.7/stat.py
import stat # precompiled from /usr/lib/python2.7/stat.pyc
# /usr/lib/python2.7/genericpath.pyc matches /usr/lib/python2.7/genericpath.py
import genericpath # precompiled from /usr/lib/python2.7/genericpath.pyc
# /usr/lib/python2.7/warnings.pyc matches /usr/lib/python2.7/warnings.py
import warnings # precompiled from /usr/lib/python2.7/warnings.pyc
# /usr/lib/python2.7/linecache.pyc matches /usr/lib/python2.7/linecache.py
import linecache # precompiled from /usr/lib/python2.7/linecache.pyc
# /usr/lib/python2.7/types.pyc matches /usr/lib/python2.7/types.py
import types # precompiled from /usr/lib/python2.7/types.pyc
# /usr/lib/python2.7/UserDict.pyc matches /usr/lib/python2.7/UserDict.py
import UserDict # precompiled from /usr/lib/python2.7/UserDict.pyc
# /usr/lib/python2.7/_abcoll.pyc matches /usr/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.7/_abcoll.pyc
# /usr/lib/python2.7/abc.pyc matches /usr/lib/python2.7/abc.py
import abc # precompiled from /usr/lib/python2.7/abc.pyc
# /usr/lib/python2.7/_weakrefset.pyc matches /usr/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/lib/python2.7/copy_reg.pyc matches /usr/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.7/copy_reg.pyc
# /usr/lib/python2.7/traceback.pyc matches /usr/lib/python2.7/traceback.py
import traceback # precompiled from /usr/lib/python2.7/traceback.pyc
# /usr/lib/python2.7/sysconfig.pyc matches /usr/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/lib/python2.7/sysconfig.pyc
# /usr/lib/python2.7/re.pyc matches /usr/lib/python2.7/re.py
import re # precompiled from /usr/lib/python2.7/re.pyc
# /usr/lib/python2.7/sre_compile.pyc matches /usr/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.7/sre_parse.pyc matches /usr/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.7/sre_parse.pyc
# /usr/lib/python2.7/sre_constants.pyc matches /usr/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.7/sre_constants.pyc
import _locale # builtin
# /usr/lib/python2.7/_sysconfigdata.pyc matches /usr/lib/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from /usr/lib/python2.7/_sysconfigdata.pyc
# /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.pyc matches /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py
import _sysconfigdata_nd # precompiled from /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.pyc
# /usr/lib/python2.7/sitecustomize.pyc matches /usr/lib/python2.7/sitecustomize.py
import sitecustomize # precompiled from /usr/lib/python2.7/sitecustomize.pyc
import encodings # directory /usr/lib/python2.7/encodings
# /usr/lib/python2.7/encodings/__init__.pyc matches /usr/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.7/encodings/__init__.pyc
# /usr/lib/python2.7/codecs.pyc matches /usr/lib/python2.7/codecs.py
import codecs # precompiled from /usr/lib/python2.7/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.7/encodings/aliases.pyc matches /usr/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.7/encodings/aliases.pyc
# /usr/lib/python2.7/encodings/utf_8.pyc matches /usr/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.7/encodings/utf_8.pyc
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.7/lib-dynload/readline.x86_64-linux-gnu.so", 2);
import readline # dynamically loaded from /usr/lib/python2.7/lib-dynload/readline.x86_64-linux-gnu.so
>>>

and:
Code:
# python -V
Python 2.7.9
 
Hi daanse,

pls. post as well the output from:

Code:
apt-cache policy fail2ban

and

lsb_release -a
uname -a
 
Hi @UFHH01,

okay:
Code:
# apt-cache policy fail2ban
fail2ban:
  Installed: 1:0.9.2-debian8.0.16102516
  Candidate: 1:0.9.2-debian8.0.16102516
  Version table:
 *** 1:0.9.2-debian8.0.16102516 0
        100 /var/lib/dpkg/status
     0.8.13-1 0
        500 http://mirror.hetzner.de/debian/packages/ jessie/main amd64 Packages
        500 http://http.debian.net/debian/ jessie/main amd64 Packages

and
Code:
# lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:    8.7
Codename:    jessie
# uname -a
Linux hostname-xxxx.com 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux
 
Hi daanse

ahhh... here we go... :
# apt-cache policy fail2ban
fail2ban:
Installed: 1:0.9.2-debian8.0.16102516
Candidate: 1:0.9.2-debian8.0.16102516
Version table:
*** 1:0.9.2-debian8.0.16102516 0
100 /var/lib/dpkg/status
0.8.13-1 0
500 http://mirror.hetzner.de/debian/packages/ jessie/main amd64 Packages
500 http://http.debian.net/debian/ jessie/main amd64 Packages
You rather like the Fail2Ban version from your vendor, instead of using the Plesk - Fail2Ban - version.

You have two choices now:

Either ask the Debian - 8 - Community or Fail2Ban - community to solve your bug with "Fail2Ban" and the corresponding package "python-pyinotify"

OR

Consider to UN-install Fail2Ban completely from Plesk with the already mentioned command, afterwards use the command "aptitude purge fail2ban", rename a possible leftover folder "/etc/fail2ban" to "/etc/fail2ban.backup" ( => command: mv /etc/fail2ban /etc/fail2ban.backup ), download the Plesk Fail2Ban versions and install them manually:

Code:
mkdir -p /root/addons/Plesk
cd /root/addons/Plesk
wget http://autoinstall.plesk.com/PSA_17.0.17/dist-deb-Debian-8.0-x86_64/opt/fail2ban/fail2ban_0.9.2-debian8.0.16102516_all.deb
wget http://autoinstall.plesk.com/PSA_17.0.17/dist-deb-Debian-8.0-x86_64/opt/fail2ban/plesk-fail2ban-configurator_17.0.17-debian8.0.build1700161026.19_all.deb

and install the Plesk supported versions with the "dpkg" command:

dpkg -i fail2ban_0.9.2-debian8.0.16102516_all.deb plesk-fail2ban-configurator_17.0.17-debian8.0.build1700161026.19_all.deb

Afterwards, clean your system with:

cd /
rm -r /root/addons/Plesk
rm -r /root/addons
 
Last edited by a moderator:
... if you STILL experience issues, then these issues are because of your vendor's "python-pyinotify" version. You could use "polling" instead of "auto", but I'd rather recommend to search for solutions/patches over the Debian Community. ;)
 
Hi @UFHH01,

thank you, i don't understand but it seems that i have two f2b installed? Makes no sense to me but i would like to use Plesk f2b.
I dont understand which steps this would require to stay with plesk f2b.
Can you kindly clarify your answer?
 
Hi daanse,

I dont understand which steps this would require to stay with plesk f2b.
Can you kindly clarify your answer?
I really tried to provide ALL necessary commands ( for Debian 8 ) in my previous post... where is a possible error/issue/problem, when using the suggestion?
 
Consider to UN-install Fail2Ban completely from Plesk with the already mentioned command, afterwards use the command "aptitude purge fail2ban", rename a possible leftover folder "/etc/fail2ban" to "/etc/fail2ban.backup" ( => command: mv /etc/fail2ban /etc/fail2ban.backup ), download the Plesk Fail2Ban versions and install them manually:
ahh, i understand, you mean to remove completely F2B and than install again, right?
 
Hi @UFHH01 ,

i did as you described, looks good, but still noticed some errors:
Code:
iptables -X f2b-plesk-proftpd -- stderr: 'iptables: Too many links.\n'
2017-03-22 13:47:00,813 fail2ban.action         [20017]: ERROR   iptables -D INPUT -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -j f2b-plesk-proftpd
iptables -F f2b-plesk-proftpd
iptables -X f2b-plesk-proftpd -- returned 1
2017-03-22 13:47:00,813 fail2ban.actions        [20017]: ERROR   Failed to stop jail 'plesk-proftpd' action 'iptables-multiport': Error stopping action
2017-03-22 13:47:00,813 fail2ban.jail           [20017]: INFO    Jail 'plesk-proftpd' stopped
2017-03-22 13:47:01,679 fail2ban.action         [20017]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
iptables -F f2b-plesk-wordpress
iptables -X f2b-plesk-wordpress -- stdout: ''
2017-03-22 13:47:01,679 fail2ban.action         [20017]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
iptables -F f2b-plesk-wordpress
iptables -X f2b-plesk-wordpress -- stderr: 'iptables: Too many links.\n'
2017-03-22 13:47:01,679 fail2ban.action         [20017]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
iptables -F f2b-plesk-wordpress
iptables -X f2b-plesk-wordpress -- returned 1

this: stderr: 'iptables: Too many links.\n' what can i do here?
 
Hi daanse,

you seem to have quite a lot of current entries in your iptables at the moment. Pls. flush your iptables and stop and start fail2ban again:

Code:
/sbin/iptables -F

service fail2ban stop

service fail2ban start
 
Hi daanse,

you seem to have quite a lot of current entries in your iptables at the moment. Pls. flush your iptables and stop and start fail2ban again:

Code:
/sbin/iptables -F

service fail2ban stop

service fail2ban start
Thank you, i ran the first command flush ... and then 15-20 Minutes later, Server down.
Its a dedicated 64GB Ram Server.
I made a reset and try again some Night :)
 
Hi daanse,

Thank you, i ran the first command flush ... and then 15-20 Minutes later, Server down.
Flushing the iptables will not result in any "server down" situations at all.

Pls. inspect your log - files ( kern.log / syslog / debug / messages / etc... ), in order to investigate your further issues/errors/problems. ;)
 
Hi @UFHH01,
i ran first command an it never came to an End, instead of that, everything went down, no ssh, no panel, no frontend Pages.
So i restarted Server. Its maybe not logical but this is what happened.
I will investigate, thank you.
 
Back
Top