I tried to connect Prisma in two different SaaS NextJS projects to PlanetScale, and in each project I received:
Error: P1017: Server has closed the connection.
For debugging, I’ve tried the following:
upgraded to latest Prisma v3.4.1
removed .next, .node_modules and reinstalled
changed VPN 🤷🏻♂️
Was able to properly connect to PlanetScale, so that’s not the issue. Also, I’m well within PlanetScale’s connection limit.
This only appears to occur when I use localhost in development — production is unaffected.
How to reproduce
Unfortunately both of my SaaS projects are not open source (yet), so cannot reproduce here (but can add someone to the project upon request).
Might there be a known outage at the moment?
Prisma information
Output:
Secure connection to database my_database and branch dev is established!.
Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Prisma schema loaded from prisma/dev/schema.prisma
Datasource "db": MySQL database "my_database" at "localhost:3306"
Error: P1017: Server has closed the connection.
Error: running command with --execute has failed: exit status 1
Bug description
I tried to connect Prisma in two different SaaS NextJS projects to PlanetScale, and in each project I received:
For debugging, I’ve tried the following:
v3.4.1
.next
,.node_modules
and reinstalledWas able to properly connect to PlanetScale, so that’s not the issue. Also, I’m well within PlanetScale’s connection limit.
This only appears to occur when I use
localhost
in development — production is unaffected.How to reproduce
Unfortunately both of my SaaS projects are not open source (yet), so cannot reproduce here (but can add someone to the project upon request).
Might there be a known outage at the moment?
Prisma information
Output:
Environment & setup
macOS 12.0.1
MySQL
v16.10.0
Prisma Version