N
Neon14mo ago
continuing-cyan

SASL connection issues

I'm experiencing intermittent connection issues with my Neon using Drizzle and Next.js. When i'm not using connection pooling, I sometimes get a password authentication failed for user error. When using pooling, I encounter a SASL authentication failed error. I have 2 schemas with different users to manage user update in one schema and 2 users to manage payment in another private schema. The connection works sometimes but fails at other times(when not pooling). Can anyone provide guidance on how to resolve these authentication and connection issues? i've checked my connection string and made sure im copying it just like it is. this is how i'm using them for reference
const userManagerSql = neon(process.env.DATABASE_URL_USER_MANAGER!);
const paymentManagerSql = neon(process.env.DATABASE_URL_PAYMENT_MANAGER!);
const platformManagerSql = neon(process.env.DATABASE_URL_PLATFORM_MANAGER!);

export const userDb = drizzle(userManagerSql, {
schema: {
user,
account,
session,
},
logger: true,
});

export const paymentDb = drizzle(paymentManagerSql, {
schema: {
payments,
credits,
},
logger: true,
});

export const pricingDb = drizzle(platformManagerSql, {
schema: {
servicePricing,
creditPlans,
},
logger: true,
});
const userManagerSql = neon(process.env.DATABASE_URL_USER_MANAGER!);
const paymentManagerSql = neon(process.env.DATABASE_URL_PAYMENT_MANAGER!);
const platformManagerSql = neon(process.env.DATABASE_URL_PLATFORM_MANAGER!);

export const userDb = drizzle(userManagerSql, {
schema: {
user,
account,
session,
},
logger: true,
});

export const paymentDb = drizzle(paymentManagerSql, {
schema: {
payments,
credits,
},
logger: true,
});

export const pricingDb = drizzle(platformManagerSql, {
schema: {
servicePricing,
creditPlans,
},
logger: true,
});
PS im using Bun for runtime but i've verified that isnt the problem since i ran everything through node previously
3 Replies
wise-white
wise-white14mo ago
Hey @wemsamuel, Can you share the error screenshots?
continuing-cyan
continuing-cyanOP14mo ago
No description
stormy-gold
stormy-gold14mo ago
We've occasionally seen these issues if your username or database name contains spaces of some kind. Although it being inconsistent is very unusual. Could you DM me your database URL (removing the password) and I can search through the logs once I start work tomorrow. Thanks

Did you find this page helpful?