question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma can't reach Planetscale behind a VPN

See original GitHub issue

Bug 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

  1. Turn on a VPN
  2. Start Application server
  3. Go to wherever your app is loaded in localhost (or open Prisma Studio)
  4. 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timotius02commented, Oct 21, 2022

Yes. I will close this issue and try to follow up elsewhere. Thanks for all the help.

1reaction
timotius02commented, Oct 21, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found