Hey all :slightly_smiling_face: I’m trying to get ...
# orm-help
h
Hey all 🙂 I’m trying to get my Prisma server up, but I’m having some trouble. The DB is AWS Aurora, and I’m hosting the server on Zeit Now. I’ve been using the new guide for deploying to Zeit Now (https://www.prisma.io/docs/tutorials/deploy-prisma-servers/zeit-now-and-google-cloud-sql-mohj5eiwot#1.-mysql), but even though the deploy is succesful, it can’t reach my DB for some reason. I get an output like this:
Copy code
> Successfully built 086ddb645f20
> Successfully tagged registry.now.systems/now/8c565a120ef9e162cfb024f678f1e2411044ae28:latest
> ▲ Storing image
> Build completed
> Verifying instantiation in bru1
> [0]   at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
> [0] Exception in thread "main" java.sql.SQLTransientConnectionException: database - Connection is not available, request timed out after 5000ms.
> [0]   at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
> [0]   at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
> [0]   at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
> [0]   at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
> [0]   at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
> [0] Exception in thread "main" java.sql.SQLTransientConnectionException: database - Connection is not available, request timed out after 5001ms.
I triple-checked the credentials and host, and I’m able to connect to the DB just fine using MySQL Workbench with the same credentials, which to me indicates that the credentials and host URL/port is fine, and that the DB accepts outside connections just fine as well. Any ideas / help would be much appreciated. 😄
👍 1
g
I came here with the exact same issue. I used a Google Cloud DB but get the same results. I can even navigate to my now.sh site and it opens the playground but I get a "Server cannot be reached" error.
h
The GQL server (showing the playground) and the Prisma server are separate issues. Can you access your Prisma server? Perhaps at the
management
endpoint?
g
I'm not sure what you mean. There shouldn't be anything to see on the Prisma side being that we are using now.sh to host correct?
As I understand that, something should be visible under
<http://yourproject-projectid.now.sh/management|yourproject-projectid.now.sh/management>
But my Prisma server on Now just returns 503/Unavailable
g
ah yes. thanks for the clarification. I am able to hit the management endpoint and look into the schema
h
And doing
now ls
shows the deployment has 0 instances, most likely because it cannot connect
g
so maybe a slightly different issue then
h
Then the issue is separate 🙂 You probably haven’t pointed your GQL server to the correct Prisma server
g
would you mind pointing me to some example of how that should be setup?
h
Go to your
prisma.yml
in your GQL server project and make sure the endpoint is corrrect. Then run prisma deploy
g
I think that should be correct. I setup a now alias for it so it would remain the same
h
Then IDK, I haven’t gotten that far yet 😉
g
and the endpoint reflects the endpoint alias
btw did you happen to miss the step that I did on my first run through where you have to add 0.0.0.0/0 as an authorized network on the database?
h
I’m using Amazon Aurora, so the setup is a bit different I think 🙂
g
oh ok. just thought I would mention it 🙂
h
Sure, thank you for trying! ❤️
m
@halborg: i think @Gabe is spot on with this comment. The RDS wizard on AWS is very confusing. When you create a database and make it publicly available, they still create a restriction that only your current IP can access the database.
You have to modify the security group of the database to alllow traffic from anywhere. This is expreseed as
0.0.0.0/0
.
Have a look at the end of step 2.5 in this tutorial if you want to see the exact steps with screenshots: https://gist.github.com/marktani/8631cb9c63d0973bcdd8bff19d6162c2
h
It would seem that it did have something to so with it. I’ve chronicelled my explorations here: https://www.prisma.io/forum/t/unable-to-connect-to-aurora-db-through-zeit-now-hosted-docker-prisma-server/4134/3
😄