I'm getting: ``` May 15, 2018 7:22:56 PM org.postg...
# orm-help
s
I'm getting:
Copy code
May 15, 2018 7:22:56 PM org.postgresql.Driver connect
SEVERE: Connection error:
org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres"
  Detail: User does not have CONNECT privilege.
m
try 1.8.1 or 1.8.2, I think there were some problems with 1.8 version
s
I figured the prisma:1.8 would be the latest 1.8.x but I'll try a specific version of the images.
I did switch to an explicit 1.8.3 and it didn't resolve the issue. I eventually nuked all of my docker images and also reduced the
connectionLimit
because the free db at elephantsql.com has a connection cap. This got me heading in the right direction, but the startup logs are still very full of:
Copy code
May 16, 2018 3:14:29 PM org.postgresql.core.v3.ConnectionFactoryImpl log
WARNING: SQLException occurred while connecting to <http://tantor.db.elephantsql.com:5432|tantor.db.elephantsql.com:5432>
org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres"
  Detail: User does not have CONNECT privilege.
        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)
n
@matic, @Stephen is right, 1.8 gets retagged to the latest version with every release. @Stephen did you learn more about this?
m
Ah, shit thanks @nilan! It's super useful to know this.
s
@nilan I was able to get the container up and running. I'm not entirely sure why, but it seems to still try to connect to the default "postgres" database exactly a dozen times before realizing the env variable and then trying to connect to the defined database name. I also had to reduce the
connectionLimit
to 1 because I was using a free instance on elephantsql.com and it has a cap of connections. But it's up and working and I've been playing with schemas and putting it through it's paces.
👍 1
n
interesting, what database it is connecting to instead?
in https://prisma.slack.com/archives/CA491RJH0/p1526412322000230 you didn't share any env var, or am I missing it?
s
database: <user>
is the key for the database name, right? In this case, the db name is the same as the user name.
n
yup, that should work. I didn't realize you are using an env var here 🙂 @dpetrick can you think of why it keeps connecting 12 times to
postgres
before connecting to the database configured in
PRISMA_CONFIG
?
s
even with that defined, I'm getting a dozen
org.postgresql.util.PSQLException: FATAL: permission denied for database "postgres"
failures before finally...
Copy code
Obtaining exclusive agent lock...
Obtaining exclusive agent lock... Successful.
Deployment worker initialization complete.
Initializing workers...
Successfully started 1 workers.
Server running on :4466
d
The
postgres
db is used as the default bootstrap database to setup all required database structures.
s
I did notice when I didn't have the
database
name defined, it was also trying to connect to a db with name of "prisma" but that went away.
@dpetrick is there a way to change the db name for that bootstrap db?
d
By default, postgres always connects to the db with the same name as the user that is trying to connect to the instance, e.g. user
prisma
results in postgres looking for a
prisma
db, unless specified otherwise.
No there is not, postgres is a default db that is always available and thus the smallest common denominator across all postgres instances.
s
In this case, it isn't available with my free tier db from elephantsql.com and you can't configure the db name. DBaaS problems, I guess.
Thanks for following up on this. Other than a few startup errors, everything seems to be working fine and I've started diving in to prisma for my DAL.
👍 1
n
you're welcome! Could you please document the issues with elephantsql here: https://github.com/graphcool/prisma/? Eventually we might be able to come up with a solution to this in the future
s
Sure, I can post an issue and see what comes out of it. I just didn't want to pay for a db but wanted it to be persistent between sessions of exploration.
n
yup, pretty good idea 🙂 happy to have you up and running now!
s
Thank you!
v
I'm having the same issue but w/ my free tier from heroku. rip
@nilan