Knowledge base AI not allowed to execute with changed port #4639

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

Originally created by @jianwen095 on GitHub (Jul 17, 2024).

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.13

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

We are using the API of knowledge base, but some problems occur when we follow the introduction of API website to execute it because of computer port (we had already changed our port from 80 to 8080, set EXPOSE_NGINX_PORT=8080)

✔️ Expected Behavior

In our backend server we could execute API to create a empty file and get a response like this:
{
"document": {
"id": "",
"position": 1,
"data_source_type": "upload_file",
"data_source_info": {
"upload_file_id": ""
},
"dataset_process_rule_id": "",
"name": "text.txt",
"created_from": "api",
"created_by": "",
"created_at": 1695690280,
"tokens": 0,
"indexing_status": "waiting",
"error": null,
"enabled": true,
"disabled_at": null,
"disabled_by": null,
"archived": false,
"display_status": "queuing",
"word_count": 0,
"hit_count": 0,
"doc_form": "text_model"
},
"batch": ""
}

Actual Behavior

With recommended computer port we are not allowed to execute API
image1

Originally created by @jianwen095 on GitHub (Jul 17, 2024). ### 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.13 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce We are using the API of knowledge base, but some problems occur when we follow the introduction of API website to execute it because of computer port (we had already changed our port from 80 to 8080, set EXPOSE_NGINX_PORT=8080) ### ✔️ Expected Behavior In our backend server we could execute API to create a empty file and get a response like this: { "document": { "id": "", "position": 1, "data_source_type": "upload_file", "data_source_info": { "upload_file_id": "" }, "dataset_process_rule_id": "", "name": "text.txt", "created_from": "api", "created_by": "", "created_at": 1695690280, "tokens": 0, "indexing_status": "waiting", "error": null, "enabled": true, "disabled_at": null, "disabled_by": null, "archived": false, "display_status": "queuing", "word_count": 0, "hit_count": 0, "doc_form": "text_model" }, "batch": "" } ### ❌ Actual Behavior With recommended computer port we are not allowed to execute API ![image1](https://github.com/user-attachments/assets/5e3963f0-8218-42a3-8130-f6384089de0b)
yindo closed this issue 2026-02-21 18:07:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 17, 2024):

Hello, @jianwen095! I'm here to help with bug solving, answering questions, and guiding you to become a contributor. Let's tackle this issue together! 🤖

To resolve the issue where the API server URL defaults to port 80 instead of the configured port 8080 in Dify version 0.6.13, you need to change the relevant configuration items in the docker-compose.yml file to the correct port. Specifically, you should update the following configuration items:

  • CONSOLE_API_URL
  • CONSOLE_WEB_URL
  • SERVICE_API_URL
  • APP_API_URL
  • APP_WEB_URL

Ensure that these URLs include the correct port (8080) instead of the default port (80).

CONSOLE_API_URL: http://10.123.9.8:8080
CONSOLE_WEB_URL: http://10.123.9.8:8080
SERVICE_API_URL: http://10.123.9.8:8080
APP_API_URL: http://10.123.9.8:8080
APP_WEB_URL: http://10.123.9.8:8080

Additionally, make sure that the docker-compose.yml file includes the correct port mappings for the services. For example, the weaviate service should have the following port configuration:

weaviate:
  ports:
    - "8080:8080"

Make sure to replace 10.123.9.8 with your actual domain or IP address [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 17, 2024): <!-- Greeting --> Hello, @jianwen095! I'm here to help with bug solving, answering questions, and guiding you to become a contributor. Let's tackle this issue together! 🤖 <!-- Answer --> To resolve the issue where the API server URL defaults to port 80 instead of the configured port 8080 in Dify version 0.6.13, you need to change the relevant configuration items in the `docker-compose.yml` file to the correct port. Specifically, you should update the following configuration items: - `CONSOLE_API_URL` - `CONSOLE_WEB_URL` - `SERVICE_API_URL` - `APP_API_URL` - `APP_WEB_URL` Ensure that these URLs include the correct port (8080) instead of the default port (80). ```yaml CONSOLE_API_URL: http://10.123.9.8:8080 CONSOLE_WEB_URL: http://10.123.9.8:8080 SERVICE_API_URL: http://10.123.9.8:8080 APP_API_URL: http://10.123.9.8:8080 APP_WEB_URL: http://10.123.9.8:8080 ``` Additionally, make sure that the `docker-compose.yml` file includes the correct port mappings for the services. For example, the `weaviate` service should have the following port configuration: ```yaml weaviate: ports: - "8080:8080" ``` Make sure to replace `10.123.9.8` with your actual domain or IP address <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/install-faq.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker-legacy/docker-compose.middleware.yaml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 17, 2024):

See the bot's reply. You need to change SERVICE_API_URL regarding your question.

@crazywoola commented on GitHub (Jul 17, 2024): See the bot's reply. You need to change `SERVICE_API_URL` regarding your question.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4639