The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
See original GitHub issueHi Prisma Team! My Prisma Client just crashed. This is the report:
Hints
The database is a Microsoft Azure Database (i.e. SQL-Server based) The table Customers contains more than 80,000 records. The table Devices contains more than 22,000 records. When I try SQL: select * from Customers c join Devices d on d.CustomerID = c.ID where d.InstallDate >= convert(date, ‘2021-03-01’) I get 17 records in less than a second. Of course some Customers-data are redundant, when having multiple Devices with expected InstallDate. DATABASE_URL=“sqlserver://xxx.database.windows.net:1433;Initial Catalog=Xxx;Persist Security Info=false;User ID=xxx;Password=xxx;MultipleActiveResultSets=false;Encrypt=true;TrustServerCertificate=false;Connection Timeout=30;”
Versions
Name | Version |
---|---|
Node | v14.16.1 |
OS | windows |
Prisma Client | 2.21.2 |
Query Engine | query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d |
Database | undefined |
Query
query {
findManyCustomers {
ID
Name
Devices(where: {
InstallDate: {
gte: "X"
}
}) {
Serial
CustomerID
InstallDate
}
}
}
Logs
ma:engine flags: [
prisma:engine '--enable-experimental=microsoftSqlServer',
prisma:engine '--enable-raw-queries',
prisma:engine '--port',
prisma:engine '59497'
prisma:engine ]
prisma:engine }
prisma:engine stdout Starting a mssql pool with 9 connections.
prisma:engine stdout Performing a TLS handshake
prisma:engine stdout TLS handshake successful
prisma:engine stdout Database change from 'Xxx' to 'master'
prisma:engine stdout Changed database context to 'Xxx'.
prisma:engine stdout SQL collation change from None to windows-1252/windows-1252
prisma:engine stdout Microsoft SQL Server�� version 3490119692
prisma:engine stdout Packet size change from '4096' to '4096'
prisma:engine stdout Started http server on http://127.0.0.1:59497
prisma:engine Search for Query Engine in F:\git\TCS\hello-prisma\node_modules\.prisma\client
prisma:engine Client Version: 2.21.2
prisma:engine Engine Version: query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d
prisma:engine Active provider: sqlserver
prisma:engine stdout The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. +3s
prisma:engine {
prisma:engine error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error occurred during query execution:
prisma:engine ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(TokenError { code: 8003, state: 1, class: 16, message: "The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.", server: "xxx-xxx", procedure: "", line: 1 }) })
prisma:engine at NodeEngine.graphQLToJSError (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27491:14)
prisma:engine at NodeEngine.request (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27387:24)
prisma:engine at processTicksAndRejections (internal/process/task_queues.js:93:5)
prisma:engine at cb (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:34750:26) {
prisma:engine clientVersion: '2.21.2'
prisma:engine }
prisma:engine }
prisma:engine stdout The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. +2s
prisma:engine {
prisma:engine error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error occurred during query execution:
prisma:engine ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(TokenError { code: 8003, state: 1, class: 16, message: "The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.", server: "xxx-xxx", procedure: "", line: 1 }) })
prisma:engine at NodeEngine.graphQLToJSError (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27491:14)
prisma:engine at NodeEngine.request (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27387:24)
prisma:engine at processTicksAndRejections (internal/process/task_queues.js:93:5)
prisma:engine at cb (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:34750:26) {
prisma:engine clientVersion: '2.21.2'
prisma:engine }
prisma:engine }
prisma:engine stdout The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. +2s
prisma:engine {
prisma:engine error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error occurred during query execution:
prisma:engine ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(TokenError { code: 8003, state: 1, class: 16, message: "The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.", server: "xxx-xxx", procedure: "", line: 1 }) })
prisma:engine at NodeEngine.graphQLToJSError (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27491:14)
prisma:engine at NodeEngine.request (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:27387:24)
prisma:engine at processTicksAndRejections (internal/process/task_queues.js:93:5)
prisma:engine at cb (F:\git\TCS\hello-prisma\node_modules\@prisma\client\runtime\index.js:34750:26) {
prisma:engine clientVersion: '2.21.2'
prisma:engine }
prisma:engine }
Client Snippet
import { PrismaClient } from "@prisma/client";
export const prisma = new PrismaClient();
async function main() {
console.log(
await prisma.customers.findMany({
include: {
Devices: { where: { InstallDate: { gte: new Date("2021-03-01") } } },
},
})
);
}
main()
.catch((e) => {
console.error(e);
})
.finally(async () => {
await prisma.$disconnect();
});
Schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["microsoftSqlServer"]
}
datasource db {
provider = "sqlserver"
url = env("DATABASE_URL")
}
model Customers {
ID Int @id @default(autoincrement())
Name String @db.NVarChar(4000)
Devices Devices[]
}
model Devices {
Serial String @id @db.NVarChar(30)
CustomerID Int?
InstallDate DateTime? @db.DateTime
Customer Customers? @relation(fields: [CustomerID], references: [ID])
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
The incoming request has too many parameters. The server ...
The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. What's the best way to solve...
Read more >[Solved] Error the incoming request has too many parameters ...
The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend ......
Read more >The incoming request has too many parameters. The server ...
The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. Defect Number.
Read more >"The incoming request has too many parameters. The server ...
Caused by SQLException: sqlState=S0001 errorCode=8003 The incoming request has too many parameters. The server supports a maximum of 2100 ...
Read more >"The incoming request has too many parameters" error results ...
The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. The limitation varies for the ...
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 FreeTop 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
Top GitHub Comments
Next to set a default value, I would recommend to mention this parameter somewhere in the documentation.
Until we go about looking at improving this globally (e.g. joins etc.), we should set a default for SQL Server to a batch number which would prevent from facing the error too quickly.