gamegos / cesi

CeSI is a web interface for managing multiple supervisors from the same place.
GNU General Public License v3.0
577 stars 185 forks source link

Invalid username or password #82

Open cuiyongqiang521 opened 4 years ago

cuiyongqiang521 commented 4 years ago

Login to CESI with the default account for the first time. After restarting CESI, you will be prompted with "invalid user name or password". Even if you change the password, it will be invalid. The following is the background error, can you help to see what the problem.

File "/data/Python3.6/lib/python3.6/site-packages/Flask-0.12.1-py3.6.egg/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/data/Python3.6/lib/python3.6/site-packages/Flask-0.12.1-py3.6.egg/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "/data/cesi/cesi/api/v2/auth.py", line 35, in login result = User.verify(user_credentials["username"], user_credentials["password"]) File "/data/cesi/cesi/models.py", line 37, in verify user = User.query.filter_by(username=username).first() File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3397, in first ret = list(self[0:1]) File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3171, in getitem return list(res) File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3503, in iter return self._execute_and_instances(context) File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3525, in _execute_and_instances querycontext, self._connection_from_session, close_with_result=True File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3540, in _get_bind_args mapper=self._bind_mapper(), clause=querycontext.statement, kw File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 3518, in _connection_from_session conn = self.session.connection(kw) File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1141, in connection execution_options=execution_options, File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1147, in _connection_for_bind engine, execution_options File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 409, in _connection_for_bind self._assert_active() File "/data/Python3.6/lib/python3.6/site-packages/SQLAlchemy-1.3.18-py3.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 296, in _assert_active code="7s2a", sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.IntegrityError) column username is not unique [SQL: INSERT INTO users (username, password, usertype) VALUES (?, ?, ?)] [parameters: ('admin', 'pbkdf2:sha256:50000$AuTMhJVb$32b7ed7be7ca0344bf6984e194e35d418ef1ca818fec5d6ab83372dae98eb4e4', 0)] (Background on this error at: http://sqlalche.me/e/13/gkpj) (Background on this error at: http://sqlalche.me/e/13/7s2a) 10.208.1.13 - - [14/Aug/2020 05:53:04] "POST /api/v2/auth/login/ HTTP/1.1" 500