value too long for type character varying(40) #8368

Closed
opened 2026-02-21 18:25:17 -05:00 by yindo · 15 comments
Owner

Originally created by @zzyyll2 on GitHub (Feb 18, 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.0-beta.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

my settings:
Image

Image

error log:
[SQL: INSERT INTO dataset_collection_bindings (provider_name, model_name, type, collection_name) VALUES (%(provider_name)s, %(model_name)s, %(type)s, %(collection_name)s) RETURNING dataset_collection_bindings.id, dataset_collection_bindings.created_at]
[parameters: {'provider_name': 'langgenius/openai_api_compatible/openai_api_compatible', 'model_name': 'text-embedding-3-small', 'type': 'dataset', 'collection_name': 'Vector_index_383d24b8_fe9f_4984_854f_78fc3be7e218_Node'}]
(Background on this error at: https://sqlalche.me/e/20/9h9h)

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @zzyyll2 on GitHub (Feb 18, 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.0-beta.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce my settings: ![Image](https://github.com/user-attachments/assets/87a2bbe2-ba82-4909-a32a-040c31ce0c3e) ![Image](https://github.com/user-attachments/assets/ebf062a2-88b4-4290-8624-4b48b675f14e) error log: [SQL: INSERT INTO dataset_collection_bindings (provider_name, model_name, type, collection_name) VALUES (%(provider_name)s, %(model_name)s, %(type)s, %(collection_name)s) RETURNING dataset_collection_bindings.id, dataset_collection_bindings.created_at] [parameters: {'provider_name': 'langgenius/openai_api_compatible/openai_api_compatible', 'model_name': 'text-embedding-3-small', 'type': 'dataset', 'collection_name': 'Vector_index_383d24b8_fe9f_4984_854f_78fc3be7e218_Node'}] (Background on this error at: https://sqlalche.me/e/20/9h9h) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:25:17 -05:00
yindo closed this issue 2026-02-21 18:25:17 -05:00
Author
Owner

@zzyyll2 commented on GitHub (Feb 18, 2025):

perhaps provider_name's value 'langgenius/openai_api_compatible/openai_api_compatible', it's length is 51 > 40
why the value is 'langgenius/openai_api_compatible/openai_api_compatible' not 'openai_api_compatible'?

@zzyyll2 commented on GitHub (Feb 18, 2025): perhaps provider_name's value 'langgenius/openai_api_compatible/openai_api_compatible', it's length is 51 > 40 why the value is 'langgenius/openai_api_compatible/openai_api_compatible' not 'openai_api_compatible'?
Author
Owner

@dosubot[bot] commented on GitHub (Feb 18, 2025):

Hey @zzyyll2! I'm here to help you with any bugs, questions, or contributions you have. Let's solve this together!

The error "value too long for type character varying(40)" is occurring because the provider_name column in the dataset_collection_bindings table is defined with a maximum length of 40 characters. The value 'langgenius/openai_api_compatible/openai_api_compatible' exceeds this limit with a length of 51 characters [1].

To resolve this, you should ensure that the database migration to increase the column length has been applied. There is a migration script that alters the provider_name column in the embeddings table to allow for longer values, but it seems this change might not have been applied to the dataset_collection_bindings table. You should check if there is a similar migration for this table or consider creating one to increase the column length to accommodate longer values [2].

If the migration has not been applied, follow the process for applying database migrations in the Dify platform. If you are using Docker, ensure the MIGRATION_ENABLED environment variable is set to true, and restart the services. If running from source, manually run flask db upgrade in the api directory [3].

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

@dosubot[bot] commented on GitHub (Feb 18, 2025): <!-- Greeting --> Hey @zzyyll2! I'm here to help you with any bugs, questions, or contributions you have. Let's solve this together! <!-- Answer --> The error "value too long for type character varying(40)" is occurring because the `provider_name` column in the `dataset_collection_bindings` table is defined with a maximum length of 40 characters. The value `'langgenius/openai_api_compatible/openai_api_compatible'` exceeds this limit with a length of 51 characters <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/migrations/versions/6e2cfb077b04_add_dataset_collection_binding.py)</sup>. To resolve this, you should ensure that the database migration to increase the column length has been applied. There is a migration script that alters the `provider_name` column in the `embeddings` table to allow for longer values, but it seems this change might not have been applied to the `dataset_collection_bindings` table. You should check if there is a similar migration for this table or consider creating one to increase the column length to accommodate longer values <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/migrations/versions/53bf8af60645_update_model.py)</sup>. If the migration has not been applied, follow the process for applying database migrations in the Dify platform. If you are using Docker, ensure the `MIGRATION_ENABLED` environment variable is set to true, and restart the services. If running from source, manually run `flask db upgrade` in the api directory <sup>[[3]](https://github.com/langgenius/dify/issues/13350)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1ac9a906-236e-4493-b2cb-9719ae3a7dd1?feedback_type=other)</sup>
Author
Owner

@zzyyll2 commented on GitHub (Feb 18, 2025):

@dosu I have newly installed it, not upgraded from an old version, do I also need to perform these operations? If so, please indicate this in the document. Thank you.

@zzyyll2 commented on GitHub (Feb 18, 2025): @dosu I have newly installed it, not upgraded from an old version, do I also need to perform these operations? If so, please indicate this in the document. Thank you.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 18, 2025):

Yes, even with a new installation of the Dify platform, you need to perform database migration operations. This is necessary to ensure that your database schema is up-to-date with the latest version of the platform. The documentation should indeed indicate this requirement to guide users through the installation process. You can perform the migration by running the flask db upgrade command in the appropriate directory [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

@dosubot[bot] commented on GitHub (Feb 18, 2025): <!-- Answer --> Yes, even with a new installation of the Dify platform, you need to perform database migration operations. This is necessary to ensure that your database schema is up-to-date with the latest version of the platform. The documentation should indeed indicate this requirement to guide users through the installation process. You can perform the migration by running the `flask db upgrade` command in the appropriate directory <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/commands.py)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e1981d4c-0caf-42a7-8c89-6e7f0af216e3?feedback_type=other)</sup>
Author
Owner

@zzyyll2 commented on GitHub (Feb 18, 2025):

@dosu I found MIGRATION_ENABLED environment variable is set to true default.

Image

@zzyyll2 commented on GitHub (Feb 18, 2025): @dosu I found MIGRATION_ENABLED environment variable is set to true default. ![Image](https://github.com/user-attachments/assets/6c5c2e97-eefa-459a-b903-ed682445693a)
Author
Owner

@dosubot[bot] commented on GitHub (Feb 18, 2025):

That's great to hear! Since the MIGRATION_ENABLED environment variable is set to true by default, the migrations should run automatically when you start the application. If you're still encountering the issue, try restarting your Docker containers to ensure the migrations are applied. If the problem persists, you might want to manually run flask db upgrade in the API directory to ensure all migrations are applied correctly. Let me know if you need further assistance!

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

@dosubot[bot] commented on GitHub (Feb 18, 2025): <!-- Answer --> That's great to hear! Since the `MIGRATION_ENABLED` environment variable is set to true by default, the migrations should run automatically when you start the application. If you're still encountering the issue, try restarting your Docker containers to ensure the migrations are applied. If the problem persists, you might want to manually run `flask db upgrade` in the API directory to ensure all migrations are applied correctly. Let me know if you need further assistance! <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4fde3e63-e3ef-4905-8b28-578870ea86ed?feedback_type=other)</sup>
Author
Owner

@zzyyll2 commented on GitHub (Feb 18, 2025):

@dosu
I have reviewed the code, branch is 1.0.0-beta.1,i search dataset_collection_bindings, result below picture:

Image

There is not a migration script that alters the provider_name column in the embeddings table to allow for longer values.

look the code:

Image

thanks.

@zzyyll2 commented on GitHub (Feb 18, 2025): @dosu I have reviewed the code, branch is 1.0.0-beta.1,i search dataset_collection_bindings, result below picture: ![Image](https://github.com/user-attachments/assets/483aeb1f-ecbc-4259-b3a8-41e1a50bb2a5) There is not a migration script that alters the provider_name column in the embeddings table to allow for longer values. look the code: ![Image](https://github.com/user-attachments/assets/550d8f5e-92ae-4356-b674-7b1e44dd2270) thanks.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 18, 2025):

Hey @zzyyll2! It looks like you're diving deep into the migration scripts and database schema. While I can help with technical questions and bug fixes, I'm not equipped to review or analyze code directly. If you think I should be able to help with this, feel free to reach out to the Dosu Team. They'll be happy to hear your feedback! 😊

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

@dosubot[bot] commented on GitHub (Feb 18, 2025): <!-- Answer --> Hey @zzyyll2! It looks like you're diving deep into the migration scripts and database schema. While I can help with technical questions and bug fixes, I'm not equipped to review or analyze code directly. If you think I should be able to help with this, feel free to reach out to the [Dosu Team](mailto:customersuccess@dosu.dev). They'll be happy to hear your feedback! 😊 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ee9fa1c1-c78f-4b93-afd5-3d6c7252ee4d?feedback_type=other)</sup>
Author
Owner

@zzyyll2 commented on GitHub (Feb 19, 2025):

@Dosu I solved this problem by following these steps:

  1. docker exec -it docker-db-1 bash
  2. psql -d dify
  3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
  4. \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)
@zzyyll2 commented on GitHub (Feb 19, 2025): @Dosu I solved this problem by following these steps: 1. docker exec -it docker-db-1 bash 2. psql -d dify 3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); 4. \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)
Author
Owner

@dosubot[bot] commented on GitHub (Feb 19, 2025):

Hey @zzyyll2! It sounds like you've been busy and found a solution to your issue—great job! 🎉 However, I'm here to help with bugs, technical questions, and engineering knowledge, not to review or validate solutions. If you think I should be able to help with this kind of request, feel free to reach out to the Dosu Team. They'll be happy to hear your feedback! 😊

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

@dosubot[bot] commented on GitHub (Feb 19, 2025): <!-- Answer --> Hey @zzyyll2! It sounds like you've been busy and found a solution to your issue—great job! 🎉 However, I'm here to help with bugs, technical questions, and engineering knowledge, not to review or validate solutions. If you think I should be able to help with this kind of request, feel free to reach out to the [Dosu Team](mailto:customersuccess@dosu.dev). They'll be happy to hear your feedback! 😊 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3cd35429-eb31-47e2-8a57-669fd7364879?feedback_type=other)</sup>
Author
Owner

@kkjinping commented on GitHub (Feb 28, 2025):

@dosu I solved this problem by following these steps:

  1. docker exec -it docker-db-1 bash
  2. psql -d dify
  3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
  4. \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)

thank you , it help me

@kkjinping commented on GitHub (Feb 28, 2025): > [@dosu](https://github.com/dosu) I solved this problem by following these steps: > > 1. docker exec -it docker-db-1 bash > 2. psql -d dify > 3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); > 4. \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) thank you , it help me
Author
Owner

@KangbingZhao commented on GitHub (Mar 5, 2025):

@dosu I solved this problem by following these steps:

  1. docker exec -it docker-db-1 bash
  2. psql -d dify
  3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
  4. \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)

It works for me as well. However, since Dify is using PostgreSQL, we can replace all instances of VARCHAR(XXX) with the text type.

@KangbingZhao commented on GitHub (Mar 5, 2025): > [@dosu](https://github.com/dosu) I solved this problem by following these steps: > > 1. docker exec -it docker-db-1 bash > 2. psql -d dify > 3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); > 4. \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) It works for me as well. However, since Dify is using PostgreSQL, we can replace all instances of VARCHAR(XXX) with the text type.
Author
Owner

@Scofield-Gu commented on GitHub (Mar 8, 2025):

@dosu I solved this problem by following these steps:

  1. docker exec -it docker-db-1 bash
  2. psql -d dify
  3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
  4. \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)

works for me as well, but 1 point confused me is that bellow commit seems don't work after pulling the latest commit.
fix: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40) Fixes https://github.com/langgenius/dify/issues/14593 (https://github.com/langgenius/dify/pull/14597)

baseline i used:
Author: Hantaek Lim 143519383+LHANTAEK@users.noreply.github.com
Date: 2025/3/8 19:08:48
Committer: GitHub noreply@github.com
Commit hash: f7e012d216

Fix: reranker OFF logic to preserve user setting (#15235)

Co-authored-by: crazywoola 427733928@qq.com

@Scofield-Gu commented on GitHub (Mar 8, 2025): > [@dosu](https://github.com/dosu) I solved this problem by following these steps: > > 1. docker exec -it docker-db-1 bash > 2. psql -d dify > 3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); > 4. \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) **works for me as well**, but 1 point confused me is that **bellow commit seems don't work after pulling the latest commit.** fix: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40) Fixes https://github.com/langgenius/dify/issues/14593 (https://github.com/langgenius/dify/pull/14597) **baseline i used:** Author: Hantaek Lim <143519383+LHANTAEK@users.noreply.github.com> Date: 2025/3/8 19:08:48 Committer: GitHub <noreply@github.com> Commit hash: f7e012d21658eb24a9e17462598195e909061d69 Fix: reranker OFF logic to preserve user setting (#15235) Co-authored-by: crazywoola <427733928@qq.com>
Author
Owner

@Windows55 commented on GitHub (Mar 10, 2025):

@dosu I solved this problem by following these steps:

  1. docker exec -it docker-db-1 bash
  2. psql -d dify
  3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255);
  4. \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)

感谢 解决了本地化部署推理模型 无法导入知识库的问题
'langgenius/openai_api_compatible/openai_api_compatible' 应该去掉一个'openai_api_compatible'

@Windows55 commented on GitHub (Mar 10, 2025): > [@dosu](https://github.com/dosu) I solved this problem by following these steps: > > 1. docker exec -it docker-db-1 bash > 2. psql -d dify > 3. ALTER TABLE dataset_collection_bindings ALTER COLUMN provider_name TYPE VARCHAR(255); > 4. \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) 感谢 解决了本地化部署推理模型 无法导入知识库的问题 'langgenius/openai_api_compatible/openai_api_compatible' 应该去掉一个'openai_api_compatible'
Author
Owner

@crazywoola commented on GitHub (Mar 12, 2025):

fix: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40) Fixes https://github.com/langgenius/dify/issues/14593 (https://github.com/langgenius/dify/pull/14597)

@crazywoola commented on GitHub (Mar 12, 2025): fix: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40) Fixes https://github.com/langgenius/dify/issues/14593 (https://github.com/langgenius/dify/pull/14597)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8368