ail-project / ail-framework

AIL framework - Analysis Information Leak framework
GNU Affero General Public License v3.0
562 stars 79 forks source link

Can't Start Flask Server #233

Open fl0w2null opened 1 month ago

fl0w2null commented 1 month ago

I got this error when trying to launch AIL Anyone have had experience with this? Please let me know


Traceback (most recent call last):
  File "./Flask_server.py", line 36, in <module>
    from blueprints.crawler_splash import crawler_splash
  File "/root/ail-framework/var/www/blueprints/crawler_splash.py", line 28, in <module>
    from lib import crawlers
  File "/root/ail-framework/bin/lib/crawlers.py", line 41, in <module>
    from lib.objects.Domains import Domain
  File "/root/ail-framework/bin/lib/objects/Domains.py", line 21, in <module>
    from lib.objects.abstract_object import AbstractObject
  File "/root/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, get_obj_main_language
  File "/root/ail-framework/bin/lib/Language.py", line 11, in <module>
    from libretranslatepy import LibreTranslateAPI
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/__init__.py", line 1, in <module>
    from libretranslatepy.api import *
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 7, in <module>
    class LibreTranslateAPI:
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/libretranslatepy/api.py", line 27, in LibreTranslateAPI
    def __init__(self, url: str | None = None, api_key: str | None = None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType
'```
fl0w2null commented 1 month ago

This problem was caused by python3.8, which is a little different in syntax when parameters weren't provided by default. For exp: def __init__(self, url: str | None = None, api_key: str | None = None) it should be def __init__(self, url=None, api_key= None)

Terrtia commented 1 month ago

Hi @fl0w2null ! Thanks for the report ! Did you patch libretranslatepy ?

fl0w2null commented 1 month ago

Hi @fl0w2null ! Thanks for the report ! Did you patch libretranslatepy ?

I did, but changing it in small steps doesn't make sense, cause in some cases, I still see other error logs in modules.log and sync.log. I think you guys should change the requirements in the Installing guide, make sure to have Ubuntu version, Python version also...