When using the embedding model bge-m3, there is a Vector database connection errorl; It is normal to use the economic model without using the embedding model. #8741

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

Originally created by @debugxu on GitHub (Feb 28, 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

0.15.3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Image

Image

Image

✔️ Expected Behavior

No response

Actual Behavior

Every time I click on the docker nginx image log, I find this 400 error, why does the database not connect? Everything works fine when the Embedding model is not used.

Originally created by @debugxu on GitHub (Feb 28, 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/48d35257-2fb9-430c-affa-616d4a5a390d) <img width="1097" alt="Image" src="https://github.com/user-attachments/assets/f57fe65a-034a-4118-958a-d9112a356618" /> ![Image](https://github.com/user-attachments/assets/b9acaee2-a2d7-4bae-84f3-a12437b06e0d) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior Every time I click on the docker nginx image log, I find this 400 error, why does the database not connect? Everything works fine when the Embedding model is not used.
yindo closed this issue 2026-02-21 18:27:19 -05:00
Author
Owner

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

I found a similar discussion titled Vector database connection error, which is still open and might be relevant to your issue [1].

Regarding the 400 error you're encountering, a common cause in the context of vector database connections in Dify is using the 'raw' body format in the HTTP request node when the query contains special characters like newlines ('\n'). To resolve this, you should change the body format from 'raw' to 'JSON' in the HTTP request node configuration to ensure proper escaping of special characters in the query string [2].

Additionally, you might want to check the default settings for vector database connections in Dify, which are specified in the api/.env.example file. These settings can be modified for troubleshooting by editing the corresponding environment variables in your .env file [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 28, 2025): <!-- Answer --> I found a similar discussion titled [Vector database connection error](https://github.com/langgenius/dify/discussions/7142), which is still open and might be relevant to your issue <sup>[[1]](https://github.com/langgenius/dify/discussions/7142)</sup>. Regarding the 400 error you're encountering, a common cause in the context of vector database connections in Dify is using the 'raw' body format in the HTTP request node when the query contains special characters like newlines ('\n'). To resolve this, you should change the body format from 'raw' to 'JSON' in the HTTP request node configuration to ensure proper escaping of special characters in the query string <sup>[[2]](https://github.com/langgenius/dify/issues/11643)</sup>. Additionally, you might want to check the default settings for vector database connections in Dify, which are specified in the `api/.env.example` file. These settings can be modified for troubleshooting by editing the corresponding environment variables in your `.env` file <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/.env.example)</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/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b624a368-0550-4ffb-aee7-cfbdef432359?feedback_type=other)</sup>
Author
Owner

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

ImageWhat I don't understand is why the Embedding model doesn't connect, and if you don't, everything works? @dosu

@debugxu commented on GitHub (Feb 28, 2025): ![Image](https://github.com/user-attachments/assets/948d18e5-f953-47e5-8c02-eba3b42bcbb1)What I don't understand is why the Embedding model doesn't connect, and if you don't, everything works? @dosu
Author
Owner

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

The issue you're experiencing with the embedding model not connecting while other models work fine could be related to specific configuration or connection settings for the embedding model. Here are a few potential areas to investigate:

  1. Configuration Errors: Ensure that all required configuration parameters for the vector database are correctly set. Missing or incorrect parameters can lead to connection failures. Check the .env file for any discrepancies [1].

  2. Connection Pool Limits: If the embedding model uses a different connection pool configuration, it might be hitting the maximum connection limit, causing new connection requests to fail until existing connections are released [2].

  3. Database Connection Issues: Verify that the database credentials and network settings are correct. Network issues or incorrect credentials can prevent the embedding model from connecting.

  4. SQL Execution Errors: Ensure that there are no syntax errors or issues with table/column names in the SQL queries used by the embedding model.

  5. Redis Locking Issues: If Redis is used for caching or locking, ensure that it is available and functioning correctly, as issues here could affect the embedding model's ability to connect [2].

Review these areas to identify any potential misconfigurations or issues specific to the embedding model setup.

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 28, 2025): <!-- Answer --> The issue you're experiencing with the embedding model not connecting while other models work fine could be related to specific configuration or connection settings for the embedding model. Here are a few potential areas to investigate: 1. **Configuration Errors**: Ensure that all required configuration parameters for the vector database are correctly set. Missing or incorrect parameters can lead to connection failures. Check the `.env` file for any discrepancies <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/.env.example)</sup>. 2. **Connection Pool Limits**: If the embedding model uses a different connection pool configuration, it might be hitting the maximum connection limit, causing new connection requests to fail until existing connections are released <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/rag/datasource/vdb/pgvector/pgvector.py)</sup>. 3. **Database Connection Issues**: Verify that the database credentials and network settings are correct. Network issues or incorrect credentials can prevent the embedding model from connecting. 4. **SQL Execution Errors**: Ensure that there are no syntax errors or issues with table/column names in the SQL queries used by the embedding model. 5. **Redis Locking Issues**: If Redis is used for caching or locking, ensure that it is available and functioning correctly, as issues here could affect the embedding model's ability to connect <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/rag/datasource/vdb/pgvector/pgvector.py)</sup>. Review these areas to identify any potential misconfigurations or issues specific to the embedding model setup. <!-- 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/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/50a06dd8-b2ed-47f0-8735-8c27bc0110fb?feedback_type=other)</sup>
Author
Owner

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

ImageThis is the error message of docker-web-1 when I import the knowledge base

@debugxu commented on GitHub (Feb 28, 2025): ![Image](https://github.com/user-attachments/assets/70589bb7-f235-460b-9bcd-74e3b98a241a)This is the error message of docker-web-1 when I import the knowledge base
Author
Owner

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

@dosu

@debugxu commented on GitHub (Feb 28, 2025): @dosu
Author
Owner

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

Image

@debugxu commented on GitHub (Feb 28, 2025): ![Image](https://github.com/user-attachments/assets/6a3c841a-580f-4c6f-a41b-00b8c77d3544)
Author
Owner

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

The socket.gaierror with error code [Errno -2] indicates a DNS resolution failure, meaning the system is unable to resolve the hostname to an IP address. Here are some steps to troubleshoot this issue:

  1. Check DNS Configuration: Ensure that the DNS settings in your Docker setup are correctly configured. You might need to specify a DNS server in your Docker Compose file or Docker daemon settings.

  2. Network Settings: Verify the network settings in your Docker Compose configuration. The default network settings for Dify's Docker containers are defined in the docker-compose.middleware.yaml file, where the network is set as internal. You may need to adjust these settings to allow external DNS resolution [1].

  3. Hostnames and Environment Variables: Double-check the hostnames and environment variables in your .env file to ensure they are correct and match the expected configuration for your vector database or any external services.

  4. Docker Restart: Sometimes, restarting the Docker service or the specific containers can resolve transient DNS issues.

  5. Local DNS Cache: Clear the DNS cache on your host machine to ensure it's not using outdated information.

By addressing these areas, you should be able to resolve the DNS resolution issue and successfully import the knowledge base.

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 28, 2025): <!-- Answer --> The `socket.gaierror` with error code `[Errno -2]` indicates a DNS resolution failure, meaning the system is unable to resolve the hostname to an IP address. Here are some steps to troubleshoot this issue: 1. **Check DNS Configuration**: Ensure that the DNS settings in your Docker setup are correctly configured. You might need to specify a DNS server in your Docker Compose file or Docker daemon settings. 2. **Network Settings**: Verify the network settings in your Docker Compose configuration. The default network settings for Dify's Docker containers are defined in the `docker-compose.middleware.yaml` file, where the network is set as internal. You may need to adjust these settings to allow external DNS resolution <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.middleware.yaml)</sup>. 3. **Hostnames and Environment Variables**: Double-check the hostnames and environment variables in your `.env` file to ensure they are correct and match the expected configuration for your vector database or any external services. 4. **Docker Restart**: Sometimes, restarting the Docker service or the specific containers can resolve transient DNS issues. 5. **Local DNS Cache**: Clear the DNS cache on your host machine to ensure it's not using outdated information. By addressing these areas, you should be able to resolve the DNS resolution issue and successfully import the knowledge base. <!-- 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/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/df66c8e0-be01-423f-9726-68ab4f7358d5?feedback_type=other)</sup>
Author
Owner

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

I notice that you selected Self Hosted (Source)? But it seems you are using docker?

@crazywoola commented on GitHub (Feb 28, 2025): I notice that you selected `Self Hosted (Source)`? But it seems you are using docker?
Author
Owner

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

Please provide things below:

  • ollama ls
  • your configuration screenshot of the system models
  • your screenshot of the added bge-m3:latest configuration
@crazywoola commented on GitHub (Feb 28, 2025): Please provide things below: - ollama ls - your configuration screenshot of the system models - your screenshot of the added bge-m3:latest configuration
Author
Owner

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

请在下面提供内容:

  • Ollama LS
  • 您的配置系统模型屏幕截图
  • 您添加的BGE-M3的屏幕截图:最新配置

Image

Image

ImageThis is misinformation:requests.exceptions.ConnectionError: HTTPConnectionPool(host='weaviate', port=8080): Max retries exceeded with url: /v1/meta (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f382f2a7650>: Failed to resolve 'weaviate' ([Errno -2] Name or service not known)")) 。It looks like weaviate I can't parse, but the resolution I've added in the server's host, still unsuccessful 75.2.60.5 weaviat

@debugxu commented on GitHub (Feb 28, 2025): > 请在下面提供内容: > > * Ollama LS > * 您的配置系统模型屏幕截图 > * 您添加的BGE-M3的屏幕截图:最新配置 ![Image](https://github.com/user-attachments/assets/6be9d041-8b7c-4445-96ac-924f4c7f16fb) ![Image](https://github.com/user-attachments/assets/c6f51aae-2d3c-40f0-a449-fae00f167df4) ![Image](https://github.com/user-attachments/assets/c34c43d6-448c-40aa-8297-b3d780243754)This is misinformation:requests.exceptions.ConnectionError: HTTPConnectionPool(host='weaviate', port=8080): Max retries exceeded with url: /v1/meta (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f382f2a7650>: Failed to resolve 'weaviate' ([Errno -2] Name or service not known)")) 。It looks like weaviate I can't parse, but the resolution I've added in the server's host, still unsuccessful 75.2.60.5 weaviat
Author
Owner

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

I have also encountered the same problem. Have you solved it

@jianqianyan commented on GitHub (Feb 28, 2025): I have also encountered the same problem. Have you solved it
Author
Owner

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

Did you turn on the VPN across the containers.

@crazywoola commented on GitHub (Feb 28, 2025): Did you turn on the VPN across the containers.
Author
Owner

@jianqianyan commented on GitHub (Mar 3, 2025):

Did you turn on the VPN across the containers.

I know what the problem is, he doesn't start weaviate by default now

@jianqianyan commented on GitHub (Mar 3, 2025): > Did you turn on the VPN across the containers. I know what the problem is, he doesn't start weaviate by default now
Author
Owner

@jianqianyan commented on GitHub (Mar 3, 2025):

Did you turn on the VPN across the containers.

I know what the problem is, he doesn't start weaviate by default now

docker compose

@jianqianyan commented on GitHub (Mar 3, 2025): > > Did you turn on the VPN across the containers. > > I know what the problem is, he doesn't start weaviate by default now docker compose
Author
Owner

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

yes,i have the same issue

@innocentshen commented on GitHub (Mar 5, 2025): yes,i have the same issue
Author
Owner

@debugxu commented on GitHub (Mar 11, 2025):

Sorry for forgetting to reply, launch a Docker Compose project called dify in the background, but only start services that belong to the weaviate Profile docker compose --profile weaviate -p dify up -d. to solve the problem @jianqianyan @innocentshen @crazywoola

@debugxu commented on GitHub (Mar 11, 2025): Sorry for forgetting to reply, launch a Docker Compose project called dify in the background, but only start services that belong to the weaviate Profile docker compose --profile weaviate -p dify up -d. to solve the problem @jianqianyan @innocentshen @crazywoola
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8741