Prisma1: Your token is invalid. It might have expired or you might be using a token...

Created on 20 Apr 2019  Â·  3Comments  Â·  Source: prisma/prisma1

Describe the bug
‼ Your token is invalid. It might have expired or you might be using a token from a different project.: {"response":{"errors":[{"message":"Your token is invalid. It might have expired or you might be using a token from a different project.","code":3015...

This issue occurs when deploying to dev on prisma-eu1.

To Reproduce

  1. Globally install of prisma npm i -g [email protected]
  2. Update datamodel to v1.1 syntax.
  3. Run prisma deploy --env-file variables.env

Expected behavior

  1. Update Prisma table structure
  2. Generate new prisma.graphql file via hook speceified in prisma.yml
hooks:
  post-deploy:
    - graphql get-schema -p prisma

Screenshots
post-deploy-error

Versions (please complete the following information):

  • Connector: Dev - prisma-eu1 (MySQL). Production Heroku (Prisma 1.32.0-beta/PostgresSQL)
  • Prisma Server: Dev - 1.32.0-beta. Proiduction - installed 1.32.0-beta-heroku
  • prisma CLI: [e.g. prisma/1.32.0-beta (darwin-x64) node-v9.5.0]
  • OS: Windows 10 Pro
  • prisma-binding - 2.2.14

Additional context
This issue does not occur when deploying to production (Heroku, with prisma instance updated to 1.32.0-beta-heroku)

production-deploy

kinquestion arecli

Most helpful comment

Looks like you are using a secret in development in your prisma config. That is why it is asking for a token.

I will recommend not to use graphql cli now as it uses introspection for this. Instead use the prisma cli itself to generate the graphql schema.

Add this to your prisma.yml

generate:
  - generator: graphql-schema
    output: ./path/to/your/schema.graphql

After this run prisma generate to generate your schema.

All 3 comments

Looks like you are using a secret in development in your prisma config. That is why it is asking for a token.

I will recommend not to use graphql cli now as it uses introspection for this. Instead use the prisma cli itself to generate the graphql schema.

Add this to your prisma.yml

generate:
  - generator: graphql-schema
    output: ./path/to/your/schema.graphql

After this run prisma generate to generate your schema.

@pantharshit00 Many thanks for the update.

I updated my package scripts so:

"deploy": "prisma deploy --env-file variables.env&& prisma generate --env-file variables.env&&...",

replaced the hooks: section of my prisma.yml file with the generate: section you referenced, and finally npm run deploy.

All is working fine now.

Closing as this is resolved now :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marktani picture marktani  Â·  3Comments

sedubois picture sedubois  Â·  3Comments

ragnorc picture ragnorc  Â·  3Comments

sorenbs picture sorenbs  Â·  3Comments

MitkoTschimev picture MitkoTschimev  Â·  3Comments