qd-today / qd

QD [v20240210] —— HTTP请求定时任务自动执行框架 base on HAR Editor and Tornado Server
https://qd-today.github.io/qd/
MIT License
4.46k stars 577 forks source link

[Bug] 登录成功却报错 #395

Closed powersee closed 1 year ago

powersee commented 1 year ago

Verify steps

QianDao Version

20230228

Bug on OS

Linux

Bug on Platform

Docker/Linux 64位

To Reproduce

我是在 docker 中运行的,在登录页面,输入账号密码登录后,会跳转到 xxxxxxxxx.com/login,然后页面上只显示

500: Internal Server Error

此时我只要把url 中的 login 去掉,就可以正常访问,会自动跳转到 xxxxxxxx.com/my/

Describe the Bug

登录成功却报错

QianDao config

No response

QianDao log

[E 230321 13:58:32 tornado.application web:1798] Uncaught exception POST /login (ipipipip)
    HTTPServerRequest(protocol='https', host='xxxxxxxxxxxxxxx.com', method='POST', uri='/login', version='HTTP/1.1', remote_ip='ipipipip')
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/src/app/web/handlers/login.py", line 76, in post
        user = await self.db.user.get(email=email, fields=('id', 'password', 'password_md5'), sql_session=sql_session)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/src/app/db/user.py", line 187, in get
        result = await self._get(smtm, one_or_none=one_or_none, first=first, sql_session=sql_session)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/src/app/db/basedb.py", line 97, in _get
        result: Result = await sql_session.execute(stmt)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/session.py", line 214, in execute
        result = await greenlet_spawn(
                 ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 128, in greenlet_spawn
        result = context.switch(value)
                 ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
        result = compile_state_cls.orm_setup_cursor_result(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 349, in orm_setup_cursor_result
        return loading.instances(result, querycontext)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/orm/loading.py", line 169, in instances
        _prebuffered = list(chunks(None))
                       ^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/orm/loading.py", line 147, in chunks
        fetch = cursor._raw_all_rows()
                ^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 393, in _raw_all_rows
        return [make_row(row) for row in rows]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 393, in <listcomp>
        return [make_row(row) for row in rows]
                ^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/sqlalchemy/sql/sqltypes.py", line 993, in process
        value = bytes(value)
                ^^^^^^^^^^^^
    TypeError: string argument without an encoding
[E 230321 13:58:32 tornado.access web:2271] 500 POST /login (ipipipip) 54.65ms
[I 230321 13:59:14 tornado.access web:2271] 200 GET / (154.89.5.107) 16.33ms
[I 230321 14:02:14 tornado.access web:2271] 302 GET / (ipipipip) 8.49ms
[I 230321 14:02:14 tornado.access web:2271] 200 GET /my/

Expected behavior

希望登录后可以自动跳转到 /my/

Screenshots

No response

a76yyyy commented 1 year ago

重置一下密码试试

a76yyyy commented 1 year ago

已修复, 请更新版本后重试

powersee commented 1 year ago

感谢,尝试了最新的版本,没问题了。❤️