prisma: Error: Command was killed with SIGSEGV (Segmentation fault): /Users/.../node_modules/prisma2/query-engine-darwin --enable_raw_queries cli --dmmf
Redwood was released yesterday, and we have 2 reports of segfaults in Prisma tooling:
This issue is our representation of the second one above:
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 theexample-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 |
The Redwood team also supplied some context where in their code our tooling is called here:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 25 (11 by maintainers)
I sure am, I knew it was a bad idea to use newest node 🙃 I’ll try an older node, thank you
EDIT
node 12.16.3 works perfectly, thanks again!
We could reproduce internally and are now investigating and working on a fix.
I ran into this issue when attempting seed 1,230 objects into a Supabase table. I was using node v17.x at the time and every time I ran
yarn prisma db seed
it would get terminated tossing the following error:I then changed back to the most recent node LTS (v16.16.0 at the time of this writing) and it worked without issue.
This solved it for me too! Thank you. I used the snippet here to force the node version to 12.16.3 for my Prisma-containing project only.
Using Node.js v12 instead of v14 fixed the issue for me as well.
@cephalization
Are you using Node js 14? If yes, please try the latest alpha
npx @prisma/cli@alpha generate
. See #2361 , in case of node 14 the segfault is coming from Node js and not from Prisma when we try to concurrently write files to the file system. We need to open a bug in Node for that but for now we have implemented a workaround which is available in alpha.Thanks @olance - this confirms our observations: There is a chunk of data missing in the binaries for an unknown reason. As I wrote above, we have our theories but we do not know for sure. We will get more data when
preview025
is released and adopted by e.g. Redwood and you can try this again.Hi @janpio thanks for pointing me to this issue!
I think I’m now 99% sure this was a corrupted binary that caused the issue:
Working project on one machine and non-working one on another were using the exact same version of Prisma packages
However, the
query-engine-darwin
binaries were different: there was at least one big 3MB chunk of zeroes in one of them, that was actually filled with data in the other.Deleting the cache (
rm -rf ~/.cache/prisma
) and regenerating the Prisma Client fetched a more recent version and fixed everything on the machine that kept on failingthe faulty binary was fetched on March the 19th
the working binary was fetched on March the 22nd
I currently have, on the machine where things were failing initially, an engine binary in my cache whose
lastModified-query-engine
file saysTue, 03 Mar 2020 14:19:39 GMT
, and it works. Not sure why it got downloaded along with the other binary from the 23rd of March though, but it really points to a corrupted download that got fixed by clearing the cache.I’d really encourage implementation of a checksum indeed, that would help at least catch the issue early on if it’s really a corruption problem.
I don’t think crash reports will be very helpful if we’re really looking at corrupted downloads, but just in case, here goes:
The 20 crash reports I have for
query-engine-darwin
have an identical stack for the crashed thread.I have uploaded all crash reports for your review, including one for
introspection-engine-darwin
and one formigration-engine-darwin
(which I don’t think will be very helpful, but who knows).The archive also contains a copy of the working runtime and one of the faulty runtime. Hopefully you can manually checksum the last one and figure out whether it matches any of the generated runtimes you’ve produced lately… or even reproduce crashes locally 🙂
That’s it! Let me know if I can help in any way!
@olance down node to node@12 solve the problem
Oh, I had missed your Node version… from what I gathered Prisma doesn’t work with Node 14 right now, you need to downgrade to v13