raj
February 2, 2024, 7:01pm
1
Anyone else experience frequent Status 400 errors on their RW app running on Netlify/Raiway?
Our app runs on Netlify accessing a postgres db on Railway. This has worked well for a long time.
In the past couple of days (1/31/24) the app has been receiving many Status 400 errors. Note that these error can appear on pages that also have successfully queries.
DB was migrated to V2 (per Railway requirement) and rw upgraded (to allow prisma target of rhel-openssl-3.0.x as required) couple of weeks ago. This worked with no problem until the 31st.
Are you using Prisma 5.8?
Could this be an issue?
opened 04:04PM - 10 Jan 24 UTC
closed 10:33AM - 15 Jan 24 UTC
bug/2-confirmed
kind/bug
kind/regression
topic: mysql
team/client
topic: postgresql
topic: Timed out fetching a new connection
5.8.0
### Bug description
In version 5.8.0, when using `Promise.all` to execute queri… es in parallel, some queries generate a P2024 error if the number of `connection_limit` is less than the number of parallel executions.
In version 5.7.1, I got the desired results without any errors.
### How to reproduce
see https://github.com/fujita-h/issue-prisma-580
### Expected behavior
_No response_
### Prisma information
```prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
}
```
```ts
// Create test data
await Promise.all([...Array(10)].map((_, i) => i).map((i) => {
const id = i + 1;
const email = `user${i}@example.com`;
return prisma.user.upsert({
where: { id },
create: { id, email },
update: {},
})
}));
await Promise.all([...Array(10)].map((_, i) => i).map((i) => {
const id = i + 1;
const title = `title-${i}`;
return prisma.post.upsert({
where: { id },
create: { id, title, authorId: id },
update: {},
})
}));
// Query which causes the error on Prisma Client 5.8.0
const posts = await Promise.all([...Array(10)].map((_, i) => i).map((i) => {
const id = i + 1;
return prisma.post.findUnique({
where: {
id,
OR: [
{ author: { id: id } }
]
},
})
}));
console.log(posts);
```
### Environment & setup
- OS: Ubuntu 22.04
- Database: MySQL 8.0
- Node.js version: v20.10.0
### Prisma Version
```
prisma : 5.8.0
@prisma/client : 5.8.0
Computed binaryTarget : debian-openssl-3.0.x
Operating System : linux
Architecture : x64
Node.js : v20.10.0
Query Engine (Node-API) : libquery-engine 0a83d8541752d7582de2ebc1ece46519ce72a848 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine : schema-engine-cli 0a83d8541752d7582de2ebc1ece46519ce72a848 (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm : @prisma/prisma-schema-wasm 5.8.0-37.0a83d8541752d7582de2ebc1ece46519ce72a848
Default Engines Hash : 0a83d8541752d7582de2ebc1ece46519ce72a848
Studio : 0.497.0
```
raj
February 2, 2024, 9:05pm
3
using prisma v5.7.0, rw 6.6.2
raj
February 5, 2024, 6:05pm
4
update: this specific problem was created by an error Netlify functions service.
2 Likes