An error occurs during migration of the vector database #11239

Closed
opened 2026-02-21 18:57:19 -05:00 by yindo · 0 comments
Owner

Originally created by @naotama2002 on GitHub (Mar 16, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Run Migrate Weaviate to another vector database
ref. https://docs.dify.ai/learn-more/faq/install-faq#id-17.-migrate-weaviate-to-another-vector-database

1. weaviate is used as a vector database

.env

VECTOR_STORE=weaviate

2. Change to pgvector

.env

VECTOR_STORE=pgvector

3. Migration Preparation

Modification to run weaviate and pgvector simultaneously

diff docker-compose.yaml
Image

4. docker compose run

docker compose up -d

5. Migration implementation

docker exec -it docker-api-1 flask vdb-migrate

✔️ Expected Behavior

No errors occur in Migration.

Actual Behavior

An error occurs in AttributeError: type object 'App' has no attribute 'query'

Starting annotation data migration.
Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 148, in vdb_migrate
    migrate_annotation_vector_database()
  File "/app/api/commands.py", line 164, in migrate_annotation_vector_database
    App.query.filter(App.status == "normal")
    ^^^^^^^^^
AttributeError: type object 'App' has no attribute 'query'
Originally created by @naotama2002 on GitHub (Mar 16, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Run Migrate Weaviate to another vector database ref. https://docs.dify.ai/learn-more/faq/install-faq#id-17.-migrate-weaviate-to-another-vector-database #### 1. weaviate is used as a vector database .env ``` VECTOR_STORE=weaviate ``` #### 2. Change to pgvector .env ``` VECTOR_STORE=pgvector ``` #### 3. Migration Preparation Modification to run weaviate and pgvector simultaneously diff docker-compose.yaml ![Image](https://github.com/user-attachments/assets/6b988fa2-8e55-4098-b2a3-828cfb61447f) #### 4. docker compose run ``` docker compose up -d ``` #### 5. Migration implementation ``` docker exec -it docker-api-1 flask vdb-migrate ``` ### ✔️ Expected Behavior No errors occur in Migration. ### ❌ Actual Behavior An error occurs in AttributeError: type object 'App' has no attribute 'query' ``` Starting annotation data migration. Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 148, in vdb_migrate migrate_annotation_vector_database() File "/app/api/commands.py", line 164, in migrate_annotation_vector_database App.query.filter(App.status == "normal") ^^^^^^^^^ AttributeError: type object 'App' has no attribute 'query' ```
yindo added the 🐞 bug👻 feat:rag labels 2026-02-21 18:57:19 -05:00
yindo closed this issue 2026-02-21 18:57:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11239