- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
2.6 KiB
DBIS Source Code Fixes - Complete
Date: 2026-01-03
Status: ✅ PATH RESOLUTION FIXED - Environment variable issue resolved
Problems Resolved
1. ✅ Module Resolution (FIXED)
Issue: MODULE_NOT_FOUND: Cannot find module '@shared/config/env'
Solution: Created custom path resolver in /opt/dbis-core/dist/index-runtime.js that maps TypeScript path aliases directly to the dist directory structure.
Status: ✅ RESOLVED - Service now progresses past module resolution errors.
2. ✅ Environment Variable (FIXED)
Issue: Invalid environment variable JWT_SECRET: JWT_SECRET must be at least 32 characters long
Solution: Updated .env file to have an actual JWT_SECRET value instead of the shell command $(openssl rand -hex 32).
Status: ✅ RESOLVED - JWT_SECRET now has a proper value.
Solutions Applied
Custom Path Resolver
Created /opt/dbis-core/dist/index-runtime.js that:
- Intercepts Node.js module resolution
- Maps path aliases (
@/,@/shared/,@/core/, etc.) todist/*directories - Handles file extensions (
.js,.json) and directory indexes - Falls back to original Node.js resolution
Environment Variable Fix
Updated .env files to have proper JWT_SECRET values:
- VMID 10150: JWT_SECRET generated and set
- VMID 10151: JWT_SECRET generated and set
Files Modified
/opt/dbis-core/dist/index-runtime.js- Custom path resolver (created)/opt/dbis-core/.env- JWT_SECRET updated (VMID 10150, 10151)/etc/systemd/system/dbis-api.service- ExecStart updated to useindex-runtime.js
Verification
After fixes:
-
Service Status:
ssh root@192.168.11.10 "pct exec 10150 -- systemctl status dbis-api" -
Logs:
ssh root@192.168.11.10 "pct exec 10150 -- journalctl -u dbis-api -n 50" -
Port Listening:
ssh root@192.168.11.10 "pct exec 10150 -- ss -tln | grep 3000" -
Health Endpoint:
curl http://192.168.11.155:3000/health
Applied To
- ✅ VMID 10150 (API Primary)
- ✅ VMID 10151 (API Secondary)
Summary
✅ Module resolution: Fixed with custom path resolver
✅ Environment variables: JWT_SECRET properly configured
✅ Service configuration: Updated to use runtime entry point
✅ Both containers: Changes applied to primary and secondary
Status: Source code issues resolved. Service should now start successfully (pending any additional runtime errors like database connectivity).
Last Updated: 2026-01-03