Trying to deploy a Next.JS app along with Prisma to Fly, however, once it gets to building a page using the
getStaticProps it fails because Prisma cannot reach my fly db proxy, however,
in a development state, I can perfectly connect to the db through the proxy.
Has anyone else encountered this? Any help would be amazing
PS I know it’s not smart to use an external db while developing however I am just currently testing out Fly.
Hey I’m having this problem too and was about to create a topic.
Have you ran something like
fly pg attach yourdb --app your-builder and running
fly deploy --remote-only?
My current issue is that I have messed up the first step as I wanted to check something else and I now have a secret on this app on the DATABASE_URL key that I somehow can’t unset:
fly secrets unset DATABASE_URL --app my-builder doesn’t remove the secret so that the
pg attach command fails because the secret already exists.
Hi @theo-m . Is
my-builder a remote builder or the actual app you want to have the database set? Builders itself would not use your secrets at all you’d want DATABASE_URL on your app. But if you’re adding the secret to your app then what would be the error you get when trying to unset the secret?
In this context
my-builder is indeed a remote builder. Prisma generates code based on the db schema - code which is needed to build and advised not to version, so I would want to expose this db url to the builder.