Skip to content

fix(server): treat empty-string env vars as unset in config validation - #3

Draft
dnplkndll wants to merge 1 commit into
mainfrom
fix/server-empty-env-vars-as-unset
Draft

fix(server): treat empty-string env vars as unset in config validation#3
dnplkndll wants to merge 1 commit into
mainfrom
fix/server-empty-env-vars-as-unset

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Jul 26, 2026

Copy link
Copy Markdown

PRACTICE PR on fork — for quality review before filing upstream. Do not merge.

Addresses failure mode (1) of twentyhq#21035.

Compose passes VAR: ${VAR} for many optional variables, so any var unset on
the host reaches the server as '' — and boot validation rejects it instead of
applying the documented default:

$ docker run --rm -e STORAGE_TYPE='' ... twentycrm/twenty:latest
ERROR STORAGE_TYPE must be one of the following values:
ERROR [ExceptionHandler] ConfigVariableException [Error]: Config variables validation failed

validate() now strips empty-string entries before plainToClass (matching
compose's own "empty means unset" semantics) and logs which vars were treated
as unset. Explicit invalid non-empty values still fail as before.

Tests: valid value honored, compose-shaped batch of empties → defaults,
invalid non-empty still throws. Full twenty-config module: 198/198.

…AR: ${VAR}` lines fall back to defaults instead of failing validation (twentyhq#21035)
@dnplkndll
dnplkndll force-pushed the fix/server-empty-env-vars-as-unset branch from 365379d to 2dc5aeb Compare July 26, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant