Files
LogiFlow/attached_assets/Pasted--Environment-NODE-ENV-production-DATABASE-URL-Present-PORT-3000-Re-1755164310896_1755164310896.txt
T
michaelschal c734ea0ca2 Update database connection to use standard PG client for migrations
Switches the production migration script from Neon's `neon` client to the standard `pg` client, improving connection robustness and compatibility. Also includes error handling and connection closing for migrations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 31f9bd88-0285-4787-81b3-31ceeea5a08b
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/31f9bd88-0285-4787-81b3-31ceeea5a08b/hP2S4TA
2025-08-14 09:39:37 +00:00

195 lines
4.3 KiB
Plaintext

🐳 Environment: { NODE_ENV: 'production', DATABASE_URL: 'Present', PORT: '3000' }
🔧 Registering all production routes...
🔄 Running automatic production migrations...
🔄 MIGRATION: Starting SAV production migrations...
🔄 MIGRATION: Database URL configured: postgresql://logiflow_admin:Lo...
🔄 MIGRATION: Checking if priority column exists...
❌ MIGRATION ERROR: Failed to run SAV production migrations: NeonDbError: Error connecting to database: fetch failed
at execute (file:///app/node_modules/@neondatabase/serverless/index.mjs:1549:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runProductionMigrations (file:///app/dist/index.js:3263:33)
at async registerProductionRoutes (file:///app/dist/index.js:6321:3)
at async file:///app/dist/index.js:6369:1 {
severity: undefined,
code: undefined,
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: undefined,
line: undefined,
routine: undefined,
sourceError: TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async execute (file:///app/node_modules/@neondatabase/serverless/index.mjs:1548:15)
at async runProductionMigrations (file:///app/dist/index.js:3263:33)
at async registerProductionRoutes (file:///app/dist/index.js:6321:3)
at async file:///app/dist/index.js:6369:1 {
[cause]: Error: connect ECONNREFUSED 172.20.0.10:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '172.20.0.10',
port: 443
}
}
}
❌ MIGRATION ERROR: Error details: {
message: 'Error connecting to database: fetch failed',
code: undefined,
stack: 'NeonDbError: Error connecting to database: fetch failed\n' +
' at execute (file:///app/node_modules/@neondatabase/serverless/index.mjs:1549:24)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async runProductionMigrations (file:///app/dist/index.js:3263:33)\n' +
' at async registerProductionRoutes (file:///app/dist/index.js:6321:3)\n' +
' at async file:///app/dist/index.js:6369:1'
}
node:internal/modules/run_main:123
triggerUncaughtException(
^
NeonDbError: Error connecting to database: fetch failed
at execute (file:///app/node_modules/@neondatabase/serverless/index.mjs:1549:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runProductionMigrations (file:///app/dist/index.js:3263:33)
at async registerProductionRoutes (file:///app/dist/index.js:6321:3)
at async file:///app/dist/index.js:6369:1 {
severity: undefined,
code: undefined,
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: undefined,
line: undefined,
routine: undefined,
sourceError: TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async execute (file:///app/node_modules/@neondatabase/serverless/index.mjs:1548:15)
at async runProductionMigrations (file:///app/dist/index.js:3263:33)
at async registerProductionRoutes (file:///app/dist/index.js:6321:3)
at async file:///app/dist/index.js:6369:1 {
[cause]: Error: connect ECONNREFUSED 172.20.0.10:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '172.20.0.10',
port: 443
}
}
}