Prisma can't reach Planetscale behind a VPN
See original GitHub issueBug description
When doing local development with a VPN on, I get this error:
Error:
Invalid `prisma.playlist.findMany()` invocation:
Can't reach database server at `{{ DB INFO HERE }}`
This occurs on initial load of localhost for the app as well as Prisma studio. I can still connect to Planetscale just fine using the Pscale CLI. I am using ProtonVPN and tested with servers in US and Netherlands.
How to reproduce
- Turn on a VPN
- Start Application server
- Go to wherever your app is loaded in localhost (or open Prisma Studio)
- See error
Expected behavior
I should be able to connect to Planetscale without timing out.
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
}
model Video {
id String @id
lastUpdated DateTime @updatedAt
name String
viewCount String
thumbnail String
playlist Playlist @relation(fields: [playlistId], references: [id])
playlistId Int
@@index([playlistId])
}
model Playlist {
id Int @id @default(autoincrement())
youtubeId String?
name String
createdAt DateTime
thumbnail String
type PLAYLIST_TYPE
videos Video[]
}
enum PLAYLIST_TYPE {
PLAYLIST
CHANNEL
}
Environment & setup
- OS: Windows
- Database: Planetscale
- Node.js version: Tested on both v17.5 and v16.3.1
Prisma Version
prisma : 3.11.1
@prisma/client : 3.11.1
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 1a2506facaf1a4727b7c26850735e88ec779dee9
Studio : 0.458.0
Preview Features : referentialIntegrity
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Connect your database | node-planetscale - Prisma
The connection URL for a given database branch can be found from your PlanetScale account by going to the overview page for the...
Read more >Frequent 'prisma' Questions - Stack Overflow
Prisma : Can't reach database server at `database`:`5432` ... Framework) application with Prisma (ORM) which connects to PlanetScale (MySQL cloud database) ...
Read more >How to set up Next.js with Prisma and PlanetScale
In this blog, we'll be working with Prisma Client and Prisma Studio. PlanetScale with Next.js#. We'll walk through setting up a new database, ......
Read more >Best Prisma Access Alternatives & Competitors - SourceForge
VPN infrastructure is costly and time-consuming to procure, deploy, and maintain. Inability to secure access at the app level means hacks can expose...
Read more >How To Build a REST API with Prisma and PostgreSQL
To run through the prompts, remove -y from the command: ... Inside it, you will find a schema.prisma file, which is the main...
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
Yes. I will close this issue and try to follow up elsewhere. Thanks for all the help.
Hello sorry for the late response. I was able to connect using MySQL Workbench but it works only when my VPN is off, similar to my experience with Prisma.