Prisma queries fail in production
Hello,
I’m using
@prisma/extension-accelerate
with Expo Router API Routes (which run in Cloudflare Workers).
I encounter the following error in my deployed API. The strange part is that sometimes it works, and sometimes it doesn’t. I’ve attached a screenshot showing how I instantiate Prisma.
(NOBRIDGE) LOG tokens {"error": "
Invalid prisma.user.upsert()
invocation:
Cannot fetch data from service:
Unable to connect to the Accelerate API. This may be due to a network or DNS issue. Please check your connection and the Accelerate connection string. For details, visit https://www.prisma.io/docs/accelerate/troubleshoot."}
Hopefully, I'm doing something wrong and this has a quick fix. Thank you!
6 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai
if you'd like a quick chat with the bot anyway!Hey Beto! 👋
Glad to see you here 🙂
Can you share with me the email id or the GitHub handle with which you signed up on Prisma Console? I would like to take a look at the logs for your project.
If I understand correctly, you are getting this error intermittently, right?
Are there any specific queries which always fail?
Hi Nurul 👋 thanks for helping me 🙂
My handle is: betomoedano
Yes, this was working more or less but my latest deployment is not working at all, you can check it out here: https://social-universe.expo.app/ if you try to sign in with google you'll get the error above. (this works in my local which makes me suspicious of a worker environment limitation issue)
I'm happy to share more code or create a minimal repro or even join a call with you to explain what I'm doing in detail. Let me know.
Thank you for sharing the handel and apologies for the delay in getting back.
I see you have a project titled "Social Universe", which has two environments "Production" and "Development". I assume you are getting the error in "Production" environment?
I checked logs for both of these environments and I don't see any errors. Are you able to reproduce this error consistently? If yes, it would be very helpful to us in debugging this if you can provide a minimal reproduction.
Hey Nurul!
I've spend the last two days trying to repro this issue without success 😦
Sometimes it works and sometimes it doesn't, I tried creating a new environment from scratch and it woked fine with a simple user model. I thought maybe there is no issue haha but then I added my schema and it it worked! but after some requests it stopped working. Today, it was working again, then it stopped again, now it works again.
I have no idea what's wrong, but I'll keep an eye on this. Thank you again! I'll le you know if I can repro later.
This happends in productions environment
(deployed api routes)
Let me know if I can assist now or in future 🙂