Prisma1: Unable to deploy graphql server with private prisma cluster using now

Created on 20 Mar 2018  Â·  4Comments  Â·  Source: prisma/prisma1

Bug Report

Current behavior

When I try to a deploy my prisma-based graphql server to now.sh using this official tutorial, npm run build fails with the following:

Benjamins-MacBook-Pro:prisma-server benjaminlowenstein$ now -T betterme --dotenv .env.production 
UPDATE AVAILABLE The latest version of Now CLI is 10.2.1
> Deploying ~/dev/evolve/prisma-server under betterme
> Using Node.js 8.10.0 (default)
> Ready! https://prisma-server-hntmwdoljw.now.sh (copied to clipboard) [5s]
> Synced 15 files (239.77KB) [5s]
> Initializing…
> Building
> â–² npm install
> ⧗ Installing 14 main dependencies…
> ✓ Installed 917 modules [10s]
> â–² npm run build
> [email protected] build /home/nowuser/src
> rm -rf dist && graphql prepare && tsc
> npm ERR! errno 1
> npm ERR! [email protected] build: `rm -rf dist && graphql prepare && tsc`
> npm ERR! Exit status 1
> npm ERR! 
> npm ERR! Failed at the [email protected] build script.
> npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
> npm ERR!     /home/nowuser/.npm/_logs/2018-03-20T04_23_55_831Z-debug.log
> Cluster evolve, that is provided in the prisma.yml could not be found.
> If it is a private cluster, make sure that you're logged in with prisma login
> npm ERR! A complete log of this run can be found in:
> npm ERR! code ELIFECYCLE

Reproduction

  • Create a private prisma cluster
  • Create graphql server locally in docker that connects to prisma service in private cluster
  • Hit 'now' to try to deploy

If your problem can be reproduced with a certain service definition, please create a new GitHub repository with the reproduction instructions.

Expected behavior?

The server builds successfully via now, and the build step succeeds

Additionally, worth noting that the tutorial seems to imply that now can only be done with a public cluster

aredocs

Most helpful comment

With help of @lionstone we confirmed that this addition resolves the problem:


In your now build script, add

prisma login --key <CLOUD SESSION KEY>

You can find a valid cloud session key in your ~/.prisma/config.yml file on the machine you are logged in.


This note should be added to the tutorial.

All 4 comments

With help of @lionstone we confirmed that this addition resolves the problem:


In your now build script, add

prisma login --key <CLOUD SESSION KEY>

You can find a valid cloud session key in your ~/.prisma/config.yml file on the machine you are logged in.


This note should be added to the tutorial.

This is what I'm doing:

now secret set prisma-token $(prisma token)

and then setting the env variable to the value of the secret

  "env": {
    "PRISMA_CLOUD_SESSION_KEY": "@prisma-token"
  }

Thanks for finding this out!

@nikolasburk - we should make sure this is properly reflected in the docs at https://www.prisma.io/docs/tutorials/graphql-server-development/deployment-with-now-ahs1jahkee

Thanks for opening this issue @lionstone! As private clusters in private cloud don't exist any more, I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  Â·  3Comments

nikolasburk picture nikolasburk  Â·  3Comments

thomaswright picture thomaswright  Â·  3Comments

tbrannam picture tbrannam  Â·  3Comments

sedubois picture sedubois  Â·  3Comments