N
Neon5mo ago
adverse-sapphire

Cannot Connect to NeonDB from Docker/Prisma (ARM64, SNI, All Best Practices Followed)

Hello Neon Support, I am unable to connect to my NeonDB instance from a Dockerized Python/Prisma application, despite following all best practices and Neon documentation for SNI and ARM64 support. Details: NeonDB Endpoint: ep-royal-wave-a2w289mf-pooler.eu-central-1.aws.neon.tech:5432 Connection String: postgresql://aisaaslp_owner:***@ep-royal-wave-a2w289mf-pooler.eu-central-1.aws.neon.tech/aisaaslp?sslmode=require&options=endpoint%3Dep-royal-wave-a2w289mf Error: Can't reach database server at ep-royal-wave-a2w289mf-pooler.eu-central-1.aws.neon.tech:5432 Prisma connect attempt 1 failed: Could not connect to the query engine All Prisma connect attempts failed. Prisma Error Code: P1001: Can't reach database server Environment: Docker container running on Apple Silicon (M1/M2, ARM64) Prisma Python client with binaryTargets = ["native", "debian-openssl-3.0.x", "linux-musl-openssl-3.0.x", "linux-arm64-openssl-3.0.x"] CA certificates present in the container Outbound internet access confirmed SNI endpoint option present in connection string Prisma client regenerated after updating binary targets What I’ve Tried: Verified SNI option in connection string per Neon Docs Added ARM64 support to Prisma binary targets and regenerated the client Confirmed CA certificates and outbound internet in the container No custom Docker network/firewall restrictions Checked Neon status page for incidents Retried connection after waking up compute in the Neon dashboard Request: Can you confirm if there are any Neon-side restrictions (IP allowlist, firewall, etc.) that could block this connection? Is there any known issue with ARM64 Docker/Prisma clients and NeonDB? Is my endpoint or project in a suspended or restricted state? Any additional diagnostics you recommend? Thank you for your help!
2 Replies
conscious-sapphire
conscious-sapphire5mo ago
Hi @Jax I recommend opening a support ticket to officially raise this with the Neon suppoprt team. The support team sometimes drop in here, but it's mostly community members and Neon staff answering questions on a best-effort basis. https://console.neon.tech/app/projects?modal=support I did take a look at your endpoint. I don't see anythign suggesting it's in a restricted state. To verify that you can access it outside of your application setup, you could try connecting via psql. https://neon.tech/docs/connect/query-with-psql-editor Beyond that, you can reference our examples repo for connection configurations. There are a few Prisma examples there: https://github.com/neondatabase/examples
Neon
Connect with psql - Neon Docs
The following instructions require a working installation of psql. The psql client is the native command line client for Postgres. It provides an interactive session for sending commands to Postgres a...
GitHub
GitHub - neondatabase/examples: Examples and code snippets demonstr...
Examples and code snippets demonstrating common ways of integrating Neon with various frameworks and languages. - neondatabase/examples
conscious-sapphire
conscious-sapphire5mo ago
I did a quick search of our Support system for a similar issue reported recently. Here's a response: Thank you for contacting Neon Support. The error you're encountering, P1001: Can't reach database server, typically occurs when the Prisma query engine times out before the Neon compute is activated. Neon's compute resources transition to an idle state after a period of inactivity to save resources, and they are automatically activated when a new connection is attempted. However, this activation can introduce a slight delay, which may result in a timeout. Here are some steps to address this issue: Increase the Connection Timeout: You can adjust your connection string by adding a connect_timeout parameter to allow more time for the compute to activate. For example: This increases the timeout to 15 seconds, which should provide sufficient time for the compute to activate. For more details, refer to our Connection timeouts documentation. Use a Direct Connection for Prisma Migrate: Prisma Migrate requires a direct connection to the database and does not support pooled connections. You can configure a direct connection by adding a directUrl property to the datasource block in your schema.prisma file: Then, update your .env file with both the pooled and direct connection strings For more information, see our Prisma Migrations guide. https://neon.tech/docs/guides/prisma-migrations
Neon
Schema migration with Neon Postgres and Prisma ORM - Neon Docs
Prisma is an open source ORM for Node.js and Typescript, known for its ease of use and focus on type safety. It supports many databases, including Postgres, and provides a robust system for managing d...

Did you find this page helpful?