FreeTAKTeam / FreeTakServer

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

Error login Web UI #190

Closed nghiajenius-dev closed 3 years ago

nghiajenius-dev commented 3 years ago

Hi everyone,

I followed the instruction to install FreeTAKServer-UI, but I got this error when trying to access the WebUI, port 5000:

Do you know the reason for this error and how to fix it? Thank you.

`Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context self.dialect.do_execute( File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/default.py", line 593, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: no such column: user.id

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/eventlet/wsgi.py", line 573, in handle_one_response result = self.application(self.environ, start_response) File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/app/base/routes.py", line 62, in login if not current_user.is_authenticated: File "/usr/local/lib/python3.8/dist-packages/werkzeug/local.py", line 422, in get obj = instance._get_current_object() File "/usr/local/lib/python3.8/dist-packages/werkzeug/local.py", line 544, in _get_current_object return self.__local() # type: ignore File "/usr/local/lib/python3.8/dist-packages/flask_login/utils.py", line 26, in current_user = LocalProxy(lambda: _get_user()) File "/usr/local/lib/python3.8/dist-packages/flask_login/utils.py", line 346, in _get_user current_app.login_manager._load_user() File "/usr/local/lib/python3.8/dist-packages/flask_login/login_manager.py", line 331, in _load_user user = self._load_user_from_request(request) File "/usr/local/lib/python3.8/dist-packages/flask_login/login_manager.py", line 390, in _load_user_from_request user = self._request_callback(request) File "/usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/app/base/models.py", line 43, in request_loader user = User.query.filter_by(uid=username).first() File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3429, in first ret = list(self[0:1]) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3203, in getitem return list(res) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3535, in iter return self._execute_and_instances(context) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1011, in execute return meth(self, multiparams, params) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement ret = self._execute_context( File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context self._handle_dbapi_exception( File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapiexception util.raise( File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context self.dialect.do_execute( File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/default.py", line 593, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: user.id [SQL: SELECT user.uid AS user_uid, user.id AS user_id FROM user WHERE user.uid IS NULL LIMIT ? OFFSET ?] [parameters: (1, 0)] (Background on this error at: http://sqlalche.me/e/13/e3q8)`

naman108 commented 3 years ago

please send you configuration file for the UI, furthermore please ensure that the UI and FTS server are connecting to seperate DB's

naman108 commented 3 years ago

we're you able to solve your issue?

nghiajenius-dev commented 3 years ago

Hi @naman108 ,

Thank you for your support. Yes, I checked and solved the issue now.

You are right. I changed the DB in the UI config file to the same as FTS server which caused the issue (the comment "# This will connect to the FTS db" confused me). After the change to the following, I can now have the UI running: SQLALCHEMY_DATABASE_URI = 'sqlite:///' + '/opt/FTSDataBase-UI.db'

Thanks again, Nghia.