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

[BUG]新增应用时调试报错 #13

Closed
beijingtl opened this issue Mar 24, 2024 · 4 comments
Closed

[BUG]新增应用时调试报错 #13

beijingtl opened this issue Mar 24, 2024 · 4 comments
Assignees
Milestone

Comments

@beijingtl
Copy link

联系方式

517699029@qq.com

MaxKB 版本

版本号:v0.9.0 (build at 2024-03-21T18:39, commit: 96a0e4b)

问题描述

在新增应用时,配置好应用内的细节后,在右侧的测试窗口对话时提示报错。
对话提示报错

重现步骤

  1. 设置应用。在新建应用后,设置好名称、大模型,以及选择知识库后。
  2. 在右侧调试输入“hi”,同时也尝试过其他输入文本,都提示相同错误。

期待的正确结果

不报错,返回信息。

相关日志输出

waiting for postgres
2024-03-24 19:04:56.830 CST [141] FATAL:  the database system is starting up
127.0.0.1:5432 - rejecting connections
waiting for postgres
2024-03-24 19:04:57.845 CST [144] FATAL:  the database system is starting up
127.0.0.1:5432 - rejecting connections
waiting for postgres
2024-03-24 19:04:58.860 CST [147] FATAL:  the database system is starting up
127.0.0.1:5432 - rejecting connections
2024-03-24 19:04:59.005 CST [31] LOG:  database system was not properly shut down; automatic recovery in progress
2024-03-24 19:04:59.051 CST [31] LOG:  redo starts at 0/1E75BC0
2024-03-24 19:04:59.051 CST [31] LOG:  invalid record length at 0/1E75CA8: wanted 24, got 0
2024-03-24 19:04:59.051 CST [31] LOG:  redo done at 0/1E75C70 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2024-03-24 19:04:59.247 CST [29] LOG:  checkpoint starting: end-of-recovery immediate wait
2024-03-24 19:04:59.566 CST [29] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.120 s, sync=0.031 s, total=0.366 s; sync files=2, longest=0.016 s, average=0.016 s; distance=0 kB, estimate=0 kB
2024-03-24 19:04:59.624 CST [7] LOG:  database system is ready to accept connections
waiting for postgres
127.0.0.1:5432 - accepting connections
Operations to perform:
  Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
  No migrations to apply.
  Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Operations to perform:
  Apply all migrations: application, contenttypes, dataset, django_apscheduler, embedding, setting, users
Running migrations:
  No migrations to apply.
  Your models in app(s): 'application' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
2024-03-24 19:09:59.593 CST [29] LOG:  checkpoint starting: time
2024-03-24 19:10:00.273 CST [29] LOG:  checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.333 s, sync=0.044 s, total=0.681 s; sync files=4, longest=0.029 s, average=0.011 s; distance=3 kB, estimate=3 kB
2024-03-24 19:40:08 [basehttp INFO] "GET /api/provider/model_type_list?provider=model_ollama_provider HTTP/1.1" 200 109
2024-03-24 19:40:08 [basehttp INFO] "GET /api/provider/model_form?provider=model_ollama_provider&model_type=LLM&model_name=qwen:1.8b HTTP/1.1" 200 542
2024-03-24 19:40:08 [basehttp INFO] "GET /api/provider/model_list?provider=model_ollama_provider&model_type=LLM HTTP/1.1" 200 2538
2024-03-24 19:40:33 [basehttp INFO] "PUT /api/model/579cf4de-e995-11ee-a74e-0242ac100a08 HTTP/1.1" 200 303
2024-03-24 19:40:33 [basehttp INFO] "GET /api/model?name= HTTP/1.1" 200 305
2024-03-24 19:44:59.716 CST [29] LOG:  checkpoint starting: time
2024-03-24 19:44:59.997 CST [29] LOG:  checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.132 s, sync=0.046 s, total=0.281 s; sync files=2, longest=0.031 s, average=0.023 s; distance=1 kB, estimate=3 kB
2024-03-24 20:36:51 [basehttp INFO] "GET /ui/assets/SyncWebDialog-5c10ee06.css HTTP/1.1" 200 280
2024-03-24 20:36:51 [basehttp INFO] "GET /ui/assets/index-bcb9597e.js HTTP/1.1" 200 4351
2024-03-24 20:36:51 [basehttp INFO] "GET /ui/assets/index-3090d140.css HTTP/1.1" 200 295
2024-03-24 20:36:51 [basehttp INFO] "GET /ui/assets/SyncWebDialog-1c3d5bfd.js HTTP/1.1" 200 2158
/usr/local/lib/python3.11/site-packages/django/db/models/base.py:364: RuntimeWarning: Model 'dataset.dynamics' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
  new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
2024-03-24 20:36:51 [basehttp INFO] "GET /api/dataset/1/20 HTTP/1.1" 200 414
2024-03-24 20:36:51 [basehttp INFO] "GET /ui/assets/icon_document-2fa30876.svg HTTP/1.1" 200 1376
2024-03-24 20:36:53 [basehttp INFO] "GET /api/application/1/20 HTTP/1.1" 200 1988
2024-03-24 20:36:54 [basehttp INFO] "GET /ui/assets/index-b44a8f06.js HTTP/1.1" 200 10328
2024-03-24 20:36:54 [basehttp INFO] "GET /ui/assets/index-49976e2c.css HTTP/1.1" 200 405
2024-03-24 20:36:54 [basehttp INFO] "GET /api/application HTTP/1.1" 200 1937
2024-03-24 20:36:54 [basehttp INFO] "GET /api/application/fcbfad3a-e995-11ee-a74e-0242ac100a08/access_token HTTP/1.1" 200 223
2024-03-24 20:36:54 [basehttp INFO] "GET /api/application/fcbfad3a-e995-11ee-a74e-0242ac100a08 HTTP/1.1" 200 1996
2024-03-24 20:36:55 [basehttp INFO] "GET /ui/chat/34b6f605902a90af HTTP/1.1" 200 460
2024-03-24 20:36:55 [basehttp INFO] "GET /ui/assets/index-1b0dc722.js HTTP/1.1" 200 3259345
2024-03-24 20:36:55 [basehttp INFO] "GET /ui/assets/index-b342bee3.css HTTP/1.1" 200 433601
2024-03-24 20:37:02 [basehttp INFO] "GET /api/user_manage/1/20 HTTP/1.1" 200 369
2024-03-24 20:37:04 [basehttp INFO] "GET /api/provider HTTP/1.1" 200 17325
2024-03-24 20:37:04 [basehttp INFO] "GET /api/model?name= HTTP/1.1" 200 305
2024-03-24 20:37:06 [basehttp INFO] "GET /api/provider/model_type_list?provider=model_ollama_provider HTTP/1.1" 200 109
2024-03-24 20:37:06 [basehttp INFO] "GET /api/provider/model_form?provider=model_ollama_provider&model_type=LLM&model_name=qwen:1.8b HTTP/1.1" 200 542
2024-03-24 20:37:06 [basehttp INFO] "GET /api/provider/model_list?provider=model_ollama_provider&model_type=LLM HTTP/1.1" 200 2538
2024-03-24 20:37:21 [basehttp INFO] "GET /ui/assets/index-0531091d.js HTTP/1.1" 200 968
2024-03-24 20:37:21 [basehttp INFO] "GET /ui/assets/index-9da5a7b8.css HTTP/1.1" 200 805
2024-03-24 20:37:21 [basehttp INFO] "GET /ui/assets/icon_send-280a4ce1.svg HTTP/1.1" 200 945
2024-03-24 20:37:21 [basehttp INFO] "GET /ui/assets/icon_send_colorful-1f161525.svg HTTP/1.1" 200 1415
2024-03-24 20:37:21 [basehttp INFO] "POST /api/application/authentication HTTP/1.1" 200 403
2024-03-24 20:37:21 [basehttp INFO] "GET /api/application/profile HTTP/1.1" 200 508
2024-03-24 20:37:22 [basehttp INFO] "GET /ui/assets/icon_robot-c95ad06b.svg HTTP/1.1" 200 1337
2024-03-24 20:37:40 [basehttp INFO] "PUT /api/model/579cf4de-e995-11ee-a74e-0242ac100a08 HTTP/1.1" 200 303
2024-03-24 20:37:40 [basehttp INFO] "GET /api/model?name= HTTP/1.1" 200 305
2024-03-24 20:37:43 [basehttp INFO] "GET /ui/assets/user-icon-c413d294.svg HTTP/1.1" 200 1033
2024-03-24 20:37:43 [basehttp INFO] "GET /api/application/fcbfad3a-e995-11ee-a74e-0242ac100a08/chat/open HTTP/1.1" 200 88
/usr/local/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: The function `__call__` was deprecated in LangChain 0.1.7 and will be removed in 0.2.0. Use invoke instead.
  warn_deprecated(
2024-03-24 20:37:44 [handle_exception ERROR] substring not found:Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maxkb/app/apps/common/auth/authentication.py", line 94, in run
    return func(view, request, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maxkb/app/apps/application/views/chat_views.py", line 83, in post
    'client_type': request.auth.client_type}).chat()
                                              ^^^^^^
  File "/opt/maxkb/app/apps/application/serializers/chat_message_serializers.py", line 191, in chat
    pipline_message.run(params)
  File "/opt/maxkb/app/apps/application/chat_pipeline/pipeline_manage.py", line 29, in run
    step.run(self)
  File "/opt/maxkb/app/apps/application/chat_pipeline/I_base_chat_pipeline.py", line 122, in run
    self._run(manage)
  File "/opt/maxkb/app/apps/application/chat_pipeline/step/reset_problem_step/i_reset_problem_step.py", line 37, in _run
    padding_problem = self.execute(**self.context.get('step_args'))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maxkb/app/apps/application/chat_pipeline/step/reset_problem_step/impl/base_reset_problem_step.py", line 32, in execute
    padding_problem = response.content[response.content.index('<data>') + 6:response.content.index('</data>')]
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: substring not found

2024-03-24 20:37:44 [basehttp INFO] "POST /api/application/chat_message/4f4b48ee-e9db-11ee-a973-0242ac100a06 HTTP/1.1" 200 61

附加信息

  1. 已经测试了ollma服务正常。
    Ollama配置
(base) admin@ai-server:~$ curl http://172.16.10.2:11434/v1/chat/completions -d '{
  "model": "qwen:1.8b",
  "stream": false,
  "messages": [
    { "role": "user", "content": "1+1=?" }
  ]
}'
{"id":"chatcmpl-401","object":"chat.completion","created":1711283990,"model":"qwen:1.8b","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"1 + 1 = 2\n"},"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":10,"total_tokens":19}}
  1. 已经确认 test知识库里面,有文档,且里面有内容。
    test知识库
    知识库内的文档分段
@baixin513
Copy link
Contributor

感谢反馈,我们排查一下。

@baixin513
Copy link
Contributor

您好,确认一下是否开启了【问题优化】? 您可以关闭后在提问测试一下看看。
可能是开启了问题优化,但大模型未能返回优化后的问题导致。这里我们再优化一下处理逻辑。

@beijingtl
Copy link
Author

您好,确认一下是否开启了【问题优化】? 您可以关闭后在提问测试一下看看。 可能是开启了问题优化,但大模型未能返回优化后的问题导致。这里我们再优化一下处理逻辑。

你好。确实开启了“问题优化”导致的,关闭后就可以了。

@wanghe-fit2cloud
Copy link
Member

v0.9.1 版本已发布。

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

No branches or pull requests

3 participants