Skip to content

[Bug]: Config cached in Redis not refreshed on container restart / env var change #11953

@andormarkus

Description

@andormarkus

What happened?

When running LibreChat with USE_REDIS=true in an AWS ECS Fargate (multi-instance) deployment, changes to environment variables like ALLOW_EMAIL_LOGIN, ALLOW_SOCIAL_LOGIN, etc. are not reflected in the application after redeployment, even though the container's env output confirms the new values are set.

The root cause is that CONFIG_STORE and APP_CONFIG cache namespaces are stored in Redis and served from the shared cache rather than being re-read from the current process environment. A new container with updated env vars still reads stale config from Redis until the cache TTL expires (or Redis is flushed).

Version Information

ghcr.io/danny-avila/librechat-dev:latest

Steps to Reproduce

  1. Deploy LibreChat with USE_REDIS=true and ALLOW_EMAIL_LOGIN=false (or any auth-related env var)
  2. Confirm the UI reflects the setting (e.g., email login is hidden)
  3. Update the env var to ALLOW_EMAIL_LOGIN=true and redeploy (new ECS task / new container)
  4. Exec into the new container and verify: env | grep ALLOW_EMAIL_LOGIN → shows true
  5. Open the UI → email login is still not shown (stale cached config from Redis)
  6. Adding CONFIG_STORE,APP_CONFIG to FORCED_IN_MEMORY_CACHE_NAMESPACES and redeploying fixes the issue

What browsers are you seeing the problem on?

No response

Relevant log output

No relevant error logs — the application does not log a warning when serving cached config
that differs from the current environment variables.

Container env confirms the correct values:

$ env | grep -E "ALLOW_|CONFIG_|FORCED_|USE_REDIS"
ALLOW_EMAIL_LOGIN=true
ALLOW_SOCIAL_LOGIN=true
ALLOW_REGISTRATION=true
CONFIG_PATH=/app/librechat/config/librechat-custom.yaml
FORCED_IN_MEMORY_CACHE_NAMESPACES=ROLES,MESSAGES
USE_REDIS=true

Despite ALLOW_EMAIL_LOGIN=true being set, the login page only shows the SSO/OpenID button
until CONFIG_STORE,APP_CONFIG is added to FORCED_IN_MEMORY_CACHE_NAMESPACES.

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions