symfony-health-check-bundle
symfony-health-check-bundle copied to clipboard
Redis DSN configuration error when Redis is not used
Describe the bug Since version 1.6.0, symfony-health-check-bundle has added a test on Redis. When Redis is not configured (i.e., no DSN is provided), the container fails to compile because the RedisCheck service receives null instead of a string. This leads to an error in the linter.
To Reproduce
- Install symfony-health-check-bundle version 1.6.0 or later.
- Do not configure Redis (i.e., do not define a DSN for Redis).
- Run a container lint check (e.g., using "docker compose exec php symfony lint:container").
- Observe the error indicating that null was passed where a string was expected by RedisCheck::__construct().
Expected behavior The bundle should either not register the RedisCheck service when Redis is not being used, or it should handle a missing DSN gracefully, so that the container compiles without errors.
Screenshots
My config
symfony_health_check:
health_checks:
- id: Surface\Core\Health\Check\GotenbergCheck
- id: Surface\Core\Health\Check\PostgresqlCheck
health_error_response_code: 500