Anyone here who’s had success hosting a Prisma ser...
# orm-help
h
Anyone here who’s had success hosting a Prisma server on Heroku? I’m having this issue, and I need an adult 😄 https://github.com/prisma/prisma/issues/3502
r
I followed the steps in your repo and getting this error when deploying:
Copy code
2018-11-20T14:53:58.646526+00:00 heroku[web.1]: Starting process with command `/bin/sh -c bash\ /app/start.sh`
2018-11-20T14:54:00.648756+00:00 app[web.1]: ./app/prerun_hook.sh: line 20: can't create : nonexistent directory
2018-11-20T14:54:00.734378+00:00 heroku[web.1]: Process exited with status 1
2018-11-20T14:54:00.888110+00:00 heroku[web.1]: State changed from starting to crashed
Any clues?
maybe need to create the
app
dir in the Dockerfile file?
h
Weird, my prisma server deploys just fine
Did you set all the config vars from
prerun_hook.sh
in your Heroku app?
r
what do I set
PRISMA_CONFIG_PATH
to? the error seems to come from that line
is it just
prisma.yml
?
h
Oh, nothing - the script exports the config thatøs built inside the quotes into a new variable called
PRISMA_CONFIG_PATH
AFAIK. I’ve only set the following options in my Heroku server config
r
what is the value of your
PRISMA_CONFIG_PATH
there?
and also JAVA_OPTS if you dont mind me asking
h
🙈 I’m tired, excuse me..
It’s a very slightly modified verison of this example repo: https://github.com/dpetrick/prisma-heroku
r
thanks! lemme try that
woohoo, it worked!!
able to deploy and hit the management playground using a
prisma token
h
Sure, but can you deploy a service?
If you can, please share how! 😄 if not, please chime in on the github issue, sharing the info I forgot on the Readme to get going
I'm on my phone
r
yes, i was able to deploy using
prisma deploy
.. so i ahve Prisma running on Heroku + PG database. lemme try to hit the server using my local graphql service
h
Didn't you need to do prisma init?
What database are you using?
r
im using Heroku postgres. i didnt run prisma init, but just updated my
.env
file which points to the proper
PRISMA_ENDPOINT
however, when trying to hit the server, i am getting this error now:
Copy code
2018-11-20T16:48:30.612300+00:00 app[web.1]: org.postgresql.util.PSQLException: ERROR: relation "public.User" does not exist
2018-11-20T16:48:30.612310+00:00 app[web.1]: Position: 220
trying to add to a new app and getting this error:
Copy code
ERROR: Whoops. Looks like an internal server error. Search your server logs for request ID: local:api:cjopz7y23001z0668liv1oht6

{
  "data": null,
  "errors": [
    {
      "message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:api:cjopz7y23001z0668liv1oht6",
      "path": [
        "read"
      ],
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "requestId": "local:api:cjopz7y23001z0668liv1oht6"
    }
  ],
  "status": 200
}
logs show:
Copy code
2018-11-20T16:51:46.062620+00:00 app[web.1]: org.postgresql.util.PSQLException: ERROR: relation "public.Permission" does not exist
i think maybe im using the wrong db schema? (
public
)
yep. that was it. removed
schema
from my config (since im using PG vs MySQL, guess it doesnt need it)
and it all seems to work now
able to hit the service from my local graphql-yoga server and get results
i did have to reset my DB on heroku and prisma deploy again. but after that, it all just worked