N
Neon2y ago
other-emerald

Unable to connect to PGbouncer through NeonDB.

Hello, I'm attempting to connect NeonDB to the PgBouncer Docker image (edoburu/pgbouncer). However, when I try to connect using pgAdmin, I encounter the following error: Unable to connect to server: connection failed: FATAL: Endpoint ID is not specified. Either please upgrade the postgres client library (libpq) for SNI support or pass the endpoint ID (first part of the domain name) as a parameter: '?options=endpoint%3D<endpoint-id>'. See more at https://neon.tech/sni I tried adding the endpoint ID as follows: Python conn = psycopg2.connect( host="localhost", port="6432", dbname="orders", user="xxxxx", password="xxxxxx", options=f'-c endpoint={endpoint_id}' ) But I receive this error instead: Error: connection to server at "localhost" (127.0.0.1), port 6432 failed: FATAL: unsupported startup parameter in options: endpoint I installed PGbouncer both locally and in a Docker container using the 0.0.0.0 host configuration, which is why I'm using host="localhost". I added the NeonDB credentials to both the DATABASE_URL and pgbouncer.ini files, but I'm still facing the same two errors. I created a custom Dockerfile for PGbouncer, upgrading both the libpq file and PostgreSQL to version 15, but the issue remains. Does anyone know how to fix this? docker-compose version: '3.8' services: pgbouncer: image: edoburu/pgbouncer environment: DATABASE_URL: "postgresql://xxxxxxx:xxxxxxxxx@ep-long-tree-a5szmpk2-pooler.us-east-2.aws.neon.tech/orders" volumes: - ./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini - ./userlist.txt:/etc/pgbouncer/userlist.txt ports: - "6432:6432" restart: always
No description
No description
3 Replies
optimistic-gold
optimistic-gold2y ago
Hello, i keep getting this error and i'm using the latest version of Prisma 15.5 Error: P1001: Can't reach database server at ep-shiny-tree-a2cn24ej-pooler.eu-central-1.aws.neon.tech:5432
extended-salmon
extended-salmon2y ago
@MojoDevFour just to check, did you use exactly
options=f'-c endpoint={endpoint_id}'
options=f'-c endpoint={endpoint_id}'
or did you swap in your endpoint_id like
options=f'-c endpoint=ep-cool-darkness-123456'
options=f'-c endpoint=ep-cool-darkness-123456'
oh wait I see you did in the GUI screenshot @MojoDevFour one other thing to check, in your example code you are actually trying to route your own pgbouncer through the Neon pgbouncer. Neon runs pgbouncer on behalf of users, accessed via -pooler versions of URLs https://neon.tech/docs/connect/connection-pooling
other-emerald
other-emeraldOP17mo ago
Okay, got it! Thanks alot @andyhats

Did you find this page helpful?