Command failed (AtlasError): Pipeline length greater than 50 not supported)
See original GitHub issueBug description
I’m running an upsert which succeeds on create and then fails on update with the following error.
error - PrismaClientUnknownRequestError:
Invalid `prisma.standing.upsert()` invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: RawDatabaseError { code: "unknown", message: "Command failed (AtlasError): Pipeline length greater than 50 not supported)" } })
at RequestHandler.handleRequestError (/myapp/node_modules/@prisma/client/runtime/index.js:29913:13)
at RequestHandler.request (/myapp/node_modules/@prisma/client/runtime/index.js:29892:12)
at async PrismaClient._request (/myapp/node_modules/@prisma/client/runtime/index.js:30864:16)
at async eval (webpack-internal:///(api)/./pages/api/import/[...route].ts:89:32) {
clientVersion: '4.3.1',
page: '/api/import/[...route]'
Here is the call prior to the above error:
prisma:client Prisma Client call: +1s
prisma:client prisma.standing.upsert({
create: {
awayLosses: 0,
awayTies: 0,
awayWins: 0,
calendarYear: 2022,
conferenceId: 958267392,
confLosses: 0,
conferenceName: 'AFC',
confTies: 0,
confWins: 0,
capRoom: 218200000,
capAvailable: 27850000,
capSpent: 190350000,
defPassYds: 0,
defPassYdsRank: 8,
defRushYds: 0,
defRushYdsRank: 8,
defTotalYds: 0,
defTotalYdsRank: 8,
divisionId: 969539585,
divLosses: 0,
divisionName: 'AFC North',
divTies: 0,
divWins: 0,
homeLosses: 0,
homeTies: 0,
homeWins: 0,
netPts: 0,
offPassYds: 0,
offPassYdsRank: 8,
offRushYds: 0,
offRushYdsRank: 8,
offTotalYds: 0,
offTotalYdsRank: 8,
ptsAgainstRank: 8,
ptsForRank: 8,
playoffStatus: 0,
prevRank: 0,
ptsAgainst: 0,
ptsFor: 0,
rank: 0,
seed: 0,
seasonIndex: 0,
stageIndex: 0,
totalLosses: 0,
totalTies: 0,
totalWins: 0,
teamId: 972030012,
teamName: 'Ravens',
teamOvr: 82,
tODiff: 0,
weekIndex: 0,
winLossStreak: 0,
winPct: 0,
leagueId: 2363725
},
update: {
awayLosses: 0,
awayTies: 0,
awayWins: 0,
calendarYear: 2022,
conferenceId: 958267392,
confLosses: 0,
conferenceName: 'AFC',
confTies: 0,
confWins: 0,
capRoom: 218200000,
capAvailable: 27850000,
capSpent: 190350000,
defPassYds: 0,
defPassYdsRank: 8,
defRushYds: 0,
defRushYdsRank: 8,
defTotalYds: 0,
defTotalYdsRank: 8,
divisionId: 969539585,
divLosses: 0,
divisionName: 'AFC North',
divTies: 0,
divWins: 0,
homeLosses: 0,
homeTies: 0,
homeWins: 0,
netPts: 0,
offPassYds: 0,
offPassYdsRank: 8,
offRushYds: 0,
offRushYdsRank: 8,
offTotalYds: 0,
offTotalYdsRank: 8,
ptsAgainstRank: 8,
ptsForRank: 8,
playoffStatus: 0,
prevRank: 0,
ptsAgainst: 0,
ptsFor: 0,
rank: 0,
seed: 0,
seasonIndex: 0,
stageIndex: 0,
totalLosses: 0,
totalTies: 0,
totalWins: 0,
teamId: 972030012,
teamName: 'Ravens',
teamOvr: 82,
tODiff: 0,
weekIndex: 0,
winLossStreak: 0,
winPct: 0,
leagueId: 2363725
},
where: {
leagueId_teamId: {
leagueId: 2363725,
teamId: 972030012
}
}
}) +1ms
prisma:client Generated request: +0ms
prisma:client mutation {
upsertOneStanding(
create: {
awayLosses: 0
awayTies: 0
awayWins: 0
calendarYear: 2022
conferenceId: 958267392
confLosses: 0
conferenceName: "AFC"
confTies: 0
confWins: 0
capRoom: 218200000
capAvailable: 27850000
capSpent: 190350000
defPassYds: 0
defPassYdsRank: 8
defRushYds: 0
defRushYdsRank: 8
defTotalYds: 0
defTotalYdsRank: 8
divisionId: 969539585
divLosses: 0
divisionName: "AFC North"
divTies: 0
divWins: 0
homeLosses: 0
homeTies: 0
homeWins: 0
netPts: 0
offPassYds: 0
offPassYdsRank: 8
offRushYds: 0
offRushYdsRank: 8
offTotalYds: 0
offTotalYdsRank: 8
ptsAgainstRank: 8
ptsForRank: 8
playoffStatus: 0
prevRank: 0
ptsAgainst: 0
ptsFor: 0
rank: 0
seed: 0
seasonIndex: 0
stageIndex: 0
totalLosses: 0
totalTies: 0
totalWins: 0
teamId: 972030012
teamName: "Ravens"
teamOvr: 82
tODiff: 0
weekIndex: 0
winLossStreak: 0
winPct: 0
leagueId: 2363725
}
update: {
awayLosses: 0
awayTies: 0
awayWins: 0
calendarYear: 2022
conferenceId: 958267392
confLosses: 0
conferenceName: "AFC"
confTies: 0
confWins: 0
capRoom: 218200000
capAvailable: 27850000
capSpent: 190350000
defPassYds: 0
defPassYdsRank: 8
defRushYds: 0
defRushYdsRank: 8
defTotalYds: 0
defTotalYdsRank: 8
divisionId: 969539585
divLosses: 0
divisionName: "AFC North"
divTies: 0
divWins: 0
homeLosses: 0
homeTies: 0
homeWins: 0
netPts: 0
offPassYds: 0
offPassYdsRank: 8
offRushYds: 0
offRushYdsRank: 8
offTotalYds: 0
offTotalYdsRank: 8
ptsAgainstRank: 8
ptsForRank: 8
playoffStatus: 0
prevRank: 0
ptsAgainst: 0
ptsFor: 0
rank: 0
seed: 0
seasonIndex: 0
stageIndex: 0
totalLosses: 0
totalTies: 0
totalWins: 0
teamId: 972030012
teamName: "Ravens"
teamOvr: 82
tODiff: 0
weekIndex: 0
winLossStreak: 0
winPct: 0
leagueId: 2363725
}
where: {
leagueId_teamId: {
leagueId: 2363725
teamId: 972030012
}
}
) {
id
leagueId
teamId
awayLosses
awayTies
awayWins
calendarYear
capAvailable
capRoom
capSpent
confLosses
confTies
confWins
conferenceId
conferenceName
defPassYds
defPassYdsRank
defRushYds
defRushYdsRank
defTotalYds
defTotalYdsRank
divLosses
divTies
divWins
divisionId
divisionName
homeLosses
homeTies
homeWins
netPts
offPassYds
offPassYdsRank
offRushYds
offRushYdsRank
offTotalYds
offTotalYdsRank
playoffStatus
prevRank
ptsAgainst
ptsAgainstRank
ptsFor
ptsForRank
rank
seasonIndex
seed
stageIndex
tODiff
teamName
teamOvr
totalLosses
totalTies
totalWins
weekIndex
winLossStreak
winPct
}
}
How to reproduce
- Run an
upsert
with fresh data - Run an
upsert
with the same data (to trigger an update)
Expected behavior
upsert
works for create like it does for update.
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextIndex"]
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model Standing {
id String @id @default(auto()) @map("_id") @db.ObjectId
leagueId Int
league League @relation(fields: [leagueId], references: [leagueId])
teamId Int
team Team @relation(fields: [teamId, leagueId], references: [teamId, leagueId])
awayLosses Int?
awayTies Int?
awayWins Int?
calendarYear Int?
capAvailable Int?
capRoom Int?
capSpent Int?
confLosses Int?
confTies Int?
confWins Int?
conferenceId Int?
conferenceName String
defPassYds Int?
defPassYdsRank Int?
defRushYds Int?
defRushYdsRank Int?
defTotalYds Int?
defTotalYdsRank Int?
divLosses Int?
divTies Int?
divWins Int?
divisionId Int?
divisionName String?
homeLosses Int?
homeTies Int?
homeWins Int?
netPts Int?
offPassYds Int?
offPassYdsRank Int?
offRushYds Int?
offRushYdsRank Int?
offTotalYds Int?
offTotalYdsRank Int?
playoffStatus Int?
prevRank Int?
ptsAgainst Int?
ptsAgainstRank Int?
ptsFor Int?
ptsForRank Int?
rank Int?
seasonIndex Int?
seed Int?
stageIndex Int?
tODiff Int?
teamName String?
teamOvr Int?
totalLosses Int?
totalTies Int?
totalWins Int?
weekIndex Int?
winLossStreak Int?
winPct Float?
@@unique([leagueId, teamId])
}
const result = await prisma.standing.upsert({
create: data,
update: data,
where: {
leagueId_teamId: {
leagueId,
teamId: d.teamId,
},
},
});
Environment & setup
- OS: macOS
- Database: MongoDB
- Node.js version: v16.14.0
Prisma Version
Environment variables loaded from .env
prisma : 4.3.1
@prisma/client : 4.3.1
Current platform : darwin
Query Engine (Node-API) : libquery-engine c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/prisma-fmt-darwin)
Format Wasm : @prisma/prisma-fmt-wasm 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b
Default Engines Hash : c875e43600dfe042452e0b868f7a48b817b9640b
Studio : 0.473.0
Preview Features : fullTextIndex
Issue Analytics
- State:
- Created a year ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
(Sync AtlasError) Pipeline length greater than 50 not supported
I'm getting the below error for realm sync for both ios and android. Error: Failed to integrate download with non-retryable error: error ......
Read more >MongoDB (AtlasError): Pipeline length greater than 50 not ...
So, I'm getting (AtlasError): Pipeline length greater than 50 not supported) when trying to update the record, the createMany and create works.
Read more >Mongodb Atlas - pipeline length greater than 50 not supported
When i use mongoose for mongodb with an atlas mongo sever , it gives the error that mongo pipeline length greater than 50...
Read more >Issues · prisma/prisma · GitHub
Command failed (AtlasError): Pipeline length greater than 50 not supported) kind/bug A reported bug. #15197 opened Sep 5, 2022 by johncblandii.
Read more >Azure CosmosDB "pipeline not supported", MongoDB Atlas ...
Azure CosmosDB "pipeline not supported", MongoDB Atlas $lookup exceeds 16793600 bytes and Retool API request timeout is 2 minutes.
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
We’re about to look into this but can’t yet say whether it’s a big issue or a quick fix since we haven’t reproduce it yet. I’ll post an update as soon as I know more.
It’s the same for me, i’ve made repro https://github.com/luluhoc/repro-atlas-pipeline-error