prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

Prisma CLI does not respect explicit PRISMA_MANAGEMENT_API_SECRET, overrides it

Open jhalborg opened this issue 8 years ago • 4 comments

Describe the bug When prodiving the PRISMA_MANAGEMENT_API_SECRET env var to the CLI, it should use that value and not override it with a value based on the logged in account

To Reproduce Steps to reproduce the behavior:

  1. Be logged in to Prisma CLI
  2. Have a deployed server protected by a managementApiSecret
  3. Try to perform prisma deploy
  4. See error:
Creating stage dev for service heroku-database

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:cjofwmfmt00050684141qxrsn"
    }
  ],
  "status": 200
}

Expected behavior For the deploy to be succesful

Versions (please complete the following information):

  • OS: MacOS Mojave
  • prisma CLI: prisma/1.21.0 (darwin-x64) node-v10.9.0
  • Prisma Server: [e.g. 1.20.4]

Additional context This was the root of the problem in this issue, more context can be found here.

Workaround Log out of the CLI and perform the deploy.

jhalborg avatar Nov 27 '18 12:11 jhalborg

@jhalborg Now, I have a this problem same you.

colevels avatar Nov 27 '18 14:11 colevels

Same here. The workaround helped for now

HyveMynd avatar Nov 27 '18 17:11 HyveMynd

I try to prisma log out and clear cloud session key It's not working. But I can deploy first server and first service. In the server & service 2 It's can't deploy. I try to use Heroku to practice step to deploy.

colevels avatar Nov 28 '18 05:11 colevels

This is fixed in beta.

timsuchanek avatar Nov 29 '18 13:11 timsuchanek