core.model_runtime.errors. invoke. InvokeError: xinferencel Error: Invalid URL #4242

Closed
opened 2026-02-21 18:05:21 -05:00 by yindo · 7 comments
Owner

Originally created by @qjy706 on GitHub (Jun 24, 2024).

Originally assigned to: @laipz8200 on GitHub.

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.9

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Configured xinference embedding and rerank interfaces and the model is bce_embedding and bce_rerank
  2. Two model interfaces are configured in the model configuration interface
  3. The URL I filled in at the beginning was http://xxxx:9997
  4. During document vectorization, the log shows that the URL is invalid
  5. When I go back and open the configuration interface, I find that the URL has become secret text, but the previously configured Ollama is still readable.

0bf2fa0d8aba23a32c9830da99bd75ad9ef7497c3ae24f76499bb40bb50e31d2
2b93165a14dc454912fac5f7baf098c00a1ceb499828920ee50112fb751e56a6

✔️ Expected Behavior

The document is successfully vectorized and can be retrieved

Actual Behavior

url is invaild

Originally created by @qjy706 on GitHub (Jun 24, 2024). Originally assigned to: @laipz8200 on GitHub. ### 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] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.9 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Configured xinference embedding and rerank interfaces and the model is bce_embedding and bce_rerank 2. Two model interfaces are configured in the model configuration interface 3. The URL I filled in at the beginning was http://xxxx:9997 4. During document vectorization, the log shows that the URL is invalid 5. When I go back and open the configuration interface, I find that the URL has become secret text, but the previously configured Ollama is still readable. 6. ![0bf2fa0d8aba23a32c9830da99bd75ad9ef7497c3ae24f76499bb40bb50e31d2](https://github.com/langgenius/dify/assets/43703581/ed1be8c8-5d8d-4271-aff2-1a19e9a9a74a) ![2b93165a14dc454912fac5f7baf098c00a1ceb499828920ee50112fb751e56a6](https://github.com/langgenius/dify/assets/43703581/90662d04-e8c0-4e0b-a08a-f905bfe55a8e) ### ✔️ Expected Behavior The document is successfully vectorized and can be retrieved ### ❌ Actual Behavior url is invaild
yindo closed this issue 2026-02-21 18:05:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 24, 2024):

@qjy706 Hello there! I'm here to help you with any bugs, questions, or contributions you have regarding our repository.

To resolve the issue of the URL becoming invalid during the document vectorization process in Dify version 0.6.9, which is self-hosted using Docker, you need to ensure that the environment variables for the API and web services are correctly set. Specifically, you should set the CONSOLE_API_URL, APP_API_URL, and SERVICE_API_URL environment variables to the correct URLs.

Here is an example of how you can set these environment variables in your docker-compose.yaml file:

services:
  api:
    image: langgenius/dify-api:0.6.11
    restart: always
    environment:
      MODE: api
      LOG_LEVEL: INFO
      SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
      CONSOLE_WEB_URL: 'http://your-console-web-url'
      CONSOLE_API_URL: 'http://your-console-api-url'
      SERVICE_API_URL: 'http://your-service-api-url'
      APP_WEB_URL: 'http://your-app-web-url'
      DB_USERNAME: postgres
      DB_PASSWORD: difyai123456
      DB_HOST: db
      DB_PORT: 5432
      DB_DATABASE: dify
      REDIS_HOST: redis
      REDIS_PORT: 6379
      REDIS_PASSWORD: difyai123456
      CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
      WEB_API_CORS_ALLOW_ORIGINS: '*'
      CONSOLE_CORS_ALLOW_ORIGINS: '*'

  web:
    image: langgenius/dify-web:0.6.11
    restart: always
    environment:
      CONSOLE_API_URL: 'http://your-console-api-url'
      APP_API_URL: 'http://your-app-api-url'
      SENTRY_DSN: ''

Make sure to replace http://your-console-web-url, http://your-console-api-url, http://your-service-api-url, and http://your-app-web-url with the actual URLs of your services. This should ensure that the URLs remain valid during the document vectorization process.

Additionally, if you are integrating local models deployed with Ollama, ensure that the Ollama service is accessible from the Docker container. If you encounter connection issues, you may need to expose the Ollama service to the network. For example, you can use the local network IP address or the Docker host machine IP address instead of localhost. Here is an example configuration for Ollama:

services:
  ollama:
    image: ollama/ollama:latest
    restart: always
    environment:
      OLLAMA_HOST: "0.0.0.0"
    ports:
      - "11434:11434"

In Dify, configure the Ollama base URL using the network-accessible address, such as http://192.168.1.100:11434 or http://host.docker.internal:11434, to ensure proper connectivity [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 24, 2024): <!-- Greeting --> @qjy706 Hello there! I'm here to help you with any bugs, questions, or contributions you have regarding our repository. <!-- Answer --> To resolve the issue of the URL becoming invalid during the document vectorization process in Dify version 0.6.9, which is self-hosted using Docker, you need to ensure that the environment variables for the API and web services are correctly set. Specifically, you should set the `CONSOLE_API_URL`, `APP_API_URL`, and `SERVICE_API_URL` environment variables to the correct URLs. Here is an example of how you can set these environment variables in your `docker-compose.yaml` file: ```yaml services: api: image: langgenius/dify-api:0.6.11 restart: always environment: MODE: api LOG_LEVEL: INFO SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U CONSOLE_WEB_URL: 'http://your-console-web-url' CONSOLE_API_URL: 'http://your-console-api-url' SERVICE_API_URL: 'http://your-service-api-url' APP_WEB_URL: 'http://your-app-web-url' DB_USERNAME: postgres DB_PASSWORD: difyai123456 DB_HOST: db DB_PORT: 5432 DB_DATABASE: dify REDIS_HOST: redis REDIS_PORT: 6379 REDIS_PASSWORD: difyai123456 CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1 WEB_API_CORS_ALLOW_ORIGINS: '*' CONSOLE_CORS_ALLOW_ORIGINS: '*' web: image: langgenius/dify-web:0.6.11 restart: always environment: CONSOLE_API_URL: 'http://your-console-api-url' APP_API_URL: 'http://your-app-api-url' SENTRY_DSN: '' ``` Make sure to replace `http://your-console-web-url`, `http://your-console-api-url`, `http://your-service-api-url`, and `http://your-app-web-url` with the actual URLs of your services. This should ensure that the URLs remain valid during the document vectorization process. Additionally, if you are integrating local models deployed with Ollama, ensure that the Ollama service is accessible from the Docker container. If you encounter connection issues, you may need to expose the Ollama service to the network. For example, you can use the local network IP address or the Docker host machine IP address instead of `localhost`. Here is an example configuration for Ollama: ```yaml services: ollama: image: ollama/ollama:latest restart: always environment: OLLAMA_HOST: "0.0.0.0" ports: - "11434:11434" ``` In Dify, configure the Ollama base URL using the network-accessible address, such as `http://192.168.1.100:11434` or `http://host.docker.internal:11434`, to ensure proper connectivity <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/model-configuration/ollama.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@qjy706 commented on GitHub (Jun 24, 2024):

@dosu, Thanks for your reply. I have configured the backend request address of flask, and other functions are running normally. The only problem is this API interface, because from the error log, the stored characters in the data table may be encrypted?

@qjy706 commented on GitHub (Jun 24, 2024): @dosu, Thanks for your reply. I have configured the backend request address of flask, and other functions are running normally. The only problem is this API interface, because from the error log, the stored characters in the data table may be encrypted?
Author
Owner

@dosubot[bot] commented on GitHub (Jun 24, 2024):

The issue you're encountering might be related to the encryption of stored characters in the data table. Dify does handle encryption for certain sensitive data, which could potentially affect the document vectorization process if the URLs or other configuration details are encrypted and not properly decrypted when accessed.

To address this, ensure that the encryption and decryption mechanisms are correctly implemented and that the necessary keys or secrets are available to the application. Here are a few steps you can take:

  1. Check Encryption Configuration: Verify that the encryption settings in your configuration files are correct. Ensure that the encryption keys are properly set and accessible by the application.

  2. Environment Variables: Ensure that all necessary environment variables related to encryption are correctly configured. This includes any keys or secrets required for decrypting the stored data.

  3. Database Configuration: Double-check the database configuration to ensure that the data is being stored and retrieved correctly. If the data is encrypted in the database, make sure that the application has the necessary logic to decrypt it when needed.

  4. Logs and Debugging: Enable detailed logging to capture more information about the error. This can help identify if the issue is indeed related to encryption or if there is another underlying cause.

If the issue persists, you might want to review the specific implementation of the encryption and decryption logic in your codebase to ensure that it aligns with the expected behavior.

For further assistance, you can refer to the Dify documentation or the relevant sections of your codebase that handle encryption and decryption. If you have specific code snippets or configuration details, feel free to share them for more targeted help.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 24, 2024): <!-- Answer --> The issue you're encountering might be related to the encryption of stored characters in the data table. Dify does handle encryption for certain sensitive data, which could potentially affect the document vectorization process if the URLs or other configuration details are encrypted and not properly decrypted when accessed. To address this, ensure that the encryption and decryption mechanisms are correctly implemented and that the necessary keys or secrets are available to the application. Here are a few steps you can take: 1. **Check Encryption Configuration**: Verify that the encryption settings in your configuration files are correct. Ensure that the encryption keys are properly set and accessible by the application. 2. **Environment Variables**: Ensure that all necessary environment variables related to encryption are correctly configured. This includes any keys or secrets required for decrypting the stored data. 3. **Database Configuration**: Double-check the database configuration to ensure that the data is being stored and retrieved correctly. If the data is encrypted in the database, make sure that the application has the necessary logic to decrypt it when needed. 4. **Logs and Debugging**: Enable detailed logging to capture more information about the error. This can help identify if the issue is indeed related to encryption or if there is another underlying cause. If the issue persists, you might want to review the specific implementation of the encryption and decryption logic in your codebase to ensure that it aligns with the expected behavior. For further assistance, you can refer to the Dify documentation or the relevant sections of your codebase that handle encryption and decryption. If you have specific code snippets or configuration details, feel free to share them for more targeted help. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@laipz8200 commented on GitHub (Jun 25, 2024):

Could you try upgrading to version 0.6.11 and see if the issue still occurs?

@laipz8200 commented on GitHub (Jun 25, 2024): Could you try upgrading to version 0.6.11 and see if the issue still occurs?
Author
Owner

@qjy706 commented on GitHub (Jun 26, 2024):

Could you try upgrading to version 0.6.11 and see if the issue still occurs?您可以尝试升级到0.6.11版本看看问题是否仍然存在?
Unfortunately, this problem still exists. It seems that there is a problem in the encryption and decryption process of the URL.

@qjy706 commented on GitHub (Jun 26, 2024): > Could you try upgrading to version 0.6.11 and see if the issue still occurs?您可以尝试升级到0.6.11版本看看问题是否仍然存在? Unfortunately, this problem still exists. It seems that there is a problem in the encryption and decryption process of the URL.
Author
Owner

@laipz8200 commented on GitHub (Jun 26, 2024):

@qjy706 Sorry, we couldn’t reproduce the issue. Could you please check if the problem occurs on our cloud service? If the issue persists, feel free to reopen this issue.

@laipz8200 commented on GitHub (Jun 26, 2024): @qjy706 Sorry, we couldn’t reproduce the issue. Could you please check if the problem occurs on [our cloud service](https://cloud.dify.ai)? If the issue persists, feel free to reopen this issue.
Author
Owner

@fzxs8 commented on GitHub (Oct 22, 2024):

我也遇到了同样的问题, v0.10.0
企业微信截图_17296529062066

我知道怎么解决。 因为升级,导致挂载的卷内容
./volumes/app/storage:/app/api/storage

下有个private.pem 里面内容发生了变化。 将内容换成之前的就好了。

也或者重新创建一个账号。

@fzxs8 commented on GitHub (Oct 22, 2024): 我也遇到了同样的问题, v0.10.0 ![企业微信截图_17296529062066](https://github.com/user-attachments/assets/86728273-9c97-4c26-8485-45d5cf4226d1) 我知道怎么解决。 因为升级,导致挂载的卷内容 ./volumes/app/storage:/app/api/storage 下有个private.pem 里面内容发生了变化。 将内容换成之前的就好了。 也或者重新创建一个账号。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4242