`poetry run flask migrate-data-for-plugin` failed when upgrade from 0.15.3 to 1.0.0
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
upgrade from 0.15.3 to 1.0.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I tried to upgrade the existed 0.15.3 to 1.0.0, and I followed the instructions on https://github.com/langgenius/dify/releases/tag/1.0.0, and when executed poetry run flask migrate-data-for-plugin, it shown the following errors.
Details
root@42c3ebc37e69:/app/api# poetry run flask db upgrade
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
root@42c3ebc37e69:/app/api# poetry run flask migrate-data-for-plugin
2025-03-03 00:28:14.824 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 32 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-03 00:28:14.824 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Starting migrate data for plugin.
Migrating [providers] data for plugin
[1] Migrating [providers] 56250ab7-9b3a-42c6-a8ac-a6f4ed5e8716 (siliconflow)
[1] Migrated [providers] 56250ab7-9b3a-42c6-a8ac-a6f4ed5e8716 (siliconflow)
[2] Migrating [providers] b94a3442-b5de-4d25-80a0-ce33a87ab28a (tongyi)
[2] Migrated [providers] b94a3442-b5de-4d25-80a0-ce33a87ab28a (tongyi)
Migrate [providers] data for plugin completed, total: 2
Migrating [provider_models] data for plugin
[1] Migrating [provider_models] 95ae1ac8-e2c7-4dce-90b7-8afe8f7e6469 (ollama)
[1] Migrated [provider_models] 95ae1ac8-e2c7-4dce-90b7-8afe8f7e6469 (ollama)
[2] Migrating [provider_models] b2c7c783-ba4f-41d8-ae98-4b9d22d87413 (ollama)
[2] Migrated [provider_models] b2c7c783-ba4f-41d8-ae98-4b9d22d87413 (ollama)
[3] Migrating [provider_models] 92d1febb-a10a-440e-bb2b-453ee82884f8 (ollama)
[3] Migrated [provider_models] 92d1febb-a10a-440e-bb2b-453ee82884f8 (ollama)
[4] Migrating [provider_models] 57b9904e-8f17-4bdf-9089-59b4572bd20d (ollama)
[4] Migrated [provider_models] 57b9904e-8f17-4bdf-9089-59b4572bd20d (ollama)
[5] Migrating [provider_models] 16973b9f-64ac-4a09-b14a-c5bc969425e9 (ollama)
[5] Migrated [provider_models] 16973b9f-64ac-4a09-b14a-c5bc969425e9 (ollama)
[6] Migrating [provider_models] 58376e34-081e-4631-b956-8b799d9eabe3 (siliconflow)
[6] Migrated [provider_models] 58376e34-081e-4631-b956-8b799d9eabe3 (siliconflow)
[7] Migrating [provider_models] 8047a64f-9d84-4718-8c75-0cdf1a864e74 (siliconflow)
[7] Migrated [provider_models] 8047a64f-9d84-4718-8c75-0cdf1a864e74 (siliconflow)
[8] Migrating [provider_models] 5a4434bc-681f-4a15-99aa-d097467582ba (volcengine_maas)
[8] Migrated [provider_models] 5a4434bc-681f-4a15-99aa-d097467582ba (volcengine_maas)
[9] Migrating [provider_models] 2ff73f1a-fc11-441e-b89e-70625a9665a7 (volcengine_maas)
[9] Migrated [provider_models] 2ff73f1a-fc11-441e-b89e-70625a9665a7 (volcengine_maas)
[10] Migrating [provider_models] 0864a735-0808-47ec-a042-c6890f1eb800 (volcengine_maas)
[10] Migrated [provider_models] 0864a735-0808-47ec-a042-c6890f1eb800 (volcengine_maas)
[11] Migrating [provider_models] ea7ab951-5a11-482f-bc38-7d3d8eb0e312 (volcengine_maas)
[11] Migrated [provider_models] ea7ab951-5a11-482f-bc38-7d3d8eb0e312 (volcengine_maas)
[12] Migrating [provider_models] 055e088d-15dd-4f33-85c4-f0e7c5ae2cb6 (volcengine_maas)
[12] Migrated [provider_models] 055e088d-15dd-4f33-85c4-f0e7c5ae2cb6 (volcengine_maas)
[13] Migrating [provider_models] c4a99f94-1694-4813-93dd-6aab15775c25 (tongyi)
[13] Migrated [provider_models] c4a99f94-1694-4813-93dd-6aab15775c25 (tongyi)
[14] Migrating [provider_models] 710c70e2-4611-443d-b855-bc3a0cefeacc (tongyi)
[14] Migrated [provider_models] 710c70e2-4611-443d-b855-bc3a0cefeacc (tongyi)
[15] Migrating [provider_models] 01716896-bb53-4b25-872d-8cb8adeaf616 (tongyi)
[15] Migrated [provider_models] 01716896-bb53-4b25-872d-8cb8adeaf616 (tongyi)
[16] Migrating [provider_models] af1403ba-5d55-4752-b11d-44214c52e89a (tongyi)
[16] Migrated [provider_models] af1403ba-5d55-4752-b11d-44214c52e89a (tongyi)
[17] Migrating [provider_models] 6fbc0f80-996c-4afa-9110-2f7ca7c8c97b (tongyi)
[17] Migrated [provider_models] 6fbc0f80-996c-4afa-9110-2f7ca7c8c97b (tongyi)
[18] Migrating [provider_models] 8f466883-6754-43e8-8e13-609d50cff472 (tongyi)
[18] Migrated [provider_models] 8f466883-6754-43e8-8e13-609d50cff472 (tongyi)
[19] Migrating [provider_models] 986c368b-690a-466d-a10c-16358bd5ca9b (tongyi)
[19] Migrated [provider_models] 986c368b-690a-466d-a10c-16358bd5ca9b (tongyi)
[20] Migrating [provider_models] 3359467e-3c3b-45d4-954e-d6c3509e5bd5 (tongyi)
[20] Migrated [provider_models] 3359467e-3c3b-45d4-954e-d6c3509e5bd5 (tongyi)
Migrate [provider_models] data for plugin completed, total: 20
Migrating [provider_orders] data for plugin
Migrate [provider_orders] data for plugin completed, total: 0
Migrating [tenant_default_models] data for plugin
[1] Migrating [tenant_default_models] 86c3bcd4-8b79-4b68-998a-9056d08fb730 (ollama)
[1] Migrated [tenant_default_models] 86c3bcd4-8b79-4b68-998a-9056d08fb730 (ollama)
[2] Migrating [tenant_default_models] 6f1c73e7-685a-4570-948f-ef93d99dba2f (siliconflow)
[2] Migrated [tenant_default_models] 6f1c73e7-685a-4570-948f-ef93d99dba2f (siliconflow)
[3] Migrating [tenant_default_models] 8776ba34-d9ec-4c26-bd38-15e7d6c5f6ff (siliconflow)
[3] Migrated [tenant_default_models] 8776ba34-d9ec-4c26-bd38-15e7d6c5f6ff (siliconflow)
[4] Migrating [tenant_default_models] 42e47afc-f48d-49b2-94b1-0c27504d6929 (siliconflow)
[4] Migrated [tenant_default_models] 42e47afc-f48d-49b2-94b1-0c27504d6929 (siliconflow)
[5] Migrating [tenant_default_models] d3bfd6d0-d5a0-4baf-b45e-53ff95807df3 (volcengine_maas)
[5] Migrated [tenant_default_models] d3bfd6d0-d5a0-4baf-b45e-53ff95807df3 (volcengine_maas)
Migrate [tenant_default_models] data for plugin completed, total: 5
Migrating [tenant_preferred_model_providers] data for plugin
Migrate [tenant_preferred_model_providers] data for plugin completed, total: 0
Migrating [provider_model_settings] data for plugin
[1] Migrating [provider_model_settings] db2588ee-2e1e-433d-b813-8b85df9b82e3 (ollama)
[1] Migrated [provider_model_settings] db2588ee-2e1e-433d-b813-8b85df9b82e3 (ollama)
[2] Migrating [provider_model_settings] 4f314f2d-e3cc-4a3b-b50e-5c67dc0ebd6a (ollama)
[2] Migrated [provider_model_settings] 4f314f2d-e3cc-4a3b-b50e-5c67dc0ebd6a (ollama)
[3] Migrating [provider_model_settings] ad59dc30-ee9b-44e6-843f-fb5cd17eee74 (ollama)
[3] Migrated [provider_model_settings] ad59dc30-ee9b-44e6-843f-fb5cd17eee74 (ollama)
[4] Migrating [provider_model_settings] 87e34aa9-7a7b-4cef-9bbc-dccf4633422f (ollama)
[4] Migrated [provider_model_settings] 87e34aa9-7a7b-4cef-9bbc-dccf4633422f (ollama)
[5] Migrating [provider_model_settings] a1779d3b-bdd6-41b8-ac93-2bf1e88e47f5 (ollama)
[5] Migrated [provider_model_settings] a1779d3b-bdd6-41b8-ac93-2bf1e88e47f5 (ollama)
[6] Migrating [provider_model_settings] a79ea5aa-4b92-43bb-9814-a4b00d624ed5 (siliconflow)
[6] Migrated [provider_model_settings] a79ea5aa-4b92-43bb-9814-a4b00d624ed5 (siliconflow)
[7] Migrating [provider_model_settings] 362cfee6-4850-4184-be5a-aafd70d4253e (siliconflow)
[7] Migrated [provider_model_settings] 362cfee6-4850-4184-be5a-aafd70d4253e (siliconflow)
[8] Migrating [provider_model_settings] cb1d9056-0e85-462c-aff3-cef8ec6c2b83 (siliconflow)
[8] Migrated [provider_model_settings] cb1d9056-0e85-462c-aff3-cef8ec6c2b83 (siliconflow)
[9] Migrating [provider_model_settings] a8cd3fb7-b7df-4258-9a57-3f09fb110b04 (siliconflow)
[9] Migrated [provider_model_settings] a8cd3fb7-b7df-4258-9a57-3f09fb110b04 (siliconflow)
[10] Migrating [provider_model_settings] e0f20059-bb25-4872-a82d-fc93ed81fc92 (siliconflow)
[10] Migrated [provider_model_settings] e0f20059-bb25-4872-a82d-fc93ed81fc92 (siliconflow)
[11] Migrating [provider_model_settings] 4f81c522-debd-4413-a538-173fc4c0cf18 (siliconflow)
[11] Migrated [provider_model_settings] 4f81c522-debd-4413-a538-173fc4c0cf18 (siliconflow)
[12] Migrating [provider_model_settings] 2f4840f4-8f89-4c32-984b-55972293cab6 (siliconflow)
[12] Migrated [provider_model_settings] 2f4840f4-8f89-4c32-984b-55972293cab6 (siliconflow)
[13] Migrating [provider_model_settings] ccb657c3-4330-4d84-bd9f-52800e941556 (siliconflow)
[13] Migrated [provider_model_settings] ccb657c3-4330-4d84-bd9f-52800e941556 (siliconflow)
[14] Migrating [provider_model_settings] e4c4f22e-17f2-4e82-bafe-342caae77903 (siliconflow)
[14] Migrated [provider_model_settings] e4c4f22e-17f2-4e82-bafe-342caae77903 (siliconflow)
[15] Migrating [provider_model_settings] 4f65e134-c987-4b4e-8e2a-395f2fb1058d (siliconflow)
[15] Migrated [provider_model_settings] 4f65e134-c987-4b4e-8e2a-395f2fb1058d (siliconflow)
[16] Migrating [provider_model_settings] d6d43b67-e300-4720-9310-f42dac6287a5 (siliconflow)
[16] Migrated [provider_model_settings] d6d43b67-e300-4720-9310-f42dac6287a5 (siliconflow)
[17] Migrating [provider_model_settings] 7a64726f-5b2f-4878-921e-8431cd432018 (siliconflow)
[17] Migrated [provider_model_settings] 7a64726f-5b2f-4878-921e-8431cd432018 (siliconflow)
[18] Migrating [provider_model_settings] 7ce0dc4a-3f3a-4130-946a-8e7206c6ab38 (siliconflow)
[18] Migrated [provider_model_settings] 7ce0dc4a-3f3a-4130-946a-8e7206c6ab38 (siliconflow)
[19] Migrating [provider_model_settings] 0540b7c5-efa4-4071-b9e3-b63385bc09b0 (siliconflow)
[19] Migrated [provider_model_settings] 0540b7c5-efa4-4071-b9e3-b63385bc09b0 (siliconflow)
[20] Migrating [provider_model_settings] 70d39aa2-8d2b-42cc-9610-8d9d737c386e (siliconflow)
[20] Migrated [provider_model_settings] 70d39aa2-8d2b-42cc-9610-8d9d737c386e (siliconflow)
[21] Migrating [provider_model_settings] c7c0c0f1-4d92-479c-aeca-d45afad6b60c (siliconflow)
[21] Migrated [provider_model_settings] c7c0c0f1-4d92-479c-aeca-d45afad6b60c (siliconflow)
[22] Migrating [provider_model_settings] 009420de-110b-44ef-af78-fa9559f28662 (siliconflow)
[22] Migrated [provider_model_settings] 009420de-110b-44ef-af78-fa9559f28662 (siliconflow)
[23] Migrating [provider_model_settings] d8a76bf8-a5fa-4101-bf06-ea016031cf09 (siliconflow)
[23] Migrated [provider_model_settings] d8a76bf8-a5fa-4101-bf06-ea016031cf09 (siliconflow)
[24] Migrating [provider_model_settings] 809663e1-8f4e-48bb-bb17-c84530a3c76c (siliconflow)
[24] Migrated [provider_model_settings] 809663e1-8f4e-48bb-bb17-c84530a3c76c (siliconflow)
[25] Migrating [provider_model_settings] e4080e09-88f7-43fe-a60b-ede834ebdfda (siliconflow)
[25] Migrated [provider_model_settings] e4080e09-88f7-43fe-a60b-ede834ebdfda (siliconflow)
[26] Migrating [provider_model_settings] 31b75586-fe60-4773-8068-17fa06b0cd5d (siliconflow)
[26] Migrated [provider_model_settings] 31b75586-fe60-4773-8068-17fa06b0cd5d (siliconflow)
[27] Migrating [provider_model_settings] b671ec2f-de72-43aa-8776-dcec1e61715c (siliconflow)
[27] Migrated [provider_model_settings] b671ec2f-de72-43aa-8776-dcec1e61715c (siliconflow)
[28] Migrating [provider_model_settings] 88546271-b483-4047-a8b8-cba0f3ce98bf (siliconflow)
[28] Migrated [provider_model_settings] 88546271-b483-4047-a8b8-cba0f3ce98bf (siliconflow)
[29] Migrating [provider_model_settings] b9b8a72a-d5f1-4b22-b380-cfa503f01a1c (siliconflow)
[29] Migrated [provider_model_settings] b9b8a72a-d5f1-4b22-b380-cfa503f01a1c (siliconflow)
[30] Migrating [provider_model_settings] 2687eafc-f9cd-4d1a-b080-fa902a0e2011 (siliconflow)
[30] Migrated [provider_model_settings] 2687eafc-f9cd-4d1a-b080-fa902a0e2011 (siliconflow)
[31] Migrating [provider_model_settings] ce4147a8-be93-4e24-8bfc-85a3b2fab719 (siliconflow)
[31] Migrated [provider_model_settings] ce4147a8-be93-4e24-8bfc-85a3b2fab719 (siliconflow)
[32] Migrating [provider_model_settings] 005e923d-352a-432a-89d2-e2ea1c6c5131 (siliconflow)
[32] Migrated [provider_model_settings] 005e923d-352a-432a-89d2-e2ea1c6c5131 (siliconflow)
[33] Migrating [provider_model_settings] 856bf8e8-f763-49a1-86f5-b71f2df2edf3 (siliconflow)
[33] Migrated [provider_model_settings] 856bf8e8-f763-49a1-86f5-b71f2df2edf3 (siliconflow)
[34] Migrating [provider_model_settings] 21e78472-2036-4817-8251-04e1ef48c2ac (siliconflow)
[34] Migrated [provider_model_settings] 21e78472-2036-4817-8251-04e1ef48c2ac (siliconflow)
[35] Migrating [provider_model_settings] c0a336c4-1054-4887-ac64-97debf59c3e2 (siliconflow)
[35] Migrated [provider_model_settings] c0a336c4-1054-4887-ac64-97debf59c3e2 (siliconflow)
[36] Migrating [provider_model_settings] ea20c4e7-84f7-44e2-a65a-22762ad9c0f5 (siliconflow)
[36] Migrated [provider_model_settings] ea20c4e7-84f7-44e2-a65a-22762ad9c0f5 (siliconflow)
[37] Migrating [provider_model_settings] fea510c2-d7e1-46be-915a-d94b9bfd4744 (siliconflow)
[37] Migrated [provider_model_settings] fea510c2-d7e1-46be-915a-d94b9bfd4744 (siliconflow)
[38] Migrating [provider_model_settings] 3cc4093b-a8e9-4367-9d8d-2c2b0942df88 (siliconflow)
[38] Migrated [provider_model_settings] 3cc4093b-a8e9-4367-9d8d-2c2b0942df88 (siliconflow)
[39] Migrating [provider_model_settings] 3edf3e31-2158-4425-8f56-83cac40992b7 (siliconflow)
[39] Migrated [provider_model_settings] 3edf3e31-2158-4425-8f56-83cac40992b7 (siliconflow)
[40] Migrating [provider_model_settings] 953440df-558c-4f92-945a-121f9d91d1fe (siliconflow)
[40] Migrated [provider_model_settings] 953440df-558c-4f92-945a-121f9d91d1fe (siliconflow)
[41] Migrating [provider_model_settings] a2f6f746-60ad-4f02-925a-030b17313976 (siliconflow)
[41] Migrated [provider_model_settings] a2f6f746-60ad-4f02-925a-030b17313976 (siliconflow)
[42] Migrating [provider_model_settings] aac2936d-0ed3-403f-8c27-19c1dc3c9317 (siliconflow)
[42] Migrated [provider_model_settings] aac2936d-0ed3-403f-8c27-19c1dc3c9317 (siliconflow)
[43] Migrating [provider_model_settings] 003032f9-b420-4de4-b512-95d6d22f8712 (volcengine_maas)
[43] Migrated [provider_model_settings] 003032f9-b420-4de4-b512-95d6d22f8712 (volcengine_maas)
[44] Migrating [provider_model_settings] 28a3676c-ff9b-4adf-a457-8ce397eee7e0 (siliconflow)
[44] Migrated [provider_model_settings] 28a3676c-ff9b-4adf-a457-8ce397eee7e0 (siliconflow)
[45] Migrating [provider_model_settings] e64a97ed-b023-42cb-8186-b5f860852c40 (siliconflow)
[45] Migrated [provider_model_settings] e64a97ed-b023-42cb-8186-b5f860852c40 (siliconflow)
[46] Migrating [provider_model_settings] d58e4947-f482-4b94-8fa4-b0e9aa3066dc (volcengine_maas)
[46] Migrated [provider_model_settings] d58e4947-f482-4b94-8fa4-b0e9aa3066dc (volcengine_maas)
[47] Migrating [provider_model_settings] e56b3a4a-078f-4115-bbba-e59a86ace6ef (volcengine_maas)
[47] Migrated [provider_model_settings] e56b3a4a-078f-4115-bbba-e59a86ace6ef (volcengine_maas)
[48] Migrating [provider_model_settings] de8b2cfb-3610-4bd6-ab5e-e37c3c037177 (volcengine_maas)
[48] Migrated [provider_model_settings] de8b2cfb-3610-4bd6-ab5e-e37c3c037177 (volcengine_maas)
[49] Migrating [provider_model_settings] 53757e22-fef7-4fc8-8fb1-04e84c54cc22 (volcengine_maas)
[49] Migrated [provider_model_settings] 53757e22-fef7-4fc8-8fb1-04e84c54cc22 (volcengine_maas)
......
[110] Migrated [provider_model_settings] 17271f8c-aa6c-4a92-af52-531f4a63d4db (tongyi)
Migrate [provider_model_settings] data for plugin completed, total: 110
Migrating [load_balancing_model_configs] data for plugin
Migrate [load_balancing_model_configs] data for plugin completed, total: 0
Migrating [datasets] data for plugin
<class 'dict'>
[0] Migrating [datasets] ab7c217e-bdc4-42e7-9245-dd361104549f (volcengine_maas)
[0] Migrated [datasets] ab7c217e-bdc4-42e7-9245-dd361104549f (volcengine_maas)
Migrate [datasets] data for plugin completed, total: 1
Migrating [embeddings] data for plugin
[1] Migrating [embeddings] a068a2ac-0d9b-439c-b17c-c2f687415480 (volcengine_maas)
......
[292] Migrating [embeddings] 7d388ee1-8cd6-4efb-9aab-d3d6564dc868 (volcengine_maas)
[292] Migrated [embeddings] 7d388ee1-8cd6-4efb-9aab-d3d6564dc868 (volcengine_maas)
Migrate [embeddings] data for plugin completed, total: 292
Migrating [dataset_collection_bindings] data for plugin
[1] Migrating [dataset_collection_bindings] 88df7315-041a-4fd0-bc30-9730f73a1eb4 (volcengine_maas)
[1] Failed to migrate [dataset_collection_bindings] 88df7315-041a-4fd0-bc30-9730f73a1eb4 (volcengine_maas)
2025-03-03 00:28:40.621 ERROR [MainThread] [data_migration.py:175] - [1] Failed to migrate [dataset_collection_bindings] 88df7315-041a-4fd0-bc30-9730f73a1eb4 (volcengine_maas)
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(40)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/api/services/plugin/data_migration.py", line 160, in migrate_db_records
conn.execute(db.text(sql), {"record_id": record_id})
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
return meth(
^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DataError: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40)
[SQL: update dataset_collection_bindings
set provider_name =
concat('langgenius/', provider_name, '/', provider_name)
where id = %(record_id)s]
[parameters: {'record_id': '88df7315-041a-4fd0-bc30-9730f73a1eb4'}]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
✔️ Expected Behavior
No errors.
❌ Actual Behavior
poetry run flask migrate-data-for-plugin failed with some errors.
The error you're encountering is due to the provider_name field in the dataset_collection_bindings table exceeding its maximum length of 40 characters. The SQL update statement attempts to set provider_name to a concatenated value that exceeds this limit, causing a StringDataRightTruncation error.
To resolve this issue, you can increase the maximum length of the provider_name field. You can do this by executing the following SQL command:
ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
Here's how you can apply this change:
- Connect to your Docker database container:
docker exec -it docker-db-1 bash - Connect to the Dify database:
psql -d dify - Run the
ALTER TABLEcommand above. - Verify the change with:
\d dataset_collection_bindings;
This should allow the migration to proceed without errors [1][2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
After I upgrade to the 1.0.0, and installed Volcengine plugin, I can't view or modify the api key just like siliconflow plugin.
Is this a known problem?
升级到 1.0.0 并安装 Volcengine 插件后,我无法像 siliconflow 插件一样查看或修改 api 密钥。
这是一个已知问题吗?
现在全是这个问题,啥时候解决一下啊
I also encountered the same problem
The error you're encountering is due to the
provider_namefield in thedataset_collection_bindingstable exceeding its maximum length of 40 characters. The SQL update statement attempts to setprovider_nameto a concatenated value that exceeds this limit, causing aStringDataRightTruncationerror.To resolve this issue, you can increase the maximum length of the
provider_namefield. You can do this by executing the following SQL command:ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); Here's how you can apply this change:
- Connect to your Docker database container:
docker exec -it docker-db-1 bash- Connect to the Dify database:
psql -d dify- Run the
ALTER TABLEcommand above.- Verify the change with:
\d dataset_collection_bindings;This should allow the migration to proceed without errors [1][2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
这个方法貌似有用,我试了一下可以
I tried to alter the table and then restart the containers, but some mode keys are still missing like deepseek. I have to reinput/reconfigure them.
[root@ha-master-1 docker]# docker exec -it docker-db-1 bash
b33210e1fd6c:/# psql -d dify
psql (15.10)
Type "help" for help.
dify=# ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
ALTER TABLE
dify=# \d dataset_collection_bindings;
Table "public.dataset_collection_bindings"
Column | Type | Collation | Nullable | Default
-----------------+-----------------------------+-----------+----------+------------------------------
id | uuid | | not null | uuid_generate_v4()
provider_name | character varying(255) | | not null |
model_name | character varying(255) | | not null |
collection_name | character varying(64) | | not null |
created_at | timestamp without time zone | | not null | CURRENT_TIMESTAMP(0)
type | character varying(40) | | not null | 'dataset'::character varying
Indexes:
"dataset_collection_bindings_pkey" PRIMARY KEY, btree (id)
"provider_model_name_idx" btree (provider_name, model_name)
dify=# exit
b33210e1fd6c:/# exit
exit
[root@ha-master-1 docker]#
[root@ha-master-1 docker]# docker exec -it docker-api-1 bash
root@42c3ebc37e69:/app/api# poetry run flask migrate-data-for-plugin
2025-03-03 03:48:59.814 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 32 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-03 03:48:59.814 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
2025-03-03 03:49:03.038 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
Starting migrate data for plugin.
Migrating [providers] data for plugin
Migrate [providers] data for plugin completed, total: 0
Migrating [provider_models] data for plugin
Migrate [provider_models] data for plugin completed, total: 0
Migrating [provider_orders] data for plugin
Migrate [provider_orders] data for plugin completed, total: 0
Migrating [tenant_default_models] data for plugin
Migrate [tenant_default_models] data for plugin completed, total: 0
Migrating [tenant_preferred_model_providers] data for plugin
Migrate [tenant_preferred_model_providers] data for plugin completed, total: 0
Migrating [provider_model_settings] data for plugin
Migrate [provider_model_settings] data for plugin completed, total: 0
Migrating [load_balancing_model_configs] data for plugin
Migrate [load_balancing_model_configs] data for plugin completed, total: 0
Migrating [datasets] data for plugin
Migrate [datasets] data for plugin completed, total: 0
Migrating [embeddings] data for plugin
Migrate [embeddings] data for plugin completed, total: 0
Migrating [dataset_collection_bindings] data for plugin
[1] Migrating [dataset_collection_bindings] 88df7315-041a-4fd0-bc30-9730f73a1eb4 (volcengine_maas)
[1] Migrated [dataset_collection_bindings] 88df7315-041a-4fd0-bc30-9730f73a1eb4 (volcengine_maas)
Migrate [dataset_collection_bindings] data for plugin completed, total: 1
Migrating [tool_builtin_providers] data for plugin
Migrate [tool_builtin_providers] data for plugin completed, total: 0
Migrate data for plugin completed.
root@42c3ebc37e69:/app/api# exit
exit
[root@ha-master-1 docker]# docker compose restart
[+] Restarting 10/10
✔ Container docker-web-1 Started 11.1s
✔ Container docker-api-1 Started 3.7s
✔ Container docker-ssrf_proxy-1 Started 12.1s
✔ Container docker-weaviate-1 Started 1.3s
✔ Container docker-redis-1 Started 1.3s
✔ Container docker-db-1 Started 1.3s
✔ Container docker-sandbox-1 Started 1.1s
✔ Container docker-nginx-1 Started 12.5s
✔ Container docker-worker-1 Started 3.0s
✔ Container docker-plugin_daemon-1 Started 12.4s
[root@ha-master-1 docker]#
For me, I also encountered a similar problem. Finally, I turned on the TUN mode of the network proxy and let dify install the dependency package in the background. If you find that the bug caused by the 0.15.3 -> 1.0 version plug-in market can be solved by hanging the network proxy problem