Hit an unwrap() panic in datamodel-connector #9308
Labels
bug/0-unknown
Bug is new, does not have information for reproduction or reproduction could not be confirmed.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
topic: percent encoding
Milestone
I'm testing out using Prisma to connect to Amazon Aurora Postgres via a Lambda and hit an unexpected panic yesterday in our environment. I wanted to share this in case it helps surface anything.
In our local dev environments we're using the env("DATABASE_URL") variable to set our postgresql connection URL, but in our AWS environments we override this by passing the
datasources.db.url
to PrismaClient (in TypeScript). I'm creating this connection string by pulling the values from AWS Secrets Manager which are rotated with their official lambda. Here's the relevant part of our schema:And here's the piece of code that's setting the connection URL in our lambda (excluded the surrounding):
Everything was working fine in our PR testing branches until the code went into our higher environments (as such things do). Our lambda started throwing panics:
After going down a few unfruitful paths I figured there might be something wrong with the connection URL parsing, so I forced a rotation of the password in Secrets Manager just in case and... things started working fine again? Normal problematic characters are already excluded from the password string (e.g. :/@"') and I confirmed none of them were in the connection string that was causing issues, so I wasn't expecting that to work.
Anyway, I figure
unwrap()
is generally used in places where an error case isn't generally expected and wanted to raise this. I'm still not totally sure why rotating the secret ended up making things work. Thanks!The text was updated successfully, but these errors were encountered: