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
Unix socket connection not working #525
Comments
The error message looks very similar to #381 which got recently closed. Can you please tell me where the database is hosted? |
Also, please make sure you are on the latest version of prisma2 |
This database is hosted on Google Cloud (Cloud SQL). I managed to make it work by connecting to a public IP. Sockets did not work, now trying to use SSL, but when I add it to the db connection string (sslcert, sslkey) it does not accept it. I am using the latest version of Prisma2. |
Yes, right now we don't support those options. Can you open an issue(ie feature request) for that 🙏 |
@pantharshit00 What options do you mean? Sockets or SSL? |
We don't support sslcert and sslkey options right now. I will need to confirm socket support |
But sockets should work, is that correct? If so, what is the recommended connection string? I am unable to make it work |
@pantharshit00 Do you have some updates on this? |
I think sockets are not supported in the Rust implementation right now. The CLI uses the nodejs driver to do introspection right now. |
@pantharshit00 But in the |
In the docs of Prisma 2 it says to use any supported connection string and Rust's Postgresql implementation supports it https://docs.rs/postgres/0.15.2/postgres/struct.Connection.html#impl Without sockets and SSL support, there is basically no way to communicate securely between the backend and the database... |
I need to confirm this with the backend team. I don't work on the Rust part of the codebase, it might be a specific issue. I will try to make a concrete reproduction for this. |
error when start after init
|
@AhmedElywa are you running |
@malekjaroslav |
lift up
.
@pantharshit00 Hi, do you have some updates regarding this issue? |
We will write a spec for this so that we integrate this in the schema. We are on it, might take some time as it is a schema change. |
Great, thanks! |
Thanks a lot for reporting 🙏 In case it’s not fixed for you - please let us know and we’ll reopen this issue! |
@timsuchanek I'm not sure if this has fixed it for me. I'm using a typical docker compose for postgres to repro locally, that listens on unix socket: /var/run/postgresql/.s.PGSQL.5432.
I am on alpha version: 2.0.0-alpha.538. I believe this is the last alpha version before the breaking changes introduced. I would upgrade but I also use nexus-prisma, so I'm waiting on the changes coming in there. I'm in a similar situation where I would like to use this with Google Cloud Run and Cloud SQL in GCP. When I try to make a gql query I get this error:
With the connection string (replace dbname)
I am able to connect to this just fine using other connection methods with a connection string. |
This is at least fixed in the backend side, here's the test: https://github.com/prisma/quaint/blob/master/src/connector/postgres.rs#L421-L426 Is the javascript client using some weird URL parser that doesn't understand the socket without a host? |
I remember @timsuchanek fixing it, but is the alpha.538 too old to contain the fix? |
@daaasbu Can you please open a new issue about this? This particular issue tracks the progress of implementation of this feature which is done now. If you encounter any bugs please open a new issue. Also, please test it out with the latest version once 🙏 |
This is a pretty important one - this is the documented path for most of GCP and especially important for any serverless deployment, as documented here GCP cloud run <==> SQL connection guide Has anybody managed to figure out a working connection string? I'm currently trying: |
This worked for me: |
@nargetdev If I remember correctly, you should not append Use |
Thank you very much @Sytten, that worked for me as well!! |
@Sytten solution works like charm, it is very hard to find a solution for this case, I almost gave up |
Tried all possibilities of connections strings to the DB but still unsuccessful deploying to Google Cloud (App Engine/Cloud Run). Connection strings are replaced with placeholders for security.
The text was updated successfully, but these errors were encountered: