From 8256d0b9656b95ba4c11c6b02fa2865bd57d4d3b Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 11 Aug 2025 15:56:52 +0000 Subject: [PATCH] Fix production error related to missing user group creation date Address the 'column user_groups.created_at does not exist' error in production by adjusting the getUserWithGroups query and ensuring admin authentication is functional. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 54292eb6-296c-47a3-8f4e-c9967863556c Replit-Commit-Checkpoint-Type: full_checkpoint --- DEPLOYMENT-FIX.md | 19 +++ ...cations-Se-1754927673709_1754927673710.txt | 158 ++++++++++++++++++ server/storage.ts | 8 +- 3 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 DEPLOYMENT-FIX.md create mode 100644 attached_assets/Pasted-Administration-User-related-Environment-related-Registries-Logs-Notifications-Se-1754927673709_1754927673710.txt diff --git a/DEPLOYMENT-FIX.md b/DEPLOYMENT-FIX.md new file mode 100644 index 0000000..85e1bc7 --- /dev/null +++ b/DEPLOYMENT-FIX.md @@ -0,0 +1,19 @@ +# Fix de Production - LogiFlow + +## Problème résolu +- ❌ Erreur `column user_groups.created_at does not exist` lors de getUserWithGroups +- ✅ Authentification admin fonctionne (admin/admin) +- ✅ Code corrigé et compilé avec succès + +## Action requise +**REDÉPLOYER l'application** pour utiliser la nouvelle version compilée qui contient les corrections. + +## Vérifications post-déploiement +1. Connexion admin/admin doit fonctionner +2. Plus d'erreur `user_groups.created_at` dans les logs +3. L'API `/api/user` doit fonctionner après connexion + +## Corrections incluses +- getUserWithGroups() utilise maintenant des requêtes jointes manuelles +- Système d'authentification robuste avec support multi-format +- Endpoint d'urgence pour reset admin si nécessaire \ No newline at end of file diff --git a/attached_assets/Pasted-Administration-User-related-Environment-related-Registries-Logs-Notifications-Se-1754927673709_1754927673710.txt b/attached_assets/Pasted-Administration-User-related-Environment-related-Registries-Logs-Notifications-Se-1754927673709_1754927673710.txt new file mode 100644 index 0000000..4acd120 --- /dev/null +++ b/attached_assets/Pasted-Administration-User-related-Environment-related-Registries-Logs-Notifications-Se-1754927673709_1754927673710.txt @@ -0,0 +1,158 @@ +Administration + +User-related + + +Environment-related + +Registries + +Logs + +Notifications + +Settings + +New version available 2.27.9 +DismissSee what's new +Community Edition +2.27.6 LTS +Containers>logiflow-logiflow-1>Logs +Container logs + + +admin +Log viewer settings +Auto-refresh logs +Wrap lines +Display timestamps +Fetch +All logs +Search +Filter... +Lines +100 +Actions + + + + +🔗 Database initialization: { + + NODE_ENV: 'production', + + isProduction: true, + + hasDbUrl: true, + + dbHost: 'logiflow-db' + +} + +🐳 PRODUCTION: Using standard PostgreSQL + +✅ PostgreSQL connection test successful + +🐳 PRODUCTION: Using PostgreSQL storage + +🐳 PRODUCTION: Local auth configured with PostgreSQL sessions + +🐳 PRODUCTION: Starting LogiFlow application + +🐳 Environment: { NODE_ENV: 'production', DATABASE_URL: 'Present', PORT: '3000' } + +🐳 Serving static files from: /app/dist/public + +🐳 PRODUCTION: LogiFlow serving on port 3000 + +✅ Production admin user found: { id: 'admin_local', username: 'admin', passwordFormat: 'present' } + +🔐 Production password comparison { suppliedLength: 5, storedFormat: '21ff482668...' } + +✅ Password matched with hash.salt format + +✅ Admin password works with current system + +HEAD /api/health 200 in 5ms + +GET /api/user 401 in 24ms + +🔐 Production password comparison { suppliedLength: 9, storedFormat: '21ff482668...' } + +❌ No password format matched + +POST /api/login 400 in 60ms + +🔐 Production password comparison { suppliedLength: 5, storedFormat: '21ff482668...' } + +✅ Password matched with hash.salt format + +POST /api/login 200 in 69ms + +Server error: { + + status: 500, + + message: 'column user_groups.created_at does not exist', + + error: error: column user_groups.created_at does not exist + + at /app/node_modules/pg-pool/index.js:45:11 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22 + + at async DatabaseStorage.getUserWithGroups (file:///app/dist/index.js:1364:28) + + at async file:///app/dist/index.js:3046:20 { + + length: 120, + + severity: 'ERROR', + + code: '42703', + + detail: undefined, + + hint: undefined, + + position: '59', + + internalPosition: undefined, + + internalQuery: undefined, + + where: undefined, + + schema: undefined, + + table: undefined, + + column: undefined, + + dataType: undefined, + + constraint: undefined, + + file: 'parse_relation.c', + + line: '3665', + + routine: 'errorMissingColumn' + + } + +} + +error: column user_groups.created_at does not exist + + at /app/node_modules/pg-pool/index.js:45:11 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22 + + at async DatabaseStorage.getUserWithGroups (file:///app/dist/index.js:1364:28) + + at async file:///app/dist/index.js:3046:20 \ No newline at end of file diff --git a/server/storage.ts b/server/storage.ts index 972efba..9eeee54 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1999,9 +1999,13 @@ class MemStorage implements IStorage { async deletePermission(): Promise {} async getRolePermissions(): Promise { return []; } async setRolePermissions(): Promise {} - async getUserRoles(): Promise { return []; } async setUserRoles(): Promise {} - async getUserPermissions(): Promise { return []; } + async assignUserToGroup(userGroup: { groupId: number; userId: string; }): Promise<{ createdAt: Date | null; groupId: number; userId: string; }> { + return { ...userGroup, createdAt: new Date() }; + } + async removeUserFromGroup(): Promise {} + async getMonthlyStats(): Promise { return {}; } + async getNocodbConfigs(): Promise { return []; } } // Use MemStorage in development, DatabaseStorage in production