Prisma1: Better error message for "'secretOrPrivateKey must have a value'" on prisma deploy to local

Created on 9 Jan 2018  Â·  9Comments  Â·  Source: prisma/prisma1

prisma - 1.0.0-beta4.0.5
node - 9.3

to reproduce:

prisma init test
cd test
prisma deploy

then select local at prompt to get:

Added cluster: local to prisma.yml
 â–¸    secretOrPrivateKey must have a value
bu2-confirmed

Most helpful comment

Could you try generating a new cluster secret using graphcool local start? Please verify that it was inserted into ~/.graphcoolrc.

All 9 comments

I got the same issue after updating from beta 3xxx to beta4.1.1
sorry but whithout being able to deploy I cannot use graphcool...

In ~/.graphcoolrc, there should be a graphcool-1.0 key with the property clusters.

The local cluster should have a clusterSecret property that looks somewhat like this:

-----BEGIN RSA PRIVATE KEY-----\r\n .......\r\n-----END RSA PRIVATE KEY-----\r\n

Can you confirm this is the case for you? 🙂

my Cluster secret is empty. Is there a cli option to generate?

@KTITS-Tom the clusterSecret is regenerated each time you execute gc local start.
Can you set the env var DEBUG=* and post the stack trace of the error here? Thanks a lot!

DEBUG=* gc deploy

config CWD c:\src\XXX\server +0ms
config HOME C:\Users\XXX +4ms
config definitionDir c:\src\XXX\server +1ms
config definitionPath c:\src\XXX\server\graphcool.yml +2ms
cli command id deploy +0ms
cli:plugincache Got plugin from cache +0ms
cli:plugincache C:\Users\XXX.cache\graphcool\plugins.json +2ms
cli:plugincache Got plugin from cache +3ms
cli:plugincache C:\Users\XXX.cache\graphcool\plugins.json +1ms
plugins findCommand graphcool-cli-core +0ms
plugin requiring command +0ms
cli-engine:plugins:manager requiring C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-core +0ms
portfinder:defaultHosts exports._defaultHosts is: [ '0.0.0.0', 'fe80::58b7:cae7:f41f:ac4e', '192.168.11.81', '10.0.75.1', '192.168.111.30', '::1', '127.0.0.1' ] +0ms
cli-engine:plugins:manager required +676ms
plugin required command +684ms
Environment migrating +0ms
EnvironmentMigrator graphcoolPath C:\Users\XXX.graphcool does not exist +0ms
Environment [ 'graphcool-eu1', 'graphcool-us1', 'shared-public-demo' ] +281ms
Environment { 'graphcool-eu1': 'https://graphcool-eu1.graphcool.cloud',
Environment 'graphcool-us1': 'https://graphcool-us1.graphcool.cloud',
Environment 'shared-public-demo': 'https://database-beta.graph.cool' } +2ms
deploy run +0ms
Error: secretOrPrivateKey must have a value
at Object.module.exports [as sign] (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\jsonwebtoken\sign.js:101:20)
at Cluster.getLocalToken (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\src\Cluster.ts:46:30)
at Cluster. (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\src\Cluster.ts:36:19)
at step (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\dist\Cluster.js:32:23)
at Object.next (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\dist\Cluster.js:13:53)
at C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\dist\Cluster.js:7:71
at new Promise ()
at __awaiter (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\dist\Cluster.js:3:12)
at Cluster.getToken (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-yml\dist\Cluster.js:52:16)
at Client. (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\src\Client\Client.ts:131:33)
at step (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\dist\Client\Client.js:32:23)
at Object.next (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\dist\Client\Client.js:13:53)
at C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\dist\Client\Client.js:7:71
at new Promise ()
at __awaiter (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\dist\Client\Client.js:3:12)
at Client.initClusterClient (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-engine\dist\Client\Client.js:55:16)
at Deploy. (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-core\src\commands\deploy\index.ts:134:23)
at step (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-core\dist\commands\deploy\index.js:42:23)
at Object.next (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-core\dist\commands\deploy\index.js:23:53)
at fulfilled (C:\Users\XXX\AppData\Roaming\npm\node_modules\graphcool\node_modules\graphcool-cli-core\dist\commands\deploy\index.js:14:58)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
Exiting with code: 1

Could you try generating a new cluster secret using graphcool local start? Please verify that it was inserted into ~/.graphcoolrc.

after running gc local nuke and gc local start a secret is created and I am able to deploy!! Thanks a lot @marktani @timsuchanek

Awesome!

I renamed the issue. A non-existing secret should be handled gracefully when deploying.

Closing this for now, please create a new issue if you encounter a similar problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoodsy picture hoodsy  Â·  3Comments

schickling picture schickling  Â·  3Comments

akoenig picture akoenig  Â·  3Comments

ragnorc picture ragnorc  Â·  3Comments

jannone picture jannone  Â·  3Comments