From 14900940c5656077c44552589e86d88f25cfc1a2 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sun, 2 Nov 2025 22:17:10 +0100 Subject: [PATCH] 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 --- src/Framework/Core/AppBootstrapper.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Framework/Core/AppBootstrapper.php b/src/Framework/Core/AppBootstrapper.php index 649e481a..f89fed22 100644 --- a/src/Framework/Core/AppBootstrapper.php +++ b/src/Framework/Core/AppBootstrapper.php @@ -52,7 +52,27 @@ final readonly class AppBootstrapper $env = $this->initializeEnvironment(); 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("------------------------------------"); // Make Environment available throughout the application