debug: Add logging for all *_FILE environment variables

- Log all *_FILE variables from getenv() and $_ENV
- Help diagnose why REDIS_PASSWORD_FILE is not set
- Check if other *_FILE variables are present
This commit is contained in:
2025-11-02 22:38:27 +01:00
parent 3f7c6e79fb
commit 73de91c2d3

View File

@@ -74,6 +74,23 @@ final readonly class AppBootstrapper
error_log("\$_SERVER['REDIS_PASSWORD_FILE']: " . $_SERVER['REDIS_PASSWORD_FILE']); error_log("\$_SERVER['REDIS_PASSWORD_FILE']: " . $_SERVER['REDIS_PASSWORD_FILE']);
} }
// Check all *_FILE variables
error_log("------ ALL *_FILE VARIABLES ------");
$allEnvVars = getenv();
if ($allEnvVars !== false) {
foreach ($allEnvVars as $key => $value) {
if (str_ends_with($key, '_FILE')) {
error_log("$key: $value");
}
}
}
error_log("------ \$_ENV *_FILE VARIABLES ------");
foreach ($_ENV as $key => $value) {
if (is_string($key) && str_ends_with($key, '_FILE')) {
error_log("$key: $value");
}
}
// Check if file exists at expected location // Check if file exists at expected location
$expectedFile = '/run/secrets/redis_password'; $expectedFile = '/run/secrets/redis_password';
error_log("Expected file path: $expectedFile"); error_log("Expected file path: $expectedFile");