Data Platform: Cannot connect Prisma to Cockroach Serverless `Requested database check `reachable` failed`
See original GitHub issueBug description
Prisma won’t accept the connection string, example: postgresql://seb:rmhls-LrWm3I5oDi1aaGag@free-tier13.aws-eu-central-1.cockroachlabs.cloud:26257/defaultdb?sslmode=require&options=--cluster%3Drose-warthog-619
I have a strong suspicion on this being an SSL-related problem
How to reproduce
Create CockroachCloud cluster
- Go to
https://cockroachlabs.cloud/clusters
- Click on
Create Cluster
- Select
Serverless
- Select cloud provider
AWS
- Select region
Frankfurt (eu-central-1)
- Leave spend limit at
$0
- Enter cluster name
Test123
- Note down the connection string
Create Prisma project
- Go to
https://cloud.prisma.io/projects
- Click on
New Project
- Fill in project name as
Test123
- Select
Create a repository
- Fill in repository name as
Test123
- Click on
Next
- Select template
URL Shortener
- Click on
Next
- Select
Use my own database
- Enter connection string, in my case
postgresql://seb:rmhls-LrWm3I5oDi1aaGag@free-tier13.aws-eu-central-1.cockroachlabs.cloud:26257/defaultdb?sslmode=require&options=--cluster%3Drose-warthog-619
[I will delete this cluster as soon as this problem is resolved] - Select location
eu-central-1 (Frankfurt)
- Leave static IPs on
Disabled
- I get a warning, the complete information of it being
We were unable to create your project: Requested database check `reachable` failed
Check connection string with psql
- Connect:
psql "postgresql://seb:rmhls-LrWm3I5oDi1aaGag@free-tier13.aws-eu-central-1.cockroachlabs.cloud:26257/defaultdb?sslmode=require&options=--cluster%3Drose-warthog-619" -c "SHOW DATABASES"
Check connection string with cockroach sql
- Download certs with
curl --create-dirs -o ~/.postgresql/root.crt -O https://cockroachlabs.cloud/clusters/32d83dc6-bfad-4146-9c1f-fbed298ce610/cert
- Connect:
cockroach sql --url "postgresql://seb:rmhls-LrWm3I5oDi1aaGag@free-tier13.aws-eu-central-1.cockroachlabs.cloud:26257/defaultdb?sslmode=require&options=--cluster=rose-warthog-619&sslrootcert='$HOME'/.postgresql/root.crt" -e "SHOW DATABASES"
Expected behavior
It should allow a new Prisma project to connect to CockroachDB’s serverless offering
Prisma information
No schema, just trying to create a new and blank project
Environment & setup
- Fedora 35 locally
- Prisma Cloud
- CockroachDB serverless
Prisma Version
prisma : 3.11.0
@prisma/client : Not found
Current platform : rhel-openssl-1.1.x
Query Engine (Node-API) : libquery-engine b371888aaf8f51357c7457d836b86d12da91658b (at node_modules/@prisma/engines/libquery_engine-rhel-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli b371888aaf8f51357c7457d836b86d12da91658b (at node_modules/@prisma/engines/migration-engine-rhel-openssl-1.1.x)
Introspection Engine : introspection-core b371888aaf8f51357c7457d836b86d12da91658b (at node_modules/@prisma/engines/introspection-engine-rhel-openssl-1.1.x)
Format Binary : prisma-fmt b371888aaf8f51357c7457d836b86d12da91658b (at node_modules/@prisma/engines/prisma-fmt-rhel-openssl-1.1.x)
Default Engines Hash : b371888aaf8f51357c7457d836b86d12da91658b
Studio : 0.458.0
Preview Features : cockroachdb
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Connect your database | node-cockroachdb - Prisma
Connecting your database. To connect your database, you need to set the url field of the datasource block in your Prisma schema to...
Read more >Hellooo I cannot create a support ticket for the following i | Prisma ...
We were unable to create your project: Requested database check `reachable` failed. Is there a solution for this? I have tested the connection...
Read more >Common Errors and Solutions | CockroachDB Docs
Understand and resolve common error messages written to stderr or logs. ... Client connection, node is running secure mode, SSL connection required.
Read more >How we built a serverless SQL database - Hacker News
What happens when that database fails? Are you OK losing some data, or do you want the data to be synchronously replicated off...
Read more >More than 600 built-in integrations - Datadog
Start collecting full-stack data in minutes with turnkey integrations for 600+ technologies from Datadog.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for chasing this issue, and of course I’ll leave the cluster/connstring up! 😃
So we can confirm that the Data Platform is currently not compatible with the
options=--cluster=
parameter CockroachDB is using by default. We will try to change this soon and will update you here. (If you can leave the connection string up until that happens, that would be neat as we have been using that one to test and reproduce 😆)That the alterantive connection string that @Jolg42 crafted does not work, is a bit more of a mystery. There we do not know exactly what is going on yet but will also investigate.
Thanks for reporting this @SebJansen - this will make Prisma better for everyone. Unfortunately you will have to wait a bit.