mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-17 20:27:10 +02:00
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
This commit is contained in:
1 parent
27ae1a836f
commit
c734ea0ca2
2 files changed
+217
-15
No files matched your search
+195
@@ -0,0 +1,195 @@
|
||||
|
||||
|
||||
🐳 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
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user