-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
called Option::unwrap()
on a None
value
#19968
Comments
Note: Here is the same schema but with the datasource & generator blocks including the necessary preview features. generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema", "views"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
schemas = ["public"]
}
model login {
id Int @id @default(autoincrement())
email String? @db.VarChar(254)
password String? @db.VarChar(128)
salt String? @db.VarChar(16)
lastSeen DateTime? @map("last_seen") @db.Timestamptz(6)
created DateTime? @default(now()) @db.Timestamptz(6)
enabled Boolean? @default(true)
role Int? @default(0)
language String? @default("de") @db.VarChar(2)
mailActivated Boolean? @default(false) @map("mail_activated")
mandantId Int? @default(1) @map("mandant_id")
firstname String? @db.VarChar(512)
lastname String? @db.VarChar(512)
addressId Int? @map("address_id")
unlocked Boolean? @default(true)
passwordReset Boolean? @default(false) @map("password_reset")
softDeleted DateTime? @map("soft_deleted") @db.Timestamptz(6)
loginIdentifier String? @map("login_identifier")
address address_view? @relation(fields: [addressId], references: [id])
@@index([addressId])
@@schema("public")
}
view address_view {
id Int @unique
customerId Int? @map("customer_id")
address String? @db.VarChar(256)
enabled Boolean?
firstname String? @db.VarChar(512)
lastname String? @db.VarChar(512)
language String? @db.VarChar(2)
gender Int?
degree String? @db.VarChar(256)
created DateTime? @db.Timestamptz(6)
uuid String? @db.Uuid
type Int?
organizeId Int? @map("organize_id")
organize String? @db.VarChar(512)
changed DateTime? @db.Timestamptz(6)
optIn Boolean? @map("opt_in")
source String?
customerUuid String? @map("customer_uuid") @db.Uuid
login login[]
@@schema("public")
} |
Note: Here is the source code for the referenced line https://github.com/prisma/prisma-engines/blob/4.15.0/query-engine/core/src/interpreter/query_interpreters/nested_read.rs#L223 |
Note: It looks like in the past we had some reports for the same line of code (see https://github.com/search?q=repo%3Aprisma%2Fprisma+query-engine%2Fcore%2Fsrc%2Finterpreter%2Fquery_interpreters%2Fnested_read.rs&type=issues) |
This problem is unfortunately not reproducible as it is. Thanks. |
@jkomyno with a little bit of binary search I pinned it down to these records:
Looking further, I found something realy interesting:
Somehow the view that get's joined into the login table returns two records for that id. And these are the only records querying further:
So maybe prisma should crash with a more understandable error, nevertheless I'll fix the database, so I can avoid that issue. |
Thank you @sosafe-tim-schumacher. I confirm that the error arises because a fundamental precondition that Prisma requires on Views is violated by the datatabase: that a view ( |
Hi Prisma Team! My Prisma Client just crashed. This is the report:
Versions
Logs
Client Snippet
Schema
Prisma Engine Query
Engine Stack trace
Remarks
I think something is not well with our data, but that should not crash the query engine. Are there any ways I could provide more debugging information?
These are the records that will break the query engine, starting at
795695
:If you want I can provide you the raw query results in private, but would need to check with legal first.
The text was updated successfully, but these errors were encountered: