CIRCL / AIL-framework

AIL framework - Analysis Information Leak framework. Project moved to https://github.com/ail-project
https://github.com/ail-project/ail-framework
GNU Affero General Public License v3.0
1.31k stars 285 forks source link

AIL Framework 5.2 starting everything but the Flask server #605

Closed wepfen closed 7 months ago

wepfen commented 7 months ago

Host : Ubuntu 20.04.6 AIL Framework version : 5.2


Hello,

I am opening this issue for the sake of sharing a solution to a problem i have encountered with ail framework (5.2).

When using LAUNCH.sh -l, everything start normally except the flask server.

After investigating, it turns out that libretranslatepy/api.py is the problem, returning the following error when starting Flask_server.py in standalone:

(AILENV) ➜  www git:(master) python Flask_server.py
VT submission is disabled
Traceback (most recent call last):
  File "Flask_server.py", line 36, in <module>
    from blueprints.crawler_splash import crawler_splash
  File "/home/user/Documents/ail-framework/var/www/blueprints/crawler_splash.py", line 28, in <module>
    from lib import crawlers
  File "/home/user/Documents/ail-framework/bin/lib/crawlers.py", line 41, in <module>
    from lib.objects.Domains import Domain
  File "/home/user/Documents/ail-framework/bin/lib/objects/Domains.py", line 21, in <module>
    from lib.objects.abstract_object import AbstractObject
  File "/home/user/Documents/ail-framework/bin/lib/objects/abstract_object.py", line 28, in <module>
    from lib.Language import get_obj_languages, add_obj_language, remove_obj_language, detect_obj_language, get_obj_language_stats, get_obj_translation, set_obj_translation, delete_obj_translation
  File "/home/user/Documents/ail-framework/bin/lib/Language.py", line 11, in <module>
    from libretranslatepy import LibreTranslateAPI
  File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/__init__.py", line 1, in <module>
    from libretranslatepy.api import *
  File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 8, in <module>
    class LibreTranslateAPI:
  File "/home/user/Documents/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 28, in LibreTranslateAPI
    def __init__(self, url: str | None = None, api_key: str | None = None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

For fixing, just add on the first line of the file ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py : from __future__ import annotations.

And restart the AIL LAUNCH.sh -r

wepfen commented 7 months ago

Already solved, just sharing