Hi guys, after starting a project with a self host...
# orm-help
j
Hi guys, after starting a project with a self hosted database, the project was created good and I gey my docker container running but when I hit
prisma deploy
I get the following error
Could not connect to server at <http://localhost:4466>. Please check if your server is running.
Any clue on what is needed to have that working?
a
Are you deploying to a local docker container?
j
yup
a
The generic error message you're seeing is due to a general failure. I'd recommend getting the docker logs. That'll give you the actual error message.
j
How do I do that?
a
docker logs yourContainerName
. You can always run
docker ps
to get a list of all containers to find the name.
j
Thanks, seems like I have connection errors to the database ๐Ÿ˜• will look further into that
a
Could you share the error? We might be able to help ๐Ÿ™‚
j
Sure
Copy code
Jun 15, 2018 2:24:42 PM org.postgresql.Driver connect
SEVERE: Connection error:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "200.123.198.10", user "ximdxudtymukbs", database "postgres", SSL off
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
        at org.postgresql.Driver.makeConnection(Driver.java:452)
        at org.postgresql.Driver.connect(Driver.java:254)
        at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:193)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:430)
        at com.zaxxer.hikari.pool.HikariPool.access$500(HikariPool.java:64)
        at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:570)
        at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:563)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Also my docker-compose.yml looks like this
Copy code
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.9
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
        databases:
          default:
            connector: postgres
            host: <http://ec2-75-101-142-91.compute-1.amazonaws.com|ec2-75-101-142-91.compute-1.amazonaws.com>
            port: '5432'
            database: d3v7ggj9rspmde
            user: ximdxudtymukbs
            password: a7afeb85b698988ad7101d54af63e94d8d250c981c1bac423e3f78a0858def89
            migrations: true
a
The issue you're running into is caused by the lack SSL support without certs. I talked with @divyendu about this topic as I was running into the same issue. He mentioned in an issue thread that they're working on a fix which should be out soon ๐Ÿ™‚ GitHub Issue: https://github.com/prismagraphql/prisma/issues/2394 You can always disable SSL util the fix is out.
๐Ÿ™ 1
j
Awesome. How should I turn that off? Do I need to re create the project?
a
How did you create that database?
j
Is a Heroku hosted db
a
Ah. Then you can't ๐Ÿ˜• I had the same issue.
They force all external connections to be over SSL.
j
๐Ÿคฆ is MyQL an option in that case? Or is that also an issue if I use Heroku?
a
I'd recommend using a localhost PG database for local development. You can still connect to the PG database from the Heroku app itself. Local dev app -> Local database Prod app (heroku) -> Prod database (heroku)
j
Okay, got it, so once the Prisma server is up I can use heroku. Will try that. Thanks
a
Yeah, assuming the Prisma server is hosted on Heroku.
d
Also, one click deploy to heroku is coming soon.. :)
j
That bring one more question. How do I deploy that to Heroku, I donโ€™t see that on the docs. And sorry for asking that much
hahaha just asked that @divyendu
d
Currently, you have to do it manually :/
j
Okay, I think I can work with that for my discovery phase so I once the onclick deploy is ready I can move to that one, where should I look to get that?
a
@divyendu Is there an issue thread for one click I can track?
j
@divyendu?
d
https://github.com/prismagraphql/prisma/issues/2394 I think that the only relevant close issue is still this. I will dig it up and post it here if I run into it. But we are fairly close because we tested the workflow already in beta ๐Ÿ‘
@jhony0311: This should be resolved now:- please let me know if you run into any hiccups. https://github.com/prismagraphql/prisma/issues/2394#issuecomment-398713301
j
Iโ€™m maybe doing something wrong I still canโ€™t connect to the database. Iโ€™m getting this error:
Copy code
Jun 21, 2018 10:05:18 PM org.postgresql.Driver connect
SEVERE: Connection error: 
org.postgresql.util.PSQLException: FATAL: too many connections for role "ximdxudtymukbs"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)
at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:131)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:452)
at org.postgresql.Driver.connect(Driver.java:254)
at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:193)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:430)
at com.zaxxer.hikari.pool.HikariPool.access$500(HikariPool.java:64)
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:570)
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:563)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
And this is my docker-compose.yml
Copy code
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.10
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
        databases:
          default:
            connector: postgres
            host: <http://ec2-75-101-142-91.compute-1.amazonaws.com|ec2-75-101-142-91.compute-1.amazonaws.com>
            port: '5432'
            database: d3v7ggj9rspmde
            user: ximdxudtymukbs
            password: a7afeb85b698988ad7101d54af63e94d8d250c981c1bac423e3f78a0858def89
            migrations: true
            ssl: true
Iโ€™ve tried recreating everything and it didnโ€™t work
Well, forget it, I was using a small tier of the database ๐Ÿ˜• Is working now after upgrading ๐ŸŽ‰
d
It should work for any size of database. CLI version 1.10.1+
j
Is not working with 1.10.2, 20 connections was not enough for it ๐Ÿ˜•
d
can you please create an issue for this? https://github.com/prismagraphql/prisma/issues
j
Yup, I will compile conditions and report that
๐Ÿ’š 1
๐Ÿ™Œ 1
d
Awesome! Thanks :)