Prisma1: Unable to run prisma deploy on heroku hosted prisma server

Created on 9 Aug 2018  ·  19Comments  ·  Source: prisma/prisma1

Describe the bug
After creating a server on prisma cloud using heroku (currently only available option), the server itself is created successfully, however I am unable to deploy to it (more to come):
screen shot 2018-08-08 at 6 09 57 pm

At this point, I have my PRISMA_ENDPOINT (the one on heroku) so I go ahead and create another env file:
.env.prod

PRISMA_ENDPOINT={CENSORED}
PRISMA_SECRET={CENSORED}
PRISMA_MANAGEMENT_API_SECRET={CENSORED}
APP_SECRET={CENSORED}

Now, when I run prisma deploy -e .env.prod
I get the following:

ERROR: Authentication token is invalid: Token can't be decoded: Invalid signature for this token or wrong algorithm.

{
  "data": {
    "addProject": null
  },
  "errors": [
    {
      "locations": [
        {
          "line": 2,
          "column": 9
        }
      ],
      "path": [
        "addProject"
      ],
      "code": 3015,
      "message": "Authentication token is invalid: Token can't be decoded: Invalid signature for this token or wrong algorithm.",
      "requestId": "local:management:cj..."
    }
  ],
  "status": 200
}

I feel like I am missing a step here. Could someone point me in the right direction?

To Reproduce

  1. Create prisma server using the "create server" flow in app.prisma.sh`
  2. Create your prod env file
  3. Try to deploy to this server and you will receive an error

Expected behavior

I was expecting it to deploy my changes.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: [OS X Mojave]
  • prisma prisma/1.13.6 (darwin-x64) node-v10.8.0

Additional context

I don't have any services which seems wrong, however if I try to add a service my only option is to choose a "demo server" that's on a shared cluster.

bu0-needs-info

Most helpful comment

Today I had same problem. I checked heroku logs and it shows same error as prisma when I tried to deploy my app. I had no problem with deploying to prisma demo server but when I created heroku one with prisma client this thing happens. Anyone got idea hot to fix it?

All 19 comments

This doesn't seem to be related to the Heroku server at all. Note this:

  "requestId": "local:management:cj..."

You are deploying to a Prisma server called local. This looks like you still have a file ~/.prisma.config.yml lying around that contains this part:

clusters:
  local:
   # ...

Replace that part by

clusters: {}

and try to deploy again. I suspect that this will reveal another problem due to your .env.prod file seemingly not being picked up - but let's get the local server out of the way first 🙂

@marktani I believe my .env.prod file is being picked up but I'll start with my ~/.prisma/config.yml because I'm still confused regardless:

cloudSessionKey: >- {{OMITTED}}
clusters: {}

That's what it looks lile. No local:. Any other ideas I can try?

Ah - what is your server version? How do you host the server? Did you look up into the server logs for the request id printed "requestId": "local:management:cj..."?

@marktani

what is your server version?

Server Version on app.prisma.io : 1.11-beta

How do you host the server

I followed the flow on prisma cloud to create the server and database the database on heroku. I feel at the end of that flow i was cut off UX wise and didn't really know what to do next. While my prisma server and postgres db are hosted and running on heroku, wasn't sure how to deploy my changes to that server so that's really the issue im having here. What I did after is create my .env.prod file and fill in the values that made sense.

Running docker-compose logs gives me a lot of
prisma_1 | [Metrics] No Prisma Cloud secret is set. Metrics collection is disabled. which im not certain is related.
Let me know if i'm not checking the right logs.

Instead of manually creating endpoint, I recommend to remove the endpoint property from prisma.yml entirely. Make sure that your CLI is logged into the same account as the Heroku server is connected to. Run prisma deploy and now choose the Heroku server in the list of options. This will print a new entry endpoint into prisma.yml, which you can now paste into your env file.

@marktani still no luck :(

screen shot 2018-08-09 at 6 15 51 pm

I am logged in with the exact CLI command presented in the Services tab of the workspace.

EDIT: @marktani even when I try to do prisma init in a new folder I get the same thing:

Alright, that was worth a try! 🙂

You still haven't shared the actual server log that corresponds to the request id. Could you show that one?

@marktani not sure I know how to do that.

I nuked everything and tried again from the start, now I get this 🙃

I'll keep trying stuff I guess.

screen shot 2018-08-10 at 12 24 00 pm

Hey @harrisrobin, this problem is documented here including a workaround: https://github.com/prismagraphql/prisma-cloud-feedback/issues/196#issuecomment-412226170.

@marktani still no luck :(

screen shot 2018-08-09 at 6 15 51 pm

I am logged in with the exact CLI command presented in the Services tab of the workspace.

EDIT: @marktani even when I try to do prisma init in a new folder I get the same thing:

Hi @marktani, I've encountered a similar situation. Is there a work around to this problem yet ?

Today I had same problem. I checked heroku logs and it shows same error as prisma when I tried to deploy my app. I had no problem with deploying to prisma demo server but when I created heroku one with prisma client this thing happens. Anyone got idea hot to fix it?

Me too! Using Prisma 1.19.3 on Heroku

@AmoDinho @kaczmarekm - I've created a new issue with repro repo here:

https://github.com/prisma/prisma/issues/3502

Please report in there if you find a solution, or have anything to add :-) I think @divyenduz will look at it soon

@marktani it looks like this issue was closed without the original problem being resolved. The issue you linked to before closing is related to a prisma cloud bug, not the original problem of an authentication error on deploy.

Could you reopen this? I'm running into the same problem today.

Hi @liamdanielduffy , I managed to get around this issue by updating Prisma to the latest beta version. If that does not work maybe try logging out of the CLI and try to deploy again. 🤷‍♀️ as mentioned here #3608 .

@AmoDinho Thanks so much! The fix in the beta worked for me.

Unfortunately, it doesn't look like the service is visible from the Prisma Cloud console. @marktani any ideas on why it might not be showing up after a seemingly successful deploy?

same issue
image

Can you please re-open this

@gilbertlucas46 : I believe that this error is specific to your workspace. Can you please reach out to [email protected]. I would love to help you navigate you through this one. Thanks.

@divyenduz, just sent an email to support, still seeing this issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  ·  3Comments

AlessandroAnnini picture AlessandroAnnini  ·  3Comments

schickling picture schickling  ·  3Comments

ragnorc picture ragnorc  ·  3Comments

sorenbs picture sorenbs  ·  3Comments