Merge pull request #342 from R0m1k3/1.1

Update BAP webhook configuration URL and improve error handling
This commit is contained in:
LogiFlow authored and GitHub committed 2025-09-03 15:54:07 +02:00
commit 5cbfc2cc71
7 files changed
+131 -10

No files matched your search

+1 -1
View File
@@ -37,4 +37,4 @@ args = "npm run dev"
waitForPort = 5000
[agent]
integrations = ["javascript_database==1.0.0", "javascript_object_storage==1.0.0", "javascript_log_in_with_replit==1.0.0"]
integrations = ["javascript_database==1.0.0", "javascript_log_in_with_replit==1.0.0", "javascript_object_storage==1.0.0"]
@@ -0,0 +1,119 @@
❌ [PRODUCTION] User not found with username: admin_local
GET /api/announcements 304 in 214ms
GET /api/groups 304 in 122ms
GET /api/user 304 in 6ms
GET /api/users 304 in 15ms
GET /api/user 304 in 4ms
GET /api/user 304 in 5ms
GET /api/backups 304 in 8ms
❌ Erreur récupération config webhook BAP: error: relation "webhook_bap_config" 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.getWebhookBapConfig (file:///app/dist/index.js:2815:26)
at async file:///app/dist/index.js:12402:22 {
length: 117,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '97',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
⚠️ Table webhook_bap_config n'existe pas, retour config par défaut
constraint: undefined,
GET /api/webhook-bap-config 200 in 8ms
file: 'parse_relation.c',
line: '1392',
routine: 'parserOpenTable'
}
HEAD /api/health 200 in 1ms
🔍 Test webhook BAP: {
url: 'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d'
}
🌐 Réponse test webhook: { status: 404, ok: false }
❌ Erreur test webhook BAP: Error: HTTP 404: Not Found
at file:///app/dist/index.js:12481:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
POST /api/webhook-bap-config/test 500 in 97ms
🔍 Test webhook BAP: {
url: 'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d'
}
❌ Erreur test webhook BAP: Error: HTTP 500: Internal Server Error
at file:///app/dist/index.js:12481:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
🌐 Réponse test webhook: { status: 500, ok: false }
POST /api/webhook-bap-config/test 500 in 65ms
🔍 Test webhook BAP: {
url: 'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d'
}
🌐 Réponse test webhook: { status: 404, ok: false }
❌ Erreur test webhook BAP: Error: HTTP 404: Not Found
at file:///app/dist/index.js:12481:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
POST /api/webhook-bap-config/test 500 in 17ms
HEAD /api/health 200 in 0ms
+1 -1
View File
@@ -112,7 +112,7 @@ export default function Sidebar() {
// Utiliser une URL par défaut si pas de configuration
if (!webhookUrl) {
webhookUrl = "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d";
webhookUrl = "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d";
}
// Fermer le modal de sélection et ouvrir le modal d'attente
+7 -5
View File
@@ -2,18 +2,20 @@ import express, { type Request, Response, NextFunction } from "express";
import { registerRoutes } from "./routes.js";
import { setupVite, serveStatic } from "./vite.js";
// Run database migrations first
// Run database migrations first - FORCER EN PRODUCTION
console.log('🔄 [STARTUP] Running database migrations...');
console.log('🔍 [STARTUP] Environment:', process.env.NODE_ENV);
console.log('🔍 [STARTUP] Has DATABASE_URL:', !!process.env.DATABASE_URL);
try {
const { runMigrations } = await import('./migrations.js');
await runMigrations();
console.log('✅ [STARTUP] Database migrations completed');
} catch (error) {
console.error('❌ [STARTUP] Database migrations failed:', error);
// Ne pas arrêter l'app en développement
if (process.env.NODE_ENV === 'production') {
process.exit(1);
}
console.error('❌ [STARTUP] Error details:', JSON.stringify(error, null, 2));
// NE PAS arrêter l'app pour éviter les boucles de redémarrage
console.warn('⚠️ [STARTUP] Continuing without migrations to avoid restart loop');
}
// Initialize weather system
+1 -1
View File
@@ -51,7 +51,7 @@ export async function runMigrations() {
INSERT INTO webhook_bap_config (name, webhook_url, description, is_active)
SELECT
'Configuration BAP',
'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d',
'https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d',
'Configuration par défaut pour envoi des fichiers BAP vers n8n',
true
WHERE NOT EXISTS (SELECT 1 FROM webhook_bap_config);`
+1 -1
View File
@@ -95,7 +95,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
return res.json({
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
webhookUrl: "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut (table non créée)",
isActive: true,
needsTableCreation: true
+1 -1
View File
@@ -3896,7 +3896,7 @@ export class MemStorage implements IStorage {
return {
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
webhookUrl: "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut pour développement",
isActive: true,
createdAt: new Date(),