0

控制台日志:

[2021-01-15 07:30:20 +0530] [11592] [ERROR] Exception occurred while handling uri: 'http://localhost:5002/api/auth'
Traceback (most recent call last):
  File "c:\users\adity\venv\lib\site-packages\rasa\cli\x.py", line 494, in run_locally
    local.main(
TypeError: main() got an unexpected keyword argument 'domain_path'

在处理上述异常的过程中,又出现了一个异常:

Traceback (most recent call last):
  File "c:\users\adity\venv\lib\site-packages\sanic\app.py", line 914, in handle_request
    response = await response
  File "c:\users\adity\venv\lib\site-packages\sanic_jwt\endpoints.py", line 36, in post
    access_token, output = await self.responses.get_access_token_output(
  File "c:\users\adity\venv\lib\site-packages\sanic_jwt\responses.py", line 19, in get_access_token_output
    access_token = await instance.auth.generate_access_token(user)
  File "c:\users\adity\venv\lib\site-packages\sanic_jwt\authentication.py", line 477, in generate_access_token
    return jwt.encode(payload, secret, algorithm=algorithm).decode("utf-8")
AttributeError: 'str' object has no attribute 'decode'
4

1 回答 1

3

在我使用 Ubuntu 20.04 的情况下,从 Rasa X 0.39.1 和 sanic-jwt 1.5.0 升级到 Rasa X 0.39.2 和 sanic-jwt 1.6.0 后,问题解决了。
我想我在升级 Rasa Core 时弄乱了 sanic-jwt 版本。因为从 pip >= 20.3 开始的新回溯会将 sanic-jwt 降级到 1.5.0 以满足安装 Rasa Core 的要求。

于 2021-05-02T16:17:34.503 回答