DB-GPT [Bug] [DB] KeyError: 'db_name'

2guxujil  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(46)

在 ASGI 应用程序中发生了异常。
异常组(Exception Group)的最后一行是:

raise BaseExceptionGroup(
exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call**
| return await self.app(scope, receive, send)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/cors.py", line 93, in **call**
| await self.simple_response(scope, receive, send, request_headers=headers)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/cors.py", line 148, in simple_response
| await self.app(scope, receive, send)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in **call**
| await super().**call**(scope, receive, send)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/applications.py", line 123, in **call**
| await self.middleware_stack(scope, receive, send)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in **call**
| raise exc
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in **call**
| await self.app(scope, receive, _send)
| File "/opt/soft/DB-GPT/dbgpt/util/tracer/tracer_middleware.py", line 49, in dispatch
| response = await call_next(request)
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call
| raise app_exc
| File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages
在处理上述异常的过程中,发生了另一个异常:
Traceback (most recent call last):
  File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
  result = await app( # type: ignore[func-returns-value]
  File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call
  return await self.app(scope, receive, send)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/cors.py", line 93, in **call
  await self.simple_response(scope, receive, send, request_headers=headers)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/cors.py", line 148, in simple_response
  await self.app(scope, receive, send)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in **call
  await super().**call(scope, receive, send)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/applications.py", line 123, in **call
  await self.middleware_stack(scope, receive, send)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in **call
  raise exc
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in **call
  await self.app(scope, receive, _send)
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 189, in **call
  with collapse_excgroups():
 File "/root/miniconda3/envs/dbgpt_env/lib/python3.10/contextlib.py", line 153, in __exit__
  self.gen.throw(typ, value, traceback)
 File "/root/miniconda3/envs在执行editor_sql_run函数时,找不到名为'run_param'的键值对。请检查代码中是否存在该键值对。"
文件 "/root/miniconda3/envs/dbgpt_env/lib/python3.10/site-packages/fastapi/routing.py",第191行,在运行端点函数时
return await dependant.call(**values)
文件 "/opt/soft/DB-GPT/dbgpt/app/openapi/api_v1/editor/api_editor_v1.py",第95行,在editor_sql_run中
db_name = run_param["db_name"]
KeyError: 'db_name'

![](//img.saoniuhuo.com/images/202407/85121721625569820.jpg)

![](//img.saoniuhuo.com/images/202407/52111721625573132.jpg)

#### 期望发生的事情

我不知道....

#### 如何重现

使用tongyi。

#### 其他上下文

* 无响应*

#### 你是否愿意提交PR?

* 是的,我愿意提交一个PR!
b1uwtaje

b1uwtaje1#

数据库里是有这个库的,所有的数据库,如MySQL、SQLite和StarRocks连接都是正常的。但是当打开数据对话时,却显示错误。

o2g1uqev

o2g1uqev2#

你选择的对话是mysql数据库还报错吗?另外,你的dbgpt版本是多少?可以升级到最新的版本试一下。我这边数据库对话都没问题,我用的还是0.5.6版本。

相关问题