N
Neon2y ago
stormy-gold

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);
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();
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 🙂
5 Replies
other-emerald
other-emerald2y ago
active endpoints limit exceeded This suggests you have too many branches/endpoints active, so the endpoint (defined by your connection string) cannot start.
stormy-gold
stormy-goldOP2y ago
how can i see how many branches/endpoints i have active, what the limit is, and how i can ensure this doesnt happen?
extended-salmon
extended-salmon2y ago
Hey, are you on the Pro plan? There's a soft limit of 20 simultaneous active computes on the Pro plan. You can monitor the number of active computes in the Compute widget on the Neon Dashboard (bottom right corner). To avoid this issue, you could remove branches immediately after your done with them. You could also reduce the autosuspend timeout so that computes go idle more quickly. Another option would be to request a higher compute limit from Neon support.
stormy-gold
stormy-goldOP2y ago
Ahhh I see thank you I contacted support. If there’s any way to escalate this internally I would be grateful. We are supporting users in production and we started a big onboarding push this week which we have put on pause now until we are able to support more than 20 concurrent users. 🙏 @Daniel Context being each user has their own branch
other-emerald
other-emerald2y ago
@Barry_Moss support should be able to help 🤗

Did you find this page helpful?