Skip to content

Docker service env overrides are ignored and plugin daemon misses connection defaults #45358

Closed

Description

@laipz8200

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 at 5e3edb5f34; the default Compose services use Dify 1.18.0 images.

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In a clean checkout at the revision above:

  1. Copy docker/.env.example to docker/.env, leaving optional service overrides absent.
  2. Copy docker/envs/infrastructure/nginx.env.example to nginx.env in the same directory and set NGINX_CLIENT_MAX_BODY_SIZE=200M.
  3. Copy docker/envs/core-services/sandbox.env.example to sandbox.env in the same directory and set SANDBOX_WORKER_TIMEOUT=120.
  4. Run docker compose config --format json from docker/ with a recent Compose release and inspect the nginx, sandbox, and plugin daemon environments.

✔️ Expected Behavior

Users can copy the root .env.example to .env, fill in the necessary deployment inputs, and start with plain docker compose up -d.

Categorized service defaults load automatically. Users can customize a service by copying its defaults file to the existing service .env path and editing that copy. Root .env overrides service settings, and its example remains limited to required manual inputs. No extra root configuration template or --env-file option is needed.

The nginx limit becomes 200M, the sandbox's native WORKER_TIMEOUT becomes 120, and the plugin daemon receives the bundled database and Redis connection defaults.

❌ Actual Behavior

  • nginx does not load its categorized env file, so its upload limit remains 100M.
  • The sandbox's explicit Compose environment mapping resolves SANDBOX_WORKER_TIMEOUT before service env files are read and overrides their values, leaving WORKER_TIMEOUT=15.
  • The same pattern affects web, plugin daemon, Agent backend, infrastructure, and vector-store settings, including values translated into different container variable names.
  • Database startup commands and some health checks also interpolate project variables before service env files are loaded.
  • After refactor(tracing): one trace pipeline behind a minimal provider interface #44673 moved Docker connection defaults out of the minimal root template, plugin_daemon did not include shared.defaults. Its clean deployment environment omits the intended database and Redis connection values.
  • The default local Agent sandbox requires an authentication token, but the minimal startup template does not expose that required input.

This follows the categorized env layout introduced in #31586 and the overlapping configuration-ownership concerns in #43702. The fix should retain the small root template, make copied service files effective, and clearly identify Compose-level settings such as ports, volumes, and profiles that must remain root .env inputs.

Activity

  1. added this to the 1.19.0 milestone on Nov 2, 2026
  2. added
    🐞 bug
    on Nov 2, 2026
  3. dosubot commented on Nov 2, 2026

    @dosubot

    There is another related report worth linking: #40415 describes service-file overrides being ignored by ssrf_proxy. Its follow-up proposes regression checks for override precedence and preventing unrelated root secrets from entering the proxy container. That is a useful constraint here: loading the whole root .env into every infrastructure service would address some overrides but broaden secret exposure. [1]

    Two implementation details matter for this fix:

    • generate_docker_compose copies the Compose template, but its default mode also creates missing categorized .env files. --compose-only skips that creation. I would test the clean-checkout path separately from generation with those files present, so generation does not mask missing bundled defaults. [2] [3]
    • NGINX_PORT and NGINX_SSL_PORT are used both inside the container and in Compose port mappings. Unlike the upload limit, moving their configuration entirely into a service env file would leave the host mapping unresolved from that file. These need explicit ownership as Compose-level inputs. [4]

    Adding shared.defaults alone also would not fix renamed settings: the sandbox still maps SANDBOX_WORKER_TIMEOUT to WORKER_TIMEOUT through Compose interpolation. That translation needs coverage alongside the env-file layering. [5]

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

  4. self-assigned this
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

project#dify🐞 bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions