QA splitting is not available in 0.3.13 #385

Closed
opened 2026-02-21 17:27:00 -05:00 by yindo · 3 comments
Owner

Originally created by @caolixiang on GitHub (Aug 15, 2023).

Originally assigned to: @JohnJyong on GitHub.

Dify version: Self Host

Steps To Reproduce

docker-woker-1's logs

  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__
    key = self.scopefunc()
  File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id
    return id(app_ctx._get_current_object()) # type: ignore[attr-defined]
  File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
[2023-08-15 10:09:59,262: ERROR/MainProcess] Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 539, in format_qa_document
    response = LLMGenerator.generate_qa_document(tenant_id, document_node.page_content)
  File "/app/api/core/generator/llm_generator.py", line 181, in generate_qa_document
    model_instance = ModelFactory.get_text_generation_model(
  File "/app/api/core/model_providers/model_factory.py", line 63, in get_text_generation_model
    default_model = cls.get_default_model(tenant_id, ModelType.TEXT_GENERATION)
  File "/app/api/core/model_providers/model_factory.py", line 213, in get_default_model
    default_model = db.session.query(TenantDefaultModel) \
  File "<string>", line 2, in query
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py", line 24, in _proxied
    return self.registry()
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__
    key = self.scopefunc()
  File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id
    return id(app_ctx._get_current_object()) # type: ignore[attr-defined]
  File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
[2023-08-15 10:09:59,262: ERROR/MainProcess] Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 539, in format_qa_document
    response = LLMGenerator.generate_qa_document(tenant_id, document_node.page_content)
  File "/app/api/core/generator/llm_generator.py", line 181, in generate_qa_document
    model_instance = ModelFactory.get_text_generation_model(
  File "/app/api/core/model_providers/model_factory.py", line 63, in get_text_generation_model
    default_model = cls.get_default_model(tenant_id, ModelType.TEXT_GENERATION)
  File "/app/api/core/model_providers/model_factory.py", line 213, in get_default_model
    default_model = db.session.query(TenantDefaultModel) \
  File "<string>", line 2, in query
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py", line 24, in _proxied
    return self.registry()
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__
    key = self.scopefunc()
  File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id
    return id(app_ctx._get_current_object()) # type: ignore[attr-defined]
  File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
[2023-08-15 10:09:59,418: INFO/MainProcess] Processed dataset: 13e2a5bb-4ba7-46bd-9a27-1f50ccf6ad3b latency: 10.903124813000431
[2023-08-15 10:09:59,425: INFO/MainProcess] Task tasks.document_indexing_task.document_indexing_task[e109f773-cfce-4b93-9b44-cea3ecaa35b6] succeeded in 10.910252552000202s: None
[2023-08-15 10:27:43,699: INFO/MainProcess] Task tasks.clean_dataset_task.clean_dataset_task[c1ab6b9c-2782-4fe7-8060-2e01adaf71cc] received
[2023-08-15 10:27:43,700: INFO/MainProcess] Start clean dataset when dataset deleted: 13e2a5bb-4ba7-46bd-9a27-1f50ccf6ad3b
[2023-08-15 10:27:43,753: ERROR/MainProcess] Delete doc index failed when dataset deleted.
Traceback (most recent call last):
  File "/app/api/tasks/clean_dataset_task.py", line 44, in clean_dataset_task
    vector_index.delete()
  File "/app/api/core/index/vector_index/base.py", line 117, in delete
    vector_store.delete()
  File "/app/api/core/vector_store/weaviate_vector_store.py", line 38, in delete
    self._client.schema.delete_class(self._index_name)
  File "/usr/local/lib/python3.10/site-packages/weaviate/schema/crud_schema.py", line 219, in delete_class
    raise UnexpectedStatusCodeException("Delete class from schema", response)

The current behavior

Not Successful

The expected behavior

Documents can be embedded with QA model.

Originally created by @caolixiang on GitHub (Aug 15, 2023). Originally assigned to: @JohnJyong on GitHub. <!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant Dify packages to make sure your issue has not already been fixed. --> Dify version: Self Host ## Steps To Reproduce <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than Dify. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> docker-woker-1's logs ``` File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__ key = self.scopefunc() File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id return id(app_ctx._get_current_object()) # type: ignore[attr-defined] File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object raise RuntimeError(unbound_message) from None RuntimeError: Working outside of application context. This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information. [2023-08-15 10:09:59,262: ERROR/MainProcess] Working outside of application context. This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information. Traceback (most recent call last): File "/app/api/core/indexing_runner.py", line 539, in format_qa_document response = LLMGenerator.generate_qa_document(tenant_id, document_node.page_content) File "/app/api/core/generator/llm_generator.py", line 181, in generate_qa_document model_instance = ModelFactory.get_text_generation_model( File "/app/api/core/model_providers/model_factory.py", line 63, in get_text_generation_model default_model = cls.get_default_model(tenant_id, ModelType.TEXT_GENERATION) File "/app/api/core/model_providers/model_factory.py", line 213, in get_default_model default_model = db.session.query(TenantDefaultModel) \ File "<string>", line 2, in query File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py", line 24, in _proxied return self.registry() File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__ key = self.scopefunc() File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id return id(app_ctx._get_current_object()) # type: ignore[attr-defined] File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object raise RuntimeError(unbound_message) from None RuntimeError: Working outside of application context. This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information. [2023-08-15 10:09:59,262: ERROR/MainProcess] Working outside of application context. This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information. Traceback (most recent call last): File "/app/api/core/indexing_runner.py", line 539, in format_qa_document response = LLMGenerator.generate_qa_document(tenant_id, document_node.page_content) File "/app/api/core/generator/llm_generator.py", line 181, in generate_qa_document model_instance = ModelFactory.get_text_generation_model( File "/app/api/core/model_providers/model_factory.py", line 63, in get_text_generation_model default_model = cls.get_default_model(tenant_id, ModelType.TEXT_GENERATION) File "/app/api/core/model_providers/model_factory.py", line 213, in get_default_model default_model = db.session.query(TenantDefaultModel) \ File "<string>", line 2, in query File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py", line 24, in _proxied return self.registry() File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 1006, in __call__ key = self.scopefunc() File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id return id(app_ctx._get_current_object()) # type: ignore[attr-defined] File "/usr/local/lib/python3.10/site-packages/werkzeug/local.py", line 508, in _get_current_object raise RuntimeError(unbound_message) from None RuntimeError: Working outside of application context. This typically means that you attempted to use functionality that needed the current application. To solve this, set up an application context with app.app_context(). See the documentation for more information. [2023-08-15 10:09:59,418: INFO/MainProcess] Processed dataset: 13e2a5bb-4ba7-46bd-9a27-1f50ccf6ad3b latency: 10.903124813000431 [2023-08-15 10:09:59,425: INFO/MainProcess] Task tasks.document_indexing_task.document_indexing_task[e109f773-cfce-4b93-9b44-cea3ecaa35b6] succeeded in 10.910252552000202s: None [2023-08-15 10:27:43,699: INFO/MainProcess] Task tasks.clean_dataset_task.clean_dataset_task[c1ab6b9c-2782-4fe7-8060-2e01adaf71cc] received [2023-08-15 10:27:43,700: INFO/MainProcess] Start clean dataset when dataset deleted: 13e2a5bb-4ba7-46bd-9a27-1f50ccf6ad3b [2023-08-15 10:27:43,753: ERROR/MainProcess] Delete doc index failed when dataset deleted. Traceback (most recent call last): File "/app/api/tasks/clean_dataset_task.py", line 44, in clean_dataset_task vector_index.delete() File "/app/api/core/index/vector_index/base.py", line 117, in delete vector_store.delete() File "/app/api/core/vector_store/weaviate_vector_store.py", line 38, in delete self._client.schema.delete_class(self._index_name) File "/usr/local/lib/python3.10/site-packages/weaviate/schema/crud_schema.py", line 219, in delete_class raise UnexpectedStatusCodeException("Delete class from schema", response) ``` ## The current behavior Not Successful ## The expected behavior Documents can be embedded with QA model.
yindo closed this issue 2026-02-21 17:27:00 -05:00
Author
Owner

@icowan commented on GitHub (Aug 15, 2023):

遇到了同样的问题

@icowan commented on GitHub (Aug 15, 2023): 遇到了同样的问题
Author
Owner

@JohnJyong commented on GitHub (Aug 16, 2023):

We will fix this issue as soon as possible, thank you for using our service.

@JohnJyong commented on GitHub (Aug 16, 2023): We will fix this issue as soon as possible, thank you for using our service.
Author
Owner

@ZPerling commented on GitHub (Aug 23, 2023):

0.3.14 still has the same problem, is it solved?

@ZPerling commented on GitHub (Aug 23, 2023): 0.3.14 still has the same problem, is it solved?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#385