Prisma deploy no longer works, Cannot read property thron


#1

I’ve been using prisma since about a month and repeated the same working installation steps on several machines and never had a problem. As of today for some unknown reason I am getting an error I am unable to debug when trying to deploy.

Cannot read property 'split' of undefined

The steps I took before deploy were

prisma login
prisma init
prisma deploy

I just can’t deploy and keep getting this error.
I tried to add debugging and it’s failing at StatusChecker

plugin required command +887ms
  StatusChecker setting status checker +941ms
TypeError: Cannot read property 'split' of undefined
    at getWorkspaceFromPrivateOrigin (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/utils/parseEndpoint.ts:20:79)
    at Object.parseEndpoint (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/utils/parseEndpoint.ts:46:21)
    at PrismaDefinitionClass.get [as cluster] (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:121:13)
    at PrismaDefinitionClass.getClusterName (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:256:17)
    at PrismaDefinitionClass.validate (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:127:30)
    at PrismaDefinitionClass.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:63:12)
    at step (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:32:23)
    at Object.next (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:13:53)
    at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:4:58)
    at <anonymous>
Exiting with code: 1

What can I do?

osx
nom: 6.8.0
node: 8.9.4
prisma: 1.26.6


#2

You are using VSCode GraphQL extension by Prisma, that had the issue (with version 0.1.6), can you confirm? Updating that to 0.1.7 should fix it for you.

0.1.6 was sending a lot of requests to our servers and your IP got blocked.

Please share your IP address with me for me to unblock it.
If you still run into issues afterwards please DM me (on slack, my handle is divyenduz).


#3

Ah I see! Thank you this is starting to make sense yes because it seems to work on and off then at some point I did get an error cloudfront “blocked”.

Yes I am using VSCode GraphQL Extension. I will DM you, thank you.


#4

I’m having the same problem but I’m not using that VSCode plugin. I just tried to do my first prisma deploy and get the same errors:

TypeError: Cannot read property 'split' of undefined
    at getWorkspaceFromPrivateOrigin (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/utils/parseEndpoint.ts:21:23)
    at Object.parseEndpoint (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/utils/parseEndpoint.ts:53:21)
    at PrismaDefinitionClass.get [as cluster] (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:132:13)
    at PrismaDefinitionClass.getClusterName (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:284:17)
    at PrismaDefinitionClass.validate (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:138:30)
    at PrismaDefinitionClass.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:63:12)
    at step (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:32:23)
    at Object.next (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:13:53)
    at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:4:58)
    at <anonymous>
Exiting with code: 1

prisma/1.28.0 (darwin-x64) node-v8.12.0
mac osx

I’m using an environmental variable in my setup:

prisma.yml:

endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.prisma
# secret: ${env:PRISMA_SECRET}
hooks:
  post-deploy:
    - graphql get-schema -p prisma

datamodel.prisma

type User {
  id: ID! @unique
  name: String!
}

variables.env

FRONTEND_URL="http://localhost:7777"
PRISMA_ENDPOINT="https://us1.prisma.sh/lahodareact/dev"
PRISMA_SECRET="omgplzdonttelnnlnllanyone"
APP_SECRET="jwtsecret12nmnnj3"
STRIPE_SECRET="sk_123nlnjlnkhis"
PORT=4444

did prisma login
then prisma init
then prisma deploy --env-file variables.env
then this error came up and it’s failed every time. I tried reinitializing but it didn’t change anything. I did NPM Update and no change.
Not sure what else to try.


#5

I’m having this exact same issue as @rlahoda


#6

I created a service in the gui and deployed and things seem to be working now.


#7

Having the same issue while trying to create a new service. Can you unblock my IP?


#8

This should be fixed now, Please try again.


#9

I’m having the same issue, tried the reinstall and nothing happened.


#10

I am also having the exact same issue as @rlahoda
However, I’m a complete beginner when it comes to GraphQL. Would you mind elaborating a little about how you created a service in the gui?


#11

Yes I am having the same problem and tried updating and also by removing vscode graphql extention. but issue is not solved yet.


#12

@kelly.packer I had my problem solved in a different site, but here’s what the person posted that got my problem solved:

I was able to solve this by doing the following… I haven’t proceeded much further, but it gets the service deployed:

Step 1: Go into the prisma web app, and click on settings.
Step 2: Look for Workspace Slug (at the top for me)
Step 3: Save Workspace
Step 4: Add workspace slug between prisma.sh/ and /sick-fits/ (or w/e you called it) in your end point. For example, my end point looks like: “https://us1.prisma.sh/josh-a1b2c3d4/josh-sick-fits/dev
Step 5: Deploy

This looks like a bug in prismas cli, they aren’t adding the workspace name to the end point by default and it’s blowing up their deploy code.

Hope it helps!


#13

Hey, Thanks!

This worked for me.


#14

Worked perfectly, maybe we can add an issue in github and link it here?