Flaky/sporradic PrismaClientInitializationError failures when connecting to PlanetScale #556
-
I'm using Prisma and PlanetScale for my app. I have unit tests which run on CI that connect to PlanetScale for some basic integration tests. It all works great, except that I'm seeing roughly 1 out of 10 test cases will fail with:
Usually retrying the tests makes the problem go away but the flakiness is starting to become more and more frustrating to deal with. Before I go with a blunt solution like adding a retry-mechanism for all DB requests -- I'm wondering if there's any other recommended solutions. Why would establishing a connection to PlanetScale not work 100% reliably? My app isn't live for users yet, and I'm worried that if my unit tests are catching such flakiness, when I launch the product my users might run into similar random connection failures too. Any advice from the PlanetScale on how to debug this further? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @EvHaus, Based on the hostname shown in your error message, Please generate a new set of credentials within the PlanetScale UI at your earliest convenience, which should present you with credentials that use the Additionally, the following tip that suggests adding the use of the |
Beta Was this translation helpful? Give feedback.
Hello @EvHaus,
Based on the hostname shown in your error message,
ojj81b9i387e.us-west-2.psdb.cloud
, your database and the associated credentials are likely over a year old and this means your connections are currently arriving directly onto our older edge routing infrastructure, rather than our current one.Please generate a new set of credentials within the PlanetScale UI at your earliest convenience, which should present you with credentials that use the
aws.connect.psdb.cloud
hostname, which has improved reliability amongst other improvements.Additionally, the following tip that suggests adding the use of the
connect_timeout
argument to your Prisma connection should also prove to be …