use docker compose --profile postgresql up -d start failure #21113

Closed
opened 2026-02-21 20:10:49 -05:00 by yindo · 1 comment
Owner

Originally created by @ly18047121713 on GitHub (Dec 17, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

use docker compose --profile postgresql up -d start failure

✔️ Expected Behavior

use docker compose --profile postgresql up -d start failure

Actual Behavior

Image
Originally created by @ly18047121713 on GitHub (Dec 17, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce use docker compose --profile postgresql up -d start failure ### ✔️ Expected Behavior use docker compose --profile postgresql up -d start failure ### ❌ Actual Behavior <img width="1914" height="680" alt="Image" src="https://github.com/user-attachments/assets/43b3481c-b6ae-4546-ae90-94fd666fb613" />
yindo added the 🐞 bug label 2026-02-21 20:10:49 -05:00
yindo closed this issue 2026-02-21 20:10:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 17, 2025):

Hi @ly18047121713! I'm Dosu and I’m helping the dify team.

Your startup failure is caused by a mismatch in the expected PostgreSQL hostname. Dify's Docker Compose setup defines the PostgreSQL service as db_postgres, not db. If your DB_HOST is set to db, containers won't be able to resolve the database service, leading to the DNS error and connection failure you see in the logs. Update your .env or middleware.env file so that DB_HOST=db_postgres, and make sure your docker-compose.yml references db_postgres as the service name for PostgreSQL connections. See the relevant config and recent changes here: docker-compose.yaml, PR #29092.

For starting services, use the recommended command:

docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d

This loads the correct profiles automatically via COMPOSE_PROFILES in middleware.env, so you don't need to specify --profile manually PR #28541.

To check if the PostgreSQL container is healthy, run:

docker compose ps
docker compose logs db_postgres

To resolve the locale warnings, set LANG and LC_ALL to en_US.UTF-8 in your environment or .env file.

If you still have issues, please share your .env and docker-compose.yml (redact secrets) for further help.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 17, 2025): <!-- Greeting --> Hi @ly18047121713! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Your startup failure is caused by a mismatch in the expected PostgreSQL hostname. Dify's Docker Compose setup defines the PostgreSQL service as db_postgres, not db. If your DB_HOST is set to db, containers won't be able to resolve the database service, leading to the DNS error and connection failure you see in the logs. Update your .env or middleware.env file so that DB_HOST=db_postgres, and make sure your docker-compose.yml references db_postgres as the service name for PostgreSQL connections. See the relevant config and recent changes here: [docker-compose.yaml](https://github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/docker-compose.yaml#L57-L862), [PR #29092](https://github.com/langgenius/dify/pull/29092). For starting services, use the recommended command: ``` docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d ``` This loads the correct profiles automatically via COMPOSE_PROFILES in middleware.env, so you don't need to specify --profile manually [PR #28541](https://github.com/langgenius/dify/pull/28541). To check if the PostgreSQL container is healthy, run: ``` docker compose ps docker compose logs db_postgres ``` To resolve the locale warnings, set LANG and LC_ALL to en_US.UTF-8 in your environment or .env file. If you still have issues, please share your .env and docker-compose.yml (redact secrets) for further help. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/431be312-5060-4f3c-856f-77c27866bc37?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Your%20startup%20failure%20is%20caused%20by%20a%20mismatch%20in%20the%20expected%20PostgreSQL%20hostname.%20Dify%27s%20Docker%20Compose%20setup%20defines%20the%20PostgreSQL%20service%20as%20db_postgres%2C%20not%20db.%20If%20your%20DB_HOST%20is%20set%20to%20db%2C%20containers%20won%27t%20be%20able%20to%20resolve%20the%20database%20service%2C%20leading%20to%20the%20DNS%20error%20and%20connection%20failure%20you%20see%20in%20the%20logs.%20Update%20your%20.env%20or%20middleware.env%20file%20so%20that%20DB_HOST%3Ddb_postgres%2C%20and%20make%20sure%20your%20docker-compose.yml%20references%20db_postgres%20as%20the%20service%20name%20for%20PostgreSQL%20connections.%20See%20the%20relevant%20config%20and%20recent%20changes%20here%3A%20%5Bdocker-compose.yaml%5D%28https%3A//github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/docker-compose.yaml%23L57-L862%29%2C%20%5BPR%20%2329092%5D%28https%3A//github.com/langgenius/dify/pull/29092%29.%0A%0AFor%20starting%20services%2C%20use%20the%20recommended%20command%3A%0A%60%60%60%0Adocker%20compose%20--env-file%20middleware.env%20-f%20docker-compose.middleware.yaml%20-p%20dify%20up%20-d%0A%60%60%60%0AThis%20loads%20the%20correct%20profiles%20automatically%20via%20COMPOSE_PROFILES%20in%20middleware.env%2C%20so%20you%20don%27t%20need%20to%20specify%20--profile%20manually%20%5BPR%20%2328541%5D%28https%3A//github.com/langgenius/dify/pull/28541%29.%0A%0ATo%20check%20if%20the%20PostgreSQL%20container%20is%20healthy%2C%20run%3A%0A%60%60%60%0Adocker%20compose%20ps%0Adocker%20compose%20logs%20db_postgres%0A%60%60%60%0A%0ATo%20resolve%20the%20locale%20warnings%2C%20set%20LANG%20and%20LC_ALL%20to%20en_US.UTF-8%20in%20your%20environment%20or%20.env%20file.%0A%0AIf%20you%20still%20have%20issues%2C%20please%20share%20your%20.env%20and%20docker-compose.yml%20%28redact%20secrets%29%20for%20further%20help.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29797)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21113