From 94a1dc383a58a87386a60db3e269f807f5308883 Mon Sep 17 00:00:00 2001 From: AllenWriter Date: Tue, 15 Apr 2025 11:31:11 +0800 Subject: [PATCH 1/3] Update postgresql content --- zh_CN/getting-started/install-self-hosted/faq.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zh_CN/getting-started/install-self-hosted/faq.md b/zh_CN/getting-started/install-self-hosted/faq.md index 0ee8496ad..430de403b 100644 --- a/zh_CN/getting-started/install-self-hosted/faq.md +++ b/zh_CN/getting-started/install-self-hosted/faq.md @@ -53,7 +53,7 @@ Password confirm: newpassword4567 Password reset successfully. ``` -### 5. 如何修改页面端口 +### 5. 如何修改页面端口? 如果你使用 Docker Compose 部署,你可以通过修改`.env`配置来自定义 Dify 的访问端口。 @@ -65,4 +65,13 @@ EXPOSE_NGINX_SSL_PORT=443 ``` -其他相关的部署问题请参考[本地部署相关](../../learn-more/faq/install-faq.md)。 \ No newline at end of file +其他相关的部署问题请参考[本地部署相关](../../learn-more/faq/install-faq.md)。 + +### 6. docker-api-1 出现数据库连接报错如何处理? + +问题详情:访问 `http://localhost` 时提示 `Internal Server Error` 错误;且 docker-api-1 的日志中出现了类似错误: + +```bash +FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption +``` + From 06cca6c640528b66700ab37d745acc32fb5e1a4d Mon Sep 17 00:00:00 2001 From: AllenWriter Date: Tue, 15 Apr 2025 13:52:41 +0800 Subject: [PATCH 2/3] Docs: update docker api faq --- .../install-self-hosted/faqs.md | 22 ++++++++++++++----- jp/SUMMARY.md | 2 +- .../install-self-hosted/{faq.md => faqs.md} | 22 +++++++++++++++---- .../install-self-hosted/docker-compose.md | 14 +----------- .../install-self-hosted/faq.md | 13 +++++++---- 5 files changed, 46 insertions(+), 27 deletions(-) rename jp/getting-started/install-self-hosted/{faq.md => faqs.md} (81%) diff --git a/en/getting-started/install-self-hosted/faqs.md b/en/getting-started/install-self-hosted/faqs.md index 23a94b42b..cd23af442 100644 --- a/en/getting-started/install-self-hosted/faqs.md +++ b/en/getting-started/install-self-hosted/faqs.md @@ -11,11 +11,11 @@ docker compose down docker compose up -d ``` -If you still haven't received the email, please check if the email service is working properly and whether the email has been placed in the trash list. +If you still haven't received the email, please check if the email service is working properly and whether the email has been placed in the spam folder. ### 2. How to handle if the workflow is too complex and exceeds the node limit? -In the community edition, you can manually adjust the MAX\_TREE\_DEPTH limit for single branch depth in `web/app/components/workflow/constants.ts.` Our default value is 50, and it's important to note that excessively deep branches may affect performance in self-hosted scenarios. +In the community edition, you can manually adjust the MAX\_TREE\_DEPTH limit for single branch depth in `web/app/components/workflow/constants.ts`. Our default value is 50, and it's important to note that excessively deep branches may affect performance in self-hosted scenarios. ### 3. How to specify the runtime for each workflow node? @@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password It will prompt you to enter the email address and the new password. Example: -``` +```bash dify@my-pc:~/hello/dify/docker$ docker compose up -d [+] Running 9/9 ✔ Container docker-web-1 Started 0.1s @@ -59,10 +59,22 @@ If you're using Docker Compose, you can customize the access port by modifying t You need to modify the Nginx configuration: -```json +```docker EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 ``` +### 6. How to resolve database connection errors in docker-api-1? + +**Issue Details**: When accessing `http://localhost`, you may encounter an `Internal Server Error`; and the following message might appear in the `docker-api-1` logs: -Other self-host issue please check this document [Self-Host Related](../../learn-more/faq/install-faq.md)。 \ No newline at end of file +```bash +FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption +``` + +**Solution**: Update the `/var/lib/postgresql/pgdata/pg_hba.conf` file inside the db container to allow connections from the network segment mentioned in the error message. For example: + +```bash +docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf" +docker-compose restart +``` diff --git a/jp/SUMMARY.md b/jp/SUMMARY.md index e7abc133e..2f79b6c61 100644 --- a/jp/SUMMARY.md +++ b/jp/SUMMARY.md @@ -12,7 +12,7 @@ * [aaPanelでのデプロイ方法](getting-started/install-self-hosted/bt-panel.md) * [フロントエンドDockerコンテナを単独起動](getting-started/install-self-hosted/start-the-frontend-docker-container.md) * [環境変数の説明](getting-started/install-self-hosted/environments.md) - * [よくある質問](getting-started/install-self-hosted/faq.md) + * [よくある質問](getting-started/install-self-hosted/faqs.md) * [Dify Premium](getting-started/dify-premium.md) * [Dify 教育版](getting-started/dify-for-education.md) diff --git a/jp/getting-started/install-self-hosted/faq.md b/jp/getting-started/install-self-hosted/faqs.md similarity index 81% rename from jp/getting-started/install-self-hosted/faq.md rename to jp/getting-started/install-self-hosted/faqs.md index c2df45e54..7f5930dda 100644 --- a/jp/getting-started/install-self-hosted/faq.md +++ b/jp/getting-started/install-self-hosted/faqs.md @@ -6,7 +6,7 @@ 設定の変更後は、以下のコマンドを実行して、サービスをリスタートさせてください。 -```javascript +```bash docker compose down docker compose up -d ``` @@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password メールアドレスと新しいパスワードを入力するプロンプトが表示されます。例えば: -``` +```bash dify@my-pc:~/hello/dify/docker$ docker compose up -d [+] Running 9/9 ✔ Container docker-web-1 Started 0.1s @@ -59,10 +59,24 @@ Docker Compose を使用してデプロイする場合、`.env` 設定を変更 Nginx 関連の設定を変更する必要があります: -``` +```docker EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 ``` +### 6. docker-api-1でデータベース接続エラーが発生した場合の解決方法は? + +**問題の詳細**:`http://localhost`にアクセスすると`Internal Server Error`が表示され、`docker-api-1`のログに次のようなエラーが表示される場合: + +```bash +FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption +``` + +**解決策**:dbコンテナ内の`/var/lib/postgresql/pgdata/pg_hba.conf`を変更し、エラーメッセージに記載されているネットワークセグメントを認証リストに追加します。例: + +```bash +docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf" +docker-compose restart +``` -他のデプロイに関する質問は[ここに](../../learn-more/faq/install-faq.md)います。 \ No newline at end of file +他のデプロイに関する質問は[ローカルデプロイに関する](../../learn-more/faq/install-faq.md)をご確認ください。 diff --git a/zh_CN/getting-started/install-self-hosted/docker-compose.md b/zh_CN/getting-started/install-self-hosted/docker-compose.md index 632a45a2a..c61956588 100644 --- a/zh_CN/getting-started/install-self-hosted/docker-compose.md +++ b/zh_CN/getting-started/install-self-hosted/docker-compose.md @@ -88,19 +88,7 @@ docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin… docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp ``` -此时,由于PostgreSQL的安全设置,在docker-api-1的日志中很可能会报出类似以下错误: -```bash -FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption -``` -而打开`http://localhost`则提示`Internal Server Error` - -你应当修改db容器下的`/var/lib/postgresql/pgdata/pg_hba.conf`,添加对应你报错提示中的网段进入授权名单,例如 -```bash -docker exec -it docker-db-1 sh -c "echo 'host all all 172.21.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf" -docker-compose restart -``` - -通过这些步骤,你应该可以成功在本地安装 Dify。 +通过这些步骤,你可以在本地成功安装 Dify。 ### 更新 Dify diff --git a/zh_CN/getting-started/install-self-hosted/faq.md b/zh_CN/getting-started/install-self-hosted/faq.md index 430de403b..b6bd306f0 100644 --- a/zh_CN/getting-started/install-self-hosted/faq.md +++ b/zh_CN/getting-started/install-self-hosted/faq.md @@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password 请按照提示输入邮箱地址和新密码,例如: -``` +```bash dify@my-pc:~/hello/dify/docker$ docker compose up -d [+] Running 9/9 ✔ Container docker-web-1 Started 0.1s @@ -55,7 +55,7 @@ Password reset successfully. ### 5. 如何修改页面端口? -如果你使用 Docker Compose 部署,你可以通过修改`.env`配置来自定义 Dify 的访问端口。 +如果你使用 Docker Compose 部署,你可以通过修改 `.env` 配置自定义 Dify 的访问端口。 你需要修改 Nginx 相关配置: @@ -64,14 +64,19 @@ EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 ``` - 其他相关的部署问题请参考[本地部署相关](../../learn-more/faq/install-faq.md)。 ### 6. docker-api-1 出现数据库连接报错如何处理? -问题详情:访问 `http://localhost` 时提示 `Internal Server Error` 错误;且 docker-api-1 的日志中出现了类似错误: +**问题详情**:访问 `http://localhost` 时提示 `Internal Server Error` 错误;且 `docker-api-1` 的日志中出现了类似错误: ```bash FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption ``` +**解决办法**:修改 db 容器下的 `/var/lib/postgresql/pgdata/pg_hba.conf`,将报错提示中所对应的网段添加至授权名单,例如: + +```bash +docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf" +docker-compose restart +``` From b14781b270aca391adf0df80d4abcaf26fb6cf49 Mon Sep 17 00:00:00 2001 From: Hanqing Zhao Date: Tue, 15 Apr 2025 14:06:55 +0800 Subject: [PATCH 3/3] Update faqs.md --- jp/getting-started/install-self-hosted/faqs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jp/getting-started/install-self-hosted/faqs.md b/jp/getting-started/install-self-hosted/faqs.md index 7f5930dda..512ef7480 100644 --- a/jp/getting-started/install-self-hosted/faqs.md +++ b/jp/getting-started/install-self-hosted/faqs.md @@ -64,9 +64,9 @@ EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 ``` -### 6. docker-api-1でデータベース接続エラーが発生した場合の解決方法は? +### 6. docker-api-1 でのデータベース接続エラーの解決方法とは? -**問題の詳細**:`http://localhost`にアクセスすると`Internal Server Error`が表示され、`docker-api-1`のログに次のようなエラーが表示される場合: +**問題**:`http://localhost`アクセス時に`Internal Server Error`が発生し、`docker-api-1`のログに以下エラーが記録される場合: ```bash FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption