P
Prisma5d ago
Abakir

I keep getting this error Error in performIO: Driver

How do I solve this issue when using npx prisma db push with cloudflare Error in performIO: Driver
5 Replies
Prisma AI Help
You've gone full bot mode! Let me fetch that AI answer for you ASAP. Based on the knowledge sources, it appears you're encountering an error when trying to use Prisma with Cloudflare, specifically when running npx prisma db push. This is a common issue when working with Prisma in Cloudflare's environment. The error occurs because Cloudflare Workers has its own runtime environment that's different from traditional Node.js environments, and Prisma needs special configuration to work with it. To solve this issue, you have two main options: 1. Use Prisma Driver Adapters: This is the recommended approach for Cloudflare environments. 2. Use Prisma Accelerate: An alternative solution that can work with edge runtimes. For Cloudflare D1 specifically, you'll need to: 1. Install the D1 adapter:
npm install @prisma/adapter-d1

npm install @prisma/adapter-d1

2. Configure your prisma.config.ts file to use the adapter for migrations:
import { PrismaD1HTTP } from '@prisma/adapter-d1'

import { PrismaD1HTTP } from '@prisma/adapter-d1'

3. Set up the necessary environment variables in your .env file: - CLOUDFLARE_ACCOUNT_ID - CLOUDFLARE_DATABASE_ID - CLOUDFLARE_D1_TOKEN For detailed instructions on setting up Prisma with Cloudflare D1, including schema migrations, refer to the Cloudflare D1 documentation. Note that there are some limitations with D1, including SQL variable limits that might require query chunking, which has been addressed in Prisma version 5.15.0 and later. If you continue to experience issues, please provide more details about your specific setup and the complete error message. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Abakir
AbakirOP5d ago
I have the correct api keys and it creates the tables in the cloudflare database but fails towards the end not sure
⚠️ There might be data loss when applying the changes:

• A unique constraint covering the columns `[firebase_id]` on the table `users` will be added. If there are existing duplicate values, this will fail.

• A unique constraint covering the columns `[email]` on the table `users` will be added. If there are existing duplicate values, this will fail.



✔ Do you want to ignore the warning(s)? … yes
Error in performIO: DriverAdapterError: not authorized: SQLITE_AUTH
⚠️ There might be data loss when applying the changes:

• A unique constraint covering the columns `[firebase_id]` on the table `users` will be added. If there are existing duplicate values, this will fail.

• A unique constraint covering the columns `[email]` on the table `users` will be added. If there are existing duplicate values, this will fail.



✔ Do you want to ignore the warning(s)? … yes
Error in performIO: DriverAdapterError: not authorized: SQLITE_AUTH
This is the issue I get when running the push command
Nurul
Nurul4d ago
Hey 👋 You are trying to run npx prisma db push command with Cloudflare D1, right? Is your repository open source? I would like to take a look at the code to debug this.
Abakir
AbakirOP4d ago
Yes that is the command we are running our project is not open source though but I can share with you the schema that we trying to use and you can let us know what’s happening.
Nurul
Nurul4d ago
That would be helpful. I can try pushing the schema to Cloudflare D1 and check if I can reproduce the issue

Did you find this page helpful?