PrismaP
Prisma6mo ago
7 replies
laurence

Error validating datasource `db`: the URL must start with the protocol `prisma://` or `prisma+postgr

Attempting to run e2e tests in a docker environment against a standalone nextjs server container. I use prisma accelerate in production, but for tests these will run in a server environment - so accelerate is not desired. I am working on a dynamic build and runtime that allows for dynamically using accelerate depending on the environment, but for debugging this issue I've simplified things and I've removed prisma accelerate completely from this branch to try and isolate the cause of this issue.

This error is appearing in both 'test' and 'development' environments, also from Cypress runtime. But the db url is valid, the db is up, and I'm not using accelerate, i'm generating with --no-engine=false. So I don't understand why prisma is trying to use accelerate. Is there some way to have prisma print out why it's attempting to look for an accelerate url?

error log
Using database URL for tests: postgresql://***:***@localhost:15432/foodguessr-test
prisma:error 
Invalid `prisma.dailyGuess.deleteMany()` invocation:


Error validating datasource `db`: the URL must start with the protocol `prisma://` or `prisma+postgres://`
Database reset error: PrismaClientKnownRequestError: 
Invalid `prisma.dailyGuess.deleteMany()` invocation:


Error validating datasource `db`: the URL must start with the protocol `prisma://` or `prisma+postgres://`


schema.prisma
datasource db {
  provider   = "postgresql"
  url        = env("DATABASE_URL")
  extensions = [pg_trgm, unaccent]
}

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["postgresqlExtensions"]
}


* continued in comments
Was this page helpful?