mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
* 🚨 fix: Critical Redis CA file handling bug that could crash app 🔧 Added safe error handling for Redis CA certificate file reading in cacheConfig.js ## 🐛 Problem - fs.readFileSync() was called directly without error handling - Missing or inaccessible REDIS_CA files would throw unhandled exceptions - 💥 Application would crash during startup with cryptic filesystem errors - ❌ No validation of file existence before attempting to read ## ✅ Solution - ➕ Added getRedisCA() helper function with comprehensive error handling - 🔍 Implemented fs.existsSync() check before file reading attempts - 🛡️ Added try-catch block to handle filesystem errors gracefully - 📝 Added informative warning/error logging for troubleshooting - 🔄 Function returns null safely on any error condition ## 🎯 Benefits - 🚫 Prevents application crashes from misconfigured CA certificate paths - 🔍 Provides clear error messages for debugging certificate issues - ✅ Maintains backward compatibility for valid certificate configurations - 🚀 Improves production stability and deployment reliability ## 🧪 Testing Results - ✅ Verified handling of missing REDIS_CA environment variable - ✅ Tested with non-existent file paths (returns null with warning) - ✅ Confirmed valid certificate files are read correctly - ✅ Validated error handling for permission/access issues 🎉 This fix ensures LibreChat continues running regardless of Redis CA certificate configuration problems, improving overall system reliability. 🏷️ Type: 🐛 Bug Fix 📊 Impact: 🔴 High (prevents application crashes) 🎯 Area: Cache Configuration, Redis Integration * chore: Redis CA certificate handling with proper logging + JSDocs * chore: Improve error logging for Redis CA certificate file read failure --------- Co-authored-by: Danny Avila <danny@librechat.ai> |
||
|---|---|---|
| .. | ||
| banViolation.js | ||
| banViolation.spec.js | ||
| cacheConfig.js | ||
| cacheConfig.spec.js | ||
| cacheFactory.js | ||
| cacheFactory.spec.js | ||
| clearPendingReq.js | ||
| getLogStores.js | ||
| index.js | ||
| keyvFiles.js | ||
| keyvMongo.js | ||
| logViolation.js | ||
| redisClients.js | ||