-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prisma can't connect with an IPv6 host (on e.g. Fly.io) #18079
Comments
I would like to investigate on this issue |
After going through the code, I found that the |
Hello from fly.io! As @Fenntasy noted, this bug has an unfortunate effect on prisma apps running on our platform. We'd love to see this fixed. Let me know if any additional information would be useful, or any other way we can help. |
@janpio is there any workaround for this that we could use? |
@cinder-star sweet, thanks! And how can I find |
The dbname, user and password are the same as the connection string with the ipv6 one. You just need to replace the hostname with the ipv4 host. @maticzav |
@cinder-star I tried setting up the IPv4 url and manually changing the
Some useful links and code chunks that helped me figure out
[build]
dockerfile = "server/Dockerfile"
[deploy]
release_command = "pnpm migrate:db" {
"scripts": {
"migrate:db": "prisma migrate deploy --schema server/prisma/schema.prisma"
}
} Thanks again for helping me again 🙏 ! |
@maticzav i think you need to add sslmode to the url as well. |
It's not needed for the But in any case, this issue shouldn't be about how to fix the problem with Fly when the problem lies with Prisma. |
This PR bumps the GitHub Action to v3.0 with the following changes: - we only create the PostgreSQL Cluster if it doesn't already exist yet (given specified in the configuration) - create PostgreSQL cluster with an initial size of 2 so that the write main instance and the first read replica are in the same region, additional read replicas can still be spawned in additional regions with `postgres_cluster_regions` configuration - replace Fly's Database URL ending with `.flycast` to `.internal` as a fix for [Prisma Issue](prisma/prisma#18079) - pass secrets as `--env` option to the `flyctl deploy` command instead of using `flyctl secrets` to avoid first deployment having no secrets Fixes TRB-494
Is there any fix to this problem? |
This affects everything that uses IPv6 addresses in URLs directly, not just fly.io, old title was fine |
Add an integration test for connecting to SQL databases with an IPv6 address in a connection string. This serves as a regression test for the fix for PostgreSQL and MySQL in 1548dc1, as well as confirms that this already works on MS SQL. Ref: #4051 Ref: prisma/prisma#18079
Add an integration test for connecting to SQL databases with an IPv6 address in a connection string. This serves as a regression test for the fix for PostgreSQL and MySQL in 1548dc1, as well as confirms that this already works on MS SQL. Ref: #4051 Ref: prisma/prisma#18079
Bug description
In a
DATABASE_URL
, if the host is an IPv6, Prisma will throw an error, for instance, using this connection stringwill result in this error
I know that locally I could always use
localhost
or127.0.0.1
but the bug is more of a problem if you're using a service like Fly that has started populatingDATABASE_URL
with IPv6 addresses. It just doesn't work out of the box.psql
and thepg
node package don't have a problem with them so it's a problem with Prisma.How to reproduce
Any local PG connection string looking like
will create the error
Expected behavior
It should be able to connect.
Prisma information
The schema or queries are irrelevant here since it just doesn't connect.
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: