prisma / prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
https://www.prisma.io
Apache License 2.0
39.34k stars 1.54k forks source link

PlanetScale — P1017: Server has closed the connection #10169

Closed heymartinadams closed 2 years ago

heymartinadams commented 2 years ago

Bug description

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:

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

Environment & setup

Prisma Version

v3.4.1
heymartinadams commented 2 years ago

Just resolved itself. Not sure why (guessing it was an outage). On both (independent) SaaS projects / databases.