Error: db error: ERROR: canceling statement due to statement timeout
See original GitHub issueBug description
I set up a free tier project on supabase with no changes to the project. I then followed this guide. When I got to the step prisma migrate dev --name init
, I received this error …

I took a stab at running prisma migrate reset
to see if that would fix anything and that seemed to run.

How to reproduce
Expected behavior
No response
Prisma information
datasource db {
provider = “postgresql”
url = env(“DATABASE_URL”)
}
generator client {
provider = “prisma-client-js”
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
Environment & setup
- OS: macOS
- Database: PostgreSQL
- Node.js version: v18.12.1
Prisma Version
Environment variables loaded from .env
prisma : 4.7.1
@prisma/client : 4.7.1
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 272861e07ab64f234d3ffc4094e32bd61775599c (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 272861e07ab64f234d3ffc4094e32bd61775599c (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 272861e07ab64f234d3ffc4094e32bd61775599c (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 272861e07ab64f234d3ffc4094e32bd61775599c (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Format Wasm : @prisma/prisma-fmt-wasm 4.7.1-1.272861e07ab64f234d3ffc4094e32bd61775599c
Default Engines Hash : 272861e07ab64f234d3ffc4094e32bd61775599c
Studio : 0.477.0
Issue Analytics
- State:
- Created 9 months ago
- Reactions:3
- Comments:17 (3 by maintainers)
Top Results From Across the Web
PostgreSQL: ERROR - canceling statement due to statement ...
For this query, we can set timeout up to 5 mins, but if it is taking more than 5 mins, then the developer...
Read more >Troubleshoot an AWS DMS task that failed with "ERROR
How do I troubleshoot an AWS DMS task that is failing with error message "ERROR: canceling statement due to statement timeout"?
Read more >PostgreSQL statement timeout - Stack Overflow
We have table partitioning on date & time and have a PostgreSQL function to load the incoming request into the table. Sometimes we...
Read more >L72: Canceling statement due to lock timeout - pganalyze
Explanation: This log event only occurs when lock_timeout was enabled for the connection, and the statement had to wait longer than the specified...
Read more >ERROR: canceling statement due to statement timeout
Symptoms. The error might be reported in DS-User event log during various activities. "ERROR: canceling statement due to statement timeout" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi all, I too was having the same problem following the Mastering Nuxt 3 course. I ran a packet capture to see if there’s any resets and who it’s coming from. The resets seem to be normal resets (connection closing) but seems the connections closing may have been initiated by the client. I can’t decrypt the capture so not sure exactly. However, in doing some more research for this issue, a user named mmoreno, also having the same issue, found this where Prisma is suggesting that you must include a shadowDatabaseUrl for cloud hosted db’s. Then running a prisma db push followed by a prisma migrate dev worked for that user. This seemed to work for me. Here’s the steps I took:
Before doing this running migrate failed even after running db push. So hopefully this helps.
having this happen to me. Also with supabase and using their connection string. I’ve tried to do a migration using SQLite instead and it works