When starting the middleware using middleware.env, the database container is not pulled. #20493

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

Originally created by @ACAne0320 on GitHub (Nov 22, 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

main

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

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

In #28188 , only the .env.example file includes the COMPOSE_PROFILES=${DB_TYPE:-postgresql} parameter.
This prevents middleware.env from reading the correct profile parameters, resulting in the database container failing to be pulled.

✔️ Expected Behavior

All middleware containers should start normally.

Actual Behavior

The database container has not been pulled.

Originally created by @ACAne0320 on GitHub (Nov 22, 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 main ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Execute `docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d` In #28188 , only the `.env.example` file includes the `COMPOSE_PROFILES=${DB_TYPE:-postgresql}` parameter. This prevents `middleware.env` from reading the correct profile parameters, resulting in the database container failing to be pulled. ### ✔️ Expected Behavior All middleware containers should start normally. ### ❌ Actual Behavior The database container has not been pulled.
yindo added the 🐞 bug label 2026-02-21 20:07:41 -05:00
yindo closed this issue 2026-02-21 20:07:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 22, 2025):

The database container isn't being pulled because the middleware.env file does not set the COMPOSE_PROFILES environment variable. Docker Compose uses profiles to determine which services to start, and the database containers in docker-compose.middleware.yaml are tied to profiles like postgresql or mysql. The .env.example file includes COMPOSE_PROFILES=${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql}, which activates the necessary profiles for both the vector store and the database type, but this is missing from middleware.env source.

To fix this, add the following line to your middleware.env file (adjust values as needed for your setup):

COMPOSE_PROFILES=${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql}

This will ensure Docker Compose activates the correct profile and pulls/starts the database container as expected source.

It may also help to update documentation or provide a template middleware.env with this variable included to prevent future confusion.

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 (Nov 22, 2025): <!-- Answer --> The database container isn't being pulled because the `middleware.env` file does not set the `COMPOSE_PROFILES` environment variable. Docker Compose uses profiles to determine which services to start, and the database containers in `docker-compose.middleware.yaml` are tied to profiles like `postgresql` or `mysql`. The `.env.example` file includes `COMPOSE_PROFILES=${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql}`, which activates the necessary profiles for both the vector store and the database type, but this is missing from `middleware.env` [source](https://github.com/langgenius/dify/blob/1dfde240cbfe5dcf42028d0331431e0afd813351/docker/.env.example#L233-L1261). To fix this, add the following line to your `middleware.env` file (adjust values as needed for your setup): ``` COMPOSE_PROFILES=${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql} ``` This will ensure Docker Compose activates the correct profile and pulls/starts the database container as expected [source](https://github.com/langgenius/dify/blob/1dfde240cbfe5dcf42028d0331431e0afd813351/docker/docker-compose.middleware.yaml#L2-L74). It may also help to update documentation or provide a template `middleware.env` with this variable included to prevent future confusion. <!-- 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/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/72eba92d-6457-45da-922e-1f922bc566d9?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=The%20database%20container%20isn%27t%20being%20pulled%20because%20the%20%60middleware.env%60%20file%20does%20not%20set%20the%20%60COMPOSE_PROFILES%60%20environment%20variable.%20Docker%20Compose%20uses%20profiles%20to%20determine%20which%20services%20to%20start%2C%20and%20the%20database%20containers%20in%20%60docker-compose.middleware.yaml%60%20are%20tied%20to%20profiles%20like%20%60postgresql%60%20or%20%60mysql%60.%20The%20%60.env.example%60%20file%20includes%20%60COMPOSE_PROFILES%3D%24%7BVECTOR_STORE%3A-weaviate%7D%2C%24%7BDB_TYPE%3A-postgresql%7D%60%2C%20which%20activates%20the%20necessary%20profiles%20for%20both%20the%20vector%20store%20and%20the%20database%20type%2C%20but%20this%20is%20missing%20from%20%60middleware.env%60%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/1dfde240cbfe5dcf42028d0331431e0afd813351/docker/.env.example%23L233-L1261%29.%0A%0ATo%20fix%20this%2C%20add%20the%20following%20line%20to%20your%20%60middleware.env%60%20file%20%28adjust%20values%20as%20needed%20for%20your%20setup%29%3A%0A%0A%60%60%60%0ACOMPOSE_PROFILES%3D%24%7BVECTOR_STORE%3A-weaviate%7D%2C%24%7BDB_TYPE%3A-postgresql%7D%0A%60%60%60%0A%0AThis%20will%20ensure%20Docker%20Compose%20activates%20the%20correct%20profile%20and%20pulls/starts%20the%20database%20container%20as%20expected%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/1dfde240cbfe5dcf42028d0331431e0afd813351/docker/docker-compose.middleware.yaml%23L2-L74%29.%0A%0AIt%20may%20also%20help%20to%20update%20documentation%20or%20provide%20a%20template%20%60middleware.env%60%20with%20this%20variable%20included%20to%20prevent%20future%20confusion.)&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/28540)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20493