title: Getting Internal Server Error on prisma deploy
body: <p>I have a Postgres database on Heroku, upon deploying the data model by doing <code>prisma deploy</code> often times the following error is produced.  </p>
  
  <pre><code>ERROR: Whoops. Looks like an internal server error. Search your server logs for request ID: local:cjxrmcnpx00hq0692zuwttqwv
  
  {
   "data": {
     "addProject": null
   },
   "errors": [
     {
       "message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:cjxrmcnpx00hq0692zuwttqwv",
       "path": [
         "addProject"
       ],
       "locations": [
         {
           "line": 2,
           "column": 9
         }
       ],
       "requestId": "local:cjxrmcnpx00hq0692zuwttqwv"
     }
   ],
   "status": 200
  }
  </code></pre>
  
  <p>and on checking the Docker logs I am seeing this erorr: </p>
  
  <pre><code>Jul 14, 2019 12:18:34 PM org.postgresql.Driver connect
  prisma_1  | SEVERE: Connection error: 
  prisma_1  | org.postgresql.util.PSQLException: FATAL: too many connections for role "bcueventxumaik"  
  prisma_1  |     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
  prisma_1  |     at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)
  prisma_1  |     at org.postgresql.core.v3.QueryExecutorImpl.&lt;init&gt;(QueryExecutorImpl.java:131)        
  prisma_1  |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
  prisma_1  |     at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
  prisma_1  |     at org.postgresql.jdbc.PgConnection.&lt;init&gt;(PgConnection.java:195)
  prisma_1  |     at org.postgresql.Driver.makeConnection(Driver.java:452)
  prisma_1  |     at org.postgresql.Driver.connect(Driver.java:254)
  prisma_1  |     at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
  prisma_1  |     at slick.jdbc.DataSourceJdbcDataSource.createConnection(JdbcDataSource.scala:68)      
  prisma_1  |     at slick.jdbc.JdbcBackend$BaseSession.&lt;init&gt;(JdbcBackend.scala:453)
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)        
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)       
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
  prisma_1  |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    
  prisma_1  |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    
  prisma_1  |     at java.lang.Thread.run(Thread.java:748)
  prisma_1  |
  prisma_1  | Exception in thread "main" org.postgresql.util.PSQLException: FATAL: too many connections 
  prisma_1  |     at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)prisma_1  |     at org.postgresql.core.v3.QueryExecutorImpl.&lt;init&gt;(QueryExecutorImpl.java:131)prisma_1  |     at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
  prisma_1  |     at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)prisma_1  |     at org.postgresql.jdbc.PgConnection.&lt;init&gt;(PgConnection.java:195)
  prisma_1  |     at org.postgresql.Driver.makeConnection(Driver.java:452)
  prisma_1  |     at org.postgresql.Driver.connect(Driver.java:254)prisma_1  |     at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
  prisma_1  |     at slick.jdbc.DataSourceJdbcDataSource.createConnection(JdbcDataSource.scala:68)
  prisma_1  |     at slick.jdbc.JdbcBackend$BaseSession.&lt;init&gt;(JdbcBackend.scala:453)
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
  prisma_1  |     at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
  prisma_1  |     at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
  prisma_1  |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  prisma_1  |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  prisma_1  |     at java.lang.Thread.run(Thread.java:748)
  prisma_prisma_1 exited with code 1
  </code></pre>
  
  <p>The error is saying <em>too many connections</em> but I am firing <em>prisma deploy</em> from only one terminal and at the same time I am able to connect to the database using PgAdmin4. Moreover, the database seems to be perfectly reachable as I am able to ping the database from inside the container.</p>
  
  <p><strong>PS. Updated the docker logs as earlier on running <code>docker logs -f processid</code> I was getting older logs but now upon building the container again using <code>docker-compose up</code> I got the lastest logs</strong></p>