LibreChat/api
Real Null 26a58fcabc
🚨 fix: Redis CA file handling (#9692)
* 🚨 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>
2025-09-18 20:33:40 -04:00
..
app 🎚️ feat: Anthropic Parameter Set Support via Custom Endpoints (#9415) 2025-09-08 14:35:29 -04:00
cache 🚨 fix: Redis CA file handling (#9692) 2025-09-18 20:33:40 -04:00
config 💫 feat: MCP OAuth Auto-Reconnect (#9646) 2025-09-17 16:49:36 -04:00
db 🍃 feat: Add MongoDB Connection Pool Configuration Options (#8537) 2025-08-13 16:24:17 -04:00
lib/utils 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
models 🔄 refactor: Convert OCR Tool Resource to Context (#9699) 2025-09-18 20:06:59 -04:00
server 🔄 refactor: Convert OCR Tool Resource to Context (#9699) 2025-09-18 20:06:59 -04:00
strategies 🔒 refactor: Optimize Email Domain Validation in OpenID, SAML, and Social Logins (#9567) 2025-09-11 01:01:58 -04:00
test 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
utils 🎚️ feat: Anthropic Parameter Set Support via Custom Endpoints (#9415) 2025-09-08 14:35:29 -04:00
jest.config.js 🏪 feat: Agent Marketplace 2025-08-13 16:24:18 -04:00
jsconfig.json feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
package.json v0.8.0-rc4 (#9601) 2025-09-12 13:37:10 -04:00
typedefs.js 🔃 fix: Refresh Token Edge Cases (#9625) 2025-09-13 21:36:45 -04:00