Connection terminated unexpectedly

I am all of a sudden starting to get errors thrown that state "Connection terminated unexpectedly" - I've updated to drizzle-orm 0.38.4 and am still seeing these issues. I am not sure if this is a drizzle, postgres driver or database issue. Anyone have any ideas?
import * as dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';

import * as allSchemas from './schema';

dotenv.config();

const connectionString = `postgresql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_NAME}`;

export const schema = { ...allSchemas };

const pool = new Pool({
connectionString,
});


export const db = drizzle({ client: pool, schema });
import * as dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';

import * as allSchemas from './schema';

dotenv.config();

const connectionString = `postgresql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_NAME}`;

export const schema = { ...allSchemas };

const pool = new Pool({
connectionString,
});


export const db = drizzle({ client: pool, schema });
Error: Connection terminated unexpectedly
a/node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file://node_modules/src/node-postgres/session.ts:104:19
at parseAuthToken (/middleware/auth.ts:30:18)
caught in 401
[AppError]: An unexpected error occurred
Error: Connection terminated unexpectedly
at /node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:node_modules/src/node-postgres/session.ts:104:19
Error: Connection terminated unexpectedly
a/node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file://node_modules/src/node-postgres/session.ts:104:19
at parseAuthToken (/middleware/auth.ts:30:18)
caught in 401
[AppError]: An unexpected error occurred
Error: Connection terminated unexpectedly
at /node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:node_modules/src/node-postgres/session.ts:104:19
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?