Redwood: [Prisma Bug] Error while generating Prisma client in Example Blog

Created on 11 Mar 2020  ·  13Comments  ·  Source: redwoodjs/redwood

This project looks great! I'm hoping to get a demo going with TinaCMS added to it for content editing.

Unfortunately, running yarn rw db up threw an error while I was trying to setup the example-blog.

Migrate database up... [completed]
Generating the Prisma client... [started]
Error: Error: Command was killed with SIGSEGV (Segmentation fault): /Users/ncphillips/Code/ncphillips/example-blog/node_modules/prisma2/query-engine-darwin --enable_raw_queries cli --dmmf
Generating the Prisma client... [failed]
→ Command failed with exit code 1: prisma2 generate
Command failed with exit code 1: prisma2 generate
✨  Done in 1.66s.

I can reliably reproduce by following the Install Steps for the Example Blog, even from a fresh clone. The only thing I changed from teh repo is I switched the datasource provider to sqlite.

| OS | macOS 10.15.3 |
| node | 12.14.1 |
| yarn | 1.15.2 |

kinbug prisma

Most helpful comment

Hey @ncphillips, thanks for reporting this - I created a sister issue over at Prisma so we do not spam this one with our investigation: https://github.com/prisma/prisma2/issues/1819 You can subscribe to that one for updates, and we might @ mention you to e.g. request more information.

All 13 comments

Hey @ncphillips, you're the second person (@sw-yx was the first to report this) that has experienced this segfault. I'll report this to the Prisma team!

Wicked! I updated the title to appropriately pass the buck 😉

Hey @ncphillips, thanks for reporting this - I created a sister issue over at Prisma so we do not spam this one with our investigation: https://github.com/prisma/prisma2/issues/1819 You can subscribe to that one for updates, and we might @ mention you to e.g. request more information.

@ncphillips, can you still reproduce the problem with the segfault? If so, could you zip up the whole project and send it over to [email protected]?

We currently can reproduce this ourselves consistently, but have a theory that the binary might have been corrupted somehow. Having the actual file would allow us to check that.

Also, there might a crash report on your machine. You can get to it by opening console.app (via Spotlight) and then going to the User Reports tab:
image
(German screenshot unfortunately) If you have something in there for query-engine-darwin, it might be interesting for us to know what it says <3

@janpio done 👍

Thank you so much, with the binary you sent in we can indeed reproduce the error consistently. Something is funky here. Very funky.

To work around this, you can download the binary manually from https://prisma-builds.s3-eu-west-1.amazonaws.com/master/d3b0ceed5d87544b9d2decb70e08664f9047bb73/darwin/prisma.gz, unpack it and rename the file prisma to query-engine-darwin, then replace the existing node_modules/prisma2/query-engine-darwin file with it. Then you should be able to successfully run yarn rw db up.

Would actually be great if you could try these steps, just to confirm this really works and there is nothing on your system messing with these files (one of the theories we are currently looking into... yes, it sounds crazy).

Yeeeee boi

image

Ok - thank you! So the problem definitely is in the downloading or unpacking of the binary.

We are investigating and will try to figure out what exactly is wrong here, but also implement measures to warn users or fix it for them (if possible). We'll keep you updated here.

Amazing, thanks @janpio. I'm going to close this.

I am receiving a similar issue on Windows although in my case the Generating Prisma client step would just hang and I had to terminate it after leaving it for 10 minutes. Eg.

image

I looked into the solution above that worked for @janpio but my the Prisma node module didn't contain a query-engine-darwin file to replace. I do have these following files though - query-engine-rhel-openssl-1.0x and query-engine-windows.exe. Should I be looking to update one of those instead?

Nevermind - I just realized I needed to update the binaryTargets in the schema.prisma file from binaryTargets = ["native", "rhel-openssl-1.0.x"] to binaryTargets = ["native", "windows"]

@janpio I think we have something of like kind to this being reported in our forum running Prisma2 preview023.

Could you take a look and add any suggestions? This is another strange one…

https://community.redwoodjs.com/t/tutorial-fetching-posts-throws-errors/162/12

Will do, but I think I have also seen an issue from the user in our repo. Thanks for pinging me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cannikin picture cannikin  ·  3Comments

balaji-balu picture balaji-balu  ·  3Comments

freddydumont picture freddydumont  ·  3Comments

weaversam8 picture weaversam8  ·  3Comments

jtoar picture jtoar  ·  4Comments