stamparm/maltrail

[BUG] python six module

Closed this issue · 10 comments

Installed latest maltrail 0.69 on Ubu 24.04 LTS

on trying to initate sensor.py

Traceback (most recent call last):
File "/opt/maltrail/sensor.py", line 33, in
from core.common import check_connection
File "/opt/maltrail/core/common.py", line 23, in
from core.settings import config
File "/opt/maltrail/core/settings.py", line 23, in
from thirdparty.six.moves import urllib as _urllib
ModuleNotFoundError: No module named 'thirdparty.six.moves'

updated all python modules to latest versions

that same module six is included inside the Maltrail git repo (https://github.com/stamparm/maltrail/tree/master/thirdparty/six). in case that you did properly checkout the git repo and start the sensor with a proper environment (i.e. no fooling around with starting directory or smth like that), you would be able to start it out of the box

Hi, I have the same issue (even if six is in the right place)
Thanks

@icolab can you try the following (exact same lines to run, no modifications):

cd /tmp
wget "https://github.com/stamparm/maltrail/archive/refs/heads/master.zip"
unzip master.zip
cd maltrail-master
sudo -E python3 sensor.py

Hi @stamparm,
Here is the output of the following commandes:

[tmp]# cd maltrail-master/
[maltrail-master]# ls
CHANGELOG LICENSE plugins server.py
CITATION.cff maltrail.conf README.md thirdparty
core maltrail-sensor.service requirements.txt trails
docker maltrail-server.service SECURITY.md
html misc sensor.py
[maltrail-master]# sudo -E python3 sensor.py
Traceback (most recent call last):
File "/tmp/maltrail-master/sensor.py", line 33, in
from core.common import check_connection
File "/tmp/maltrail-master/core/common.py", line 23, in
from core.settings import config
File "/tmp/maltrail-master/core/settings.py", line 23, in
from thirdparty.six.moves import urllib as _urllib
ModuleNotFoundError: No module named 'thirdparty.six.moves'

i had one clean debian machine. did everything like above. can't reproduce the problem

I have exactly the same issue as @jafo65,
I am using a python3.12 virtual environment. Using sudo <path_python_venv>/bin/pip3 install pcapy-ng for and sudo <path_python_venv>/bin/python3 sensor.py.
Seems like the python-venv doesn't find the folder thirdparty

(py_venv) user@ubuntu:~/maltrail-master$ sudo ../py_venv/bin/python3 sensor.py 
Traceback (most recent call last):
  File "/home/user/maltrail-master/sensor.py", line 33, in <module>
    from core.common import check_connection
  File "/home/user/maltrail-master/core/common.py", line 23, in <module>
    from core.settings import config
  File "/home/user/maltrail-master/core/settings.py", line 23, in <module>
    from thirdparty.six.moves import urllib as _urllib
ModuleNotFoundError: No module named 'thirdparty.six.moves'

I have the same problem with my archlinux and maltrail : using python3.12 and it not work with excatly the same error.

Downgrade to 3.11 and it work again.

Regards.

@jafo65 @icolab @pierre-guillot @IanNicki Please, let us know if problem is solved with the latest revision of MT, which contains Miroslav's patch. Thank you!

@stamparm and @MikhailKasimov,
it runs like clockwork. Just tested it on Python 3.12.3
Thank you guys 👍