NeonN
Neon2y ago
6 replies
primary-violet

NeonDbError: Console request failed with 422 Unprocessable Entity: active endpoints limit exceeded

Intermittently getting the following error messages in my logs for my production application:

NeonDbError: Console request failed with 422 Unprocessable Entity: active endpoints limit exceeded

Not sure why this is happening and how I can prevent it from happening.

import { NeonHttpDatabase, drizzle } from 'drizzle-orm/neon-http';
import { neon } from '@neondatabase/serverless';

  const url = `postgresql://${process.env.PGUSER}:${process.env.PGPASSWORD}@${host}/${process.env.USER_DB}?sslmode=require`;
  const sql = neon(url);
  return drizzle(sql);

This is how I'm connecting but I also am connecting this way when running migrations:

import { drizzle } from 'drizzle-orm/neon-http';
import { neon } from '@neondatabase/serverless';
import { drizzle as pgDrizzle } from 'drizzle-orm/node-postgres';
import { migrate as pgMigrate } from 'drizzle-orm/node-postgres/migrator';
import { Pool } from 'pg';

 const connectionString = `postgresql://${pgUser}:${pgPassword}@${user.host}/${userDb}?sslmode=require`;

const pgPool = new Pool({
  connectionString,
  max: 1,
});

try {
  const client = await pgPool.connect();
  client.release();


Please help 🙂
Was this page helpful?