FreeTAKTeam / FreeTakServer

Situational Awareness Server compatible with TAK clients
Eclipse Public License 2.0
649 stars 166 forks source link

ImportError: cannot import name 'json' from 'itsdangerous' #296

Closed hiddenterror closed 2 years ago

hiddenterror commented 2 years ago

I followed the document to install FreeTAKServer on Ubuntu 20.04. However, when I try to start the service, I receive the error from the title (see below).

Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/services/FTS.py", line 6, in from FreeTAKServer.controllers.services.TCPDataPackageService import TCPDataPackageService as TCPFlaskFunctions File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/services/TCPDataPackageService.py", line 1, in from .DataPackageServer import FlaskFunctions, Path, dp_directory, os, app, eventlet, const File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/services/DataPackageServer.py", line 13, in from FreeTAKServer.controllers.DatabaseControllers.DatabaseController import DatabaseController File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/DatabaseControllers/DatabaseController.py", line 1, in import FreeTAKServer.controllers.DatabaseControllers.table_controllers File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/DatabaseControllers/table_controllers.py", line 3, in from FreeTAKServer.model.SQLAlchemy.User import User File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/model/SQLAlchemy/User.py", line 18, in from FreeTAKServer.model.SQLAlchemy.system_user import SystemUser File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/model/SQLAlchemy/system_user.py", line 6, in from flask_login import UserMixin File "/usr/local/lib/python3.8/dist-packages/flask_login/init.py", line 16, in from .login_manager import LoginManager File "/usr/local/lib/python3.8/dist-packages/flask_login/login_manager.py", line 12, in from flask import (_request_ctx_stack, abort, current_app, flash, redirect, File "/usr/local/lib/python3.8/dist-packages/flask/init.py", line 19, in from . import json File "/usr/local/lib/python3.8/dist-packages/flask/json/init.py", line 15, in from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.8/dist-packages/itsdangerous/init.py)

It seems as though this issue may be related to an issue with Flask (https://github.com/pallets/flask/issues/4455) and the only recommended fix at this time is to upgrade Flask (which gives an error as it is not compatible with FreeTAKServer. Downgrading itsdangerous and markupsafe did not seem to resolve the issue. I have rolled back the VM multiple times and started fresh, but the error has occurred every time.

brothercorvo commented 2 years ago

have you tried with the zero touch install?

kk6lzb commented 2 years ago

I'm also getting the same error after downgrading markupsafe to 2.0.1. I have not tried the zero touch install, though. Also running Ubuntu 20.04 on a fresh install.

hiddenterror commented 2 years ago

When I ran the zero touch install script, navigating to http://[ftsIP]:5000 shows "refused to connect," which is why I was attempting the manual installation instead. I also tried running the "sudo python3 -m FreeTAKServer.controllers.services.FTS" command after running the zero touch just to see, and the error generated there as well.

The interesting thing is I successfully deployed FTS about 2-2.5 weeks ago, but wiped the installation to make some adjustments, so this is definitely a recent issue.

jmarcorb commented 2 years ago

I can confirm this. It happened to me yesterday in a fresh Ubuntu 20.04 install. Also with the Hub installer. I tried multiple combinations of markupsafe, itsdangerous and Flask versions, but to no avail.

brothercorvo commented 2 years ago

Ok we are going to investigate this @naman108 and @jonaugustine . It looks like an issue with dependencies

brothercorvo commented 2 years ago

fixed in 1.9.8.5