debug: Add Docker Secrets debugging to AppBootstrapper
- Add debug logging for REDIS_PASSWORD_FILE and REDIS_PASSWORD - Check if REDIS_PASSWORD_FILE exists and has correct value - Check if secret file exists and is readable - Help diagnose why REDIS_PASSWORD_FILE is not in logs
This commit is contained in:
@@ -52,7 +52,27 @@ final readonly class AppBootstrapper
|
|||||||
$env = $this->initializeEnvironment();
|
$env = $this->initializeEnvironment();
|
||||||
|
|
||||||
error_log("------ ENVIRONMENT VARIABLES ------");
|
error_log("------ ENVIRONMENT VARIABLES ------");
|
||||||
error_log(print_r($env->all(), true));
|
error_log(print_r($env->all(true), true));
|
||||||
|
error_log("------------------------------------");
|
||||||
|
|
||||||
|
// Debug: Check for specific Docker Secrets
|
||||||
|
error_log("------ DOCKER SECRETS DEBUG ------");
|
||||||
|
error_log("REDIS_PASSWORD_FILE exists: " . ($env->has('REDIS_PASSWORD_FILE') ? 'YES' : 'NO'));
|
||||||
|
error_log("REDIS_PASSWORD_FILE value: " . ($env->get('REDIS_PASSWORD_FILE') ?? 'NOT SET'));
|
||||||
|
error_log("REDIS_PASSWORD resolved: " . ($env->has('REDIS_PASSWORD') ? 'YES' : 'NO'));
|
||||||
|
error_log("REDIS_PASSWORD value: " . (empty($env->get('REDIS_PASSWORD')) ? 'EMPTY' : 'SET'));
|
||||||
|
|
||||||
|
// Check if file exists
|
||||||
|
$redisPasswordFile = $env->get('REDIS_PASSWORD_FILE');
|
||||||
|
if ($redisPasswordFile && is_string($redisPasswordFile)) {
|
||||||
|
error_log("REDIS_PASSWORD_FILE path: $redisPasswordFile");
|
||||||
|
error_log("File exists: " . (file_exists($redisPasswordFile) ? 'YES' : 'NO'));
|
||||||
|
error_log("File readable: " . (is_readable($redisPasswordFile) ? 'YES' : 'NO'));
|
||||||
|
if (file_exists($redisPasswordFile) && is_readable($redisPasswordFile)) {
|
||||||
|
$content = file_get_contents($redisPasswordFile);
|
||||||
|
error_log("File content length: " . strlen($content ?? ''));
|
||||||
|
}
|
||||||
|
}
|
||||||
error_log("------------------------------------");
|
error_log("------------------------------------");
|
||||||
|
|
||||||
// Make Environment available throughout the application
|
// Make Environment available throughout the application
|
||||||
|
|||||||
Reference in New Issue
Block a user