dify 无法在数据库上执行命中测试,

hujrc8aj  于 2个月前  发布在  其他
关注(0)|答案(6)|浏览(92)

自检

  • 仅用于提交错误报告,如果您有问题,请转到 Discussions
  • 我已搜索现有问题 search for existing issues ,包括已关闭的问题。
  • 我确认我使用英语提交此报告(我已阅读并同意 Language Policy )。
  • 请不要修改此模板 :) 并填写所有必填字段。

Dify版本

0.6.10

云或自托管

自托管(Docker)

重现步骤

  1. 创建一个数据库并添加几个txt文档
  2. 启用自动分割和清理;启用自我QA模式
  3. 将索引方法设置为混合检索
  4. 等待完成

✔️预期行为

  • 无响应*

❌实际行为

在执行命中测试时,它返回 Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}]

sigwle7e

sigwle7e1#

请提供您的嵌入模型和VDB名称,如果可能的话,请附上您的错误日志。谢谢!

suzh9iv8

suzh9iv82#

感谢您的回复。嵌入模型是来自OpenAI的text-embedding-3-large。如何检查vdb名称?
执行命中测试时,容器api的日志为:

ERROR:root:Hit testing failed.
Traceback (most recent call last):
  File "/app/api/controllers/console/datasets/hit_testing.py", line 56, in post
    response = HitTestingService.retrieve(
  File "/app/api/services/hit_testing_service.py", line 58, in retrieve
    all_documents = RetrievalService.retrieve(retrival_method=retrieval_model['search_method'],
  File "/app/api/core/rag/datasource/retrieval_service.py", line 86, in retrieve
    raise Exception(exception_message)
Exception: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}];
Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}]
ERROR:app:Exception on /console/api/datasets/38f171a7-1173-490c-b285-e5c59efad2a5/hit-testing [POST]
Traceback (most recent call last):
  File "/app/api/controllers/console/datasets/hit_testing.py", line 56, in post
    response = HitTestingService.retrieve(
  File "/app/api/services/hit_testing_service.py", line 58, in retrieve
    all_documents = RetrievalService.retrieve(retrival_method=retrieval_model['search_method'],
  File "/app/api/core/rag/datasource/retrieval_service.py", line 86, in retrieve
    raise Exception(exception_message)
Exception: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}];
Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/app/api/controllers/console/setup.py", line 86, in decorated
    return view(*args, **kwargs)
  File "/app/api/libs/login.py", line 91, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/api/controllers/console/wraps.py", line 21, in decorated
    return view(*args, **kwargs)
  File "/app/api/controllers/console/datasets/hit_testing.py", line 83, in post
    raise InternalServerError(str(e))
werkzeug.exceptions.InternalServerError: 500 Internal Server Error: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}];
Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_38f171a7_1173_490c_b285_e5c59efad2a5_Node" on type "GetObjectsObj". Did you mean "Vector_index_78ed1ca9_15c0_4fff_8995_d8632964e0a6_Node" or "Vector_index_a37b9418_81e7_43d2_9f0d_11088ccc82e5_Node"?', 'path': None}]
tktrz96b

tktrz96b3#

我遇到了相同的错误,日志如下:
Traceback (most recent call last): File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/local/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/app/api/core/rag/datasource/retrieval_service.py", line 121, in embedding_search documents = vector.search_by_vector( File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 226, in search_by_vector return self._vector_processor.search_by_vector(query_vector, **kwargs) File "/app/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py", line 194, in search_by_vector raise ValueError(f"Error during query: {result['errors']}") ValueError: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_022c31c8_78db_4366_afac_d70a6fdfad3b_Node" on type "GetObjectsObj". Did you mean "Vector_index_e494c3c2_8dab_4448_877d_52ab4bba51c4_Node"?', 'path': None}] Exception in thread Thread-153 (embedding_search):
尽管错误几乎相同,但日志内容不同。大约一个小时后,系统自动修复了。我想知道这是怎么回事。
谢谢!

suzh9iv8

suzh9iv84#

使用Weaviate

API错误日志

ERROR:app:Exception on /console/api/datasets/4783a214-77f6-4c08-b906-985e764bd2ff/hit-testing [POST]
Traceback (most recent call last):
  File "/app/api/controllers/console/datasets/hit_testing.py", line 56, in post
    response = HitTestingService.retrieve(
  File "/app/api/services/hit_testing_service.py", line 58, in retrieve
    all_documents = RetrievalService.retrieve(retrival_method=retrieval_model['search_method'],
  File "/app/api/core/rag/datasource/retrieval_service.py", line 86, in retrieve
    raise Exception(exception_message)
Exception: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_4783a214_77f6_4c08_b906_985e764bd2ff_Node" on type "GetObjectsObj". Did you mean "Vector_index_7b33c44a_cf66_410c_b741_9d366eef0d6f_Node", "Vector_index_05be79ff_47f2_40d8_a320_4e8e4b126e5a_Node", "Vector_index_b8c0a266_8213_4c78_a8d7_de611697c079_Node", "Vector_index_e83fd1c5_742d_4943_ba91_57f151842dba_Node", or "Vector_index_923a570d_7d35_46be_99bf_40fe48b875da_Node"?', 'path': None}];
Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_4783a214_77f6_4c08_b906_985e764bd2ff_Node" on type "GetObjectsObj". Did you mean "Vector_index_b8c0a266_8213_4c78_a8d7_de611697c079_Node", "Vector_index_7b33c44a_cf66_410c_b741_9d366eef0d6f_Node", "Vector_index_05be79ff_47f2_40d8_a320_4e8e4b126e5a_Node", "Vector_index_e83fd1c5_742d_4943_ba91_57f151842dba_Node", or "Vector_index_923a570d_7d35_46be_99bf_40fe48b875da_Node"?', 'path': None}]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/app/api/controllers/console/setup.py", line 86, in decorated
    return view(*args, **kwargs)
  File "/app/api/libs/login.py", line 91, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/api/controllers/console/wraps.py", line 21, in decorated
    return view(*args, **kwargs)
  File "/app/api/controllers/console/datasets/hit_testing.py", line 83, in post
    raise InternalServerError(str(e))
werkzeug.exceptions.InternalServerError: 500 Internal Server Error: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_4783a214_77f6_4c08_b906_985e764bd2ff_Node" on type "GetObjectsObj". Did you mean "Vector_index_7b33c44a_cf66_410c_b741_9d366eef0d6f_Node", "Vector_index_05be79ff_47f2_40d8_a320_4e8e4b126e5a_Node", "Vector_index_b8c0a266_8213_4c78_a8d7_de611697c079_Node", "Vector_index_e83fd1c5_742d_4943_ba91_57f151842dba_Node", or "Vector_index_923a570d_7d35_46be_99bf_40fe48b875da_Node"?', 'path': None}];
Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'Cannot query field "Vector_index_4783a214_77f6_4c08_b906_985e764bd2ff_Node" on type "GetObjectsObj". Did you mean "Vector_index_b8c0a266_8213_4c78_a8d7_de611697c079_Node", "Vector_index_7b33c44a_cf66_410c_b741_9d366eef0d6f_Node", "Vector_index_05be79ff_47f2_40d8_a320_4e8e4b126e5a_Node", "Vector_index_e83fd1c5_742d_4943_ba91_57f151842dba_Node", or "Vector_index_923a570d_7d35_46be_99bf_40fe48b875da_Node"?', 'path': None}]

但是Weaviate没有错误

xxhby3vn

xxhby3vn5#

当更改嵌入方法时,出现相同的错误,恢复到旧的嵌入也无法修复错误。

c7rzv4ha

c7rzv4ha6#

vdb: Weaviate
步骤:将text-embedding-ada-002更改为text-embedding-3-large

我们遇到了相同的错误,使用vdb Weaviate发现在切换到embedding_model后,之前模型的索引数据会被删除。

我们的猜测是:

DatasetService. Update_dataset (dataset_id, data, user) 在更改模型后会将以下操作更改为更新类型。在执行deal_dataset_vector_index_task之后,系统会在检查更新类型是否正确后清除索引并创建一个新索引。因此,不同模型中的旧索引被删除,导致查询失败。

代码如下:

Update_dataset:
if data['embedding_model_provider'] != dataset.embedding_model_provider or \ data['embedding_model'] != dataset.embedding_model: action = 'update'
deal_dataset_vector_index_task:
elif action == 'update': # clean index index_processor.clean(dataset, None, with_keywords=False)
请告诉我发生了什么。谢谢。

相关问题