-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault crash when using prisma client when using PostgreSQL #10649
Comments
Happens here as well, pre- 3.6.0 does not have this issue. M1 mac |
Any idea how to reproduce? If this was a universal things, we would have hundred of reports instead of just 2 of course - so something needs to trigger that. @sveisvei Can you please also post all the versions of all the things you are using? |
I still don't know what the issue could be, but I have followed this guide to debug this issue a little bit more. I have to admit, I don't have any experience with this, but I have attached crash.log file which got generated by the segfault-handler module:
Maybe this helps |
Okay, well, I spend another (at least) four hours playing with things and got it to work: I basically only had to build my own engines - it works now ^^ |
So you analysis would be that the |
Yes, probably |
I am also getting a segmentation fault when using My segfault crash logs also point to the same engine issue. I'm on Ubuntu 20.04. Can I get more details on the engine you are now using? @SCDerox |
I just fixed this by using the binary engine instead of the library engine. Will there ever be a proper fix for this? |
If you can provide a proper reproduction, we could potentially follow what is happening and try to fix it. Without a reproduction, it will be impossible. As @SCDerox 's initial problem probably was related to their operating system, and yours is clearly not, please open a new issue and provide all the information the bug report template asks for @tisuela. |
Tested with a fresh install of prisma-client @ 3.7.0, and the error did not occur anymore. |
Let's close this then 👍 @sveisvei If Prisma not working on Pop!_OS is a general thing, could you maybe create an issue with reproduction steps so we can confirm this is the case and then potentially fix this? Thanks. |
I'm still getting this error after doing this.
@tisuela How do I do this? Environment: Ubuntu 20.04 LTS running on Windows WSL2 Logs:
|
Can you share your project? Is this reproducible on other computer? |
@janpio Here are the steps to reproduce this. I used a fresh VM (Ubuntu 20.04 LTS) on Google Compute Engine. I used a fresh PostgreSQL database (try Supabase for a quick test). npm init -y
npm install -D prisma
npm install @prisma/client
nano schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = "URL"
}
model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
} npx prisma generate
npx prisma studio Now try and view a model on localhost:5555... Prisma Studio frontend logs:
Console logs:
Error also seen with Ubuntu 18.04 LTS on Windows WSL2. I cannot reproduce this on my home setup (Arch Linux). Error could not be fixed by changing engine to binary (cc @tisuela) generator client {
provider = "prisma-client-js"
engineType = "binary"
} |
I also rolled back to prisma 3.5.x |
Not sure if this helps but I tried using Google Cloud SQL for PostgreSQL but having the same issues:
Error persists when using version 3.5.0 for prisma CLI and client:
|
Note that the later comments might actually describe a different problem, as your error message does not include the |
So far the messages on WSL2 have been |
@pantharshit00 Ah, the issue is fixed for me (on Ubuntu 20.04 WSL2) after updating to Node 17 LTS. Previously I was on Node 14 LTS. If you can replicate this on the lower Node version it may be worth refreshing the docs:
|
If this is failing on older Node versions, we can hopefully reproduce with that and then figure out what is going on. |
Experiencing seg faults running Ubuntu server 22 on a raspberry pi 4 and using the latest prisma (4.12). Downgrading to prisma 4.0 fixed it for me. |
(just a heads up that the link was wrong in the previous comment in case you are reading it in email notifications and not in GitHub UI, updated it #18510) |
For those having issues with segmentation fault (I got them on My migrations container:
|
Installing the following version temporarily solved it for me: npm install --save-dev [email protected]
npm install --save @prisma/[email protected] |
This issue is fixed in Prisma 4.13.0 which will be released tomorrow, on Tuesday, Apr 18. If you need to temporarily use a pre-release version until then, you can use
|
@mrsufgi Can you please open a new issue for the configuration where something went wrong for you, which you could fix by removing |
@janpio that actually sounds expected: if |
To anyone else using |
I've spent many hours trying to figure out why Prisma is segfaulting in the query engine, have tried changing the engine format to "engine" but without any promising result unfortunately.
I tried playing around with different versions and found that node 18.16 and above has this problem, from what I can tell node version So basically this was the workaround I came up with: # Dockerfile
FROM node:18 -> FROM node:18.15 |
@hampfh Could you create a new issue for this? This issue is now closed since a few months, and we do not re-open a closed issue when a new similar problem comes up, as it might be unrelated to the original issue. |
This error still happens with version 4.15.0. (NodeJS v18.11.0) |
I was able to fix this for us by going from |
I've just encountered this issue when running my NodeJS app with Prisma on Render.com. Node 22 LTS, Prisma 5.22. Adding |
Same here the |
@chinanderm @albibenni could you please open new issues with more info for reproduction (e.g. a Dockerfile)? The specific issue you are commenting on is three years old, fixed long time ago and has regression tests that ensure it doesn't occur again. The problem you are facing is probably very similar (especially if only the Node-API engine is affected) but we still can't investigate it without any context. Posting comments here also spams the inboxes of 62 more people who don't have this problem anymore. |
Bug description
When trying to use
findMany()
(or any other method) on a model, prisma client crashes and the following line appears in my log:Segmentation fault (core dumped)
.This only happens if I use PostgreSQL as far as I know, this first appeared when I switched to PostgreSQL from mysql.
How to reproduce
Segmentation fault (core dumped)
gets logged in the consoleExpected behavior
The script does not crash.
Prisma information
Example schema:
Example test client:
Environment & setup
Linux pop-os 5.15.5-76051505-generic #202111250933~1638201579~21.04~09f1aa7-Ubuntu SMP Tue Nov 30 02: x86_64 x86_64 x86_64 GNU/Linux
)Prisma Version
The text was updated successfully, but these errors were encountered: