Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to login. Where is the default userinfo.sql file? How do I initialize a database? #61

Open
JokerDevops opened this issue May 24, 2019 · 2 comments

Comments

@JokerDevops
Copy link

errror log

[2019-05-24 11:15:03,387] ERROR in app: Exception on /api/v2/auth/login/ [POST]
Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/util/_collections.py", line 1010, in __call__
    return self.registry[key]
KeyError: 140072201742080

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 338, in dbapi
    from pysqlite2 import dbapi2 as sqlite
ModuleNotFoundError: No module named 'pysqlite2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/cesi/cesi/api/v2/auth.py", line 35, in login
    result = User.verify(user_credentials["username"], user_credentials["password"])
  File "/usr/local/cesi/cesi/models.py", line 37, in verify
    user = User.query.filter_by(username=username).first()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 514, in __get__
    return type.query_class(mapper, session=self.sa.session())
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 78, in __call__
    return self.registry()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/util/_collections.py", line 1012, in __call__
    return self.registry.setdefault(key, self.createfunc())
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 3206, in __call__
    return self.class_(**local_kw)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 143, in __init__
    bind = options.pop('bind', None) or db.engine
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 877, in engine
    return self.get_engine()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 896, in get_engine
    return connector.get_engine()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 559, in get_engine
    self._engine = rv = sqlalchemy.create_engine(info, **options)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 435, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 343, in dbapi
    raise e
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 341, in dbapi
    from sqlite3 import dbapi2 as sqlite  # try 2.5+ stdlib name.
  File "/usr/local/Python3.6/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/Python3.6/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
60.12.216.130 - - [24/May/2019 11:15:03] "POST /api/v2/auth/login/ HTTP/1.1" 500 -
[2019-05-24 11:15:05,009] ERROR in app: Exception on /api/v2/auth/login/ [POST]
Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/util/_collections.py", line 1010, in __call__
    return self.registry[key]
KeyError: 140072201742080

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 338, in dbapi
    from pysqlite2 import dbapi2 as sqlite
ModuleNotFoundError: No module named 'pysqlite2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/cesi/cesi/api/v2/auth.py", line 35, in login
    result = User.verify(user_credentials["username"], user_credentials["password"])
  File "/usr/local/cesi/cesi/models.py", line 37, in verify
    user = User.query.filter_by(username=username).first()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 514, in __get__
    return type.query_class(mapper, session=self.sa.session())
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 78, in __call__
    return self.registry()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/util/_collections.py", line 1012, in __call__
    return self.registry.setdefault(key, self.createfunc())
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 3206, in __call__
    return self.class_(**local_kw)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 143, in __init__
    bind = options.pop('bind', None) or db.engine
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 877, in engine
    return self.get_engine()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 896, in get_engine
    return connector.get_engine()
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py", line 559, in get_engine
    self._engine = rv = sqlalchemy.create_engine(info, **options)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 435, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 343, in dbapi
    raise e
  File "/usr/local/cesi/venv/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 341, in dbapi
    from sqlite3 import dbapi2 as sqlite  # try 2.5+ stdlib name.
  File "/usr/local/Python3.6/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/Python3.6/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
60.12.216.130 - - [24/May/2019 11:15:05] "POST /api/v2/auth/login/ HTTP/1.1" 500 -
@gocpp
Copy link

gocpp commented Jun 14, 2019

I have the same error.

@isbaran
Copy link

isbaran commented Jun 14, 2019

Did you install the said pysqlite2 module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@isbaran @gocpp @JokerDevops and others