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
Huge Int value in upsert
causes: "PANIC: called Option::unwrap()
on a None
value in query-engine/core/src/query_document/parser.rs:250:87"
#10049
Comments
Can you reproduce this consistently? Even more interesting, can you build a reproduction of it in an isolated project? I know we get these reports sometimes, but we could never reproduce them (reliably) ourselves and so are having a really hard time pinpointing what is going on. |
I can reproduce it. If I send a lot of queries it will happen after a few minutes. Happy to give repo access to the Prisma team if it helps you debug it properly. |
Any chance this will work better if I use queryRaw or it won't make any difference? |
Latest update:
|
That would be nice. Can you please invite @janpio and @pantharshit00? Thanks.
That might be interesting to test actually. "Just" send the same queries the current Prisma Client call creates via I am really happy you found a workaround, even though it adds half a second delay between each upsert - I hope that is acceptable to you for now. We will look into this of course, especially as there are also other, related issues. Hope we can figure this out soon. |
So the workaround isn't perfect. Even with 500ms break it still happens but a lot less than before. Was actually trying to reproduce the problem today locally but couldn't get it to crash locally (probably would have eventually if I waited long enough). I'll work on a demo repo and see if I can stress Prisma enough to resurface the bug on a consistent basis. |
"Kinda consistent" is also fine, we just need something we can get to run in under half an hour with instructions on how to hammer it to probably cause the problem sooner or later. |
In response to:
MacOS but also on Linux in production.
Quite heavily nested but hard to pinpoint. A lot of upserts one after the other.
Yes, I can't reproduce in a fresh repo so will give access to our main one even though the set up takes more effort. Will hopefully update with access in the next hour. |
Well I'm struggling to reproduce now. Which I guess is a good thing 🤷♂️ |
Another update: If I can find a reproduction in the future I will share again. Always happy to add to the repo if you'd like to take a look around. |
Yes, if you can share a reproduction, that would be great. Otherwise, it would be very hard to triage. |
This is still a major issue for us. If it helps get the ball rolling I can add to our GitHub repo and share the Sentry errors too. I've tried to create simple and complex reproductions with no luck but we get a lot of errors for this issue consistently. |
The code in question where the PANIC error can happen: export async function upsertEvent(myId: number, event: Prisma.EventCreateInput) {
try {
return await prisma.event.upsert({
where: { myId },
create: event,
update: event,
})
|
@elie222 Share your reproduction to |
Will do. Another update: |
Same issue here when taking data from an API and doing a |
Interesting. There's a chance that that was the issue for us too. We never found the actual cause of it just that unnesting fixed it. |
Can you turn that into a reproduction @enzojavier-desimone? |
Ditto. It took some debugging to narrow down to the specific input being passed into an |
Same question to you, can you provide a minimal reproduction of this @gleuch? That would be amazing. |
Thanks for the reproduction @gleuch. I can confirm this issue now. We need to properly handle these panics. |
Everyone else who posted in this issue (@elie222 @yassinebridi @enzojavier-desimone), can you take a look at https://github.com/gleuch/prisma-panic-example/blob/main/index.js and confirm this could also be causing your issue? |
yes, exactly same issue in my case |
Option::unwrap()
on a None
value in query-engine/core/src/query_document/parser.rs:250:87upsert
causes: "PANIC: called Option::unwrap()
on a None
value in query-engine/core/src/query_document/parser.rs:250:87"
It’s possible that was causing the issue.
I know that removing nesting fixed it for us though. Maybe it just made the error less obscure. But panic went away after unnesting.
Best,
Eliezer
…On Tue, Mar 22 2022 at 3:45 PM, EJDS < ***@***.*** > wrote:
yes, exactly same issue in my case
—
Reply to this email directly, view it on GitHub (
#10049 (comment) ) ,
or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAXSQXZVF3FHVRD44X2AGIDVBHFJNANCNFSM5HFLA6IA
).
You are receiving this because you were mentioned. Message ID: <prisma/prisma/issues/10049/1075200380
@ github. com>
|
3.15 will ship a change that returns a structured error for over or underflowing integers instead of a panic. |
UPDATE: I can reproduce this error consistently.
It happens after sending quite high volume to Prisma. Nested upserts. It only starts to show after a few minutes.
Happening both locally and on our deployed servers.
Hi Prisma Team! My Prisma Client just crashed. This is the report:
Versions
What happened:
I was sending a high volume of upserts to Prisma. I can send the schema in private if needed.
Logs
Client Snippet
// PLEASE FILL YOUR CODE SNIPPET HERE
Schema
I can send the schema in private if needed.
// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
Prisma Engine Query
The text was updated successfully, but these errors were encountered: