Skip to content
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

PANIC in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:101:74called Option::unwrap() on a None value #7861

Closed
naveenrobo opened this issue Jun 25, 2021 · 4 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: mongodb

Comments

@naveenrobo
Copy link

naveenrobo commented Jun 25, 2021

Hi Prisma Team! My Prisma Client just crashed. This is the report:

Versions

Name Version
Node v14.16.0
OS windows
Prisma Client 2.25.0
Query Engine query-engine c838e79f39885bc8e1611849b1eb28b5bb5bc922
Database undefined

Query

query {
  findFirstDeviceDetail(where: {
    AND: [
      {
        device_id: "X"
      }
    ]
  }) {
    id
    db_user_id
    kms_user_id
    rf_id
    rf_id_pin
    device_id
    device_role
    face_id
    face_id_path
    is_active
    active_from
    expiry
    slots {
      id
      slot
      name
      description
      status
      rf_id
      device_id
      last_used_user_id
    }
  }
}

Logs

5;167;1mprisma:client clientVersion: 2.25.0  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine { cwd: 'D:\\Projects\\Key Management System\\kms-backend-v2\\prisma' }  +24s
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '61023' ] }  
  prisma:engine stdout  Started http server on http://127.0.0.1:61023  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine Client Version: 2.25.0  
  prisma:engine Engine Version: query-engine c838e79f39885bc8e1611849b1eb28b5bb5bc922  
  prisma:engine Active provider: mongodb  
  prisma:engine { cwd: 'D:\\Projects\\Key Management System\\kms-backend-v2\\prisma' }  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '61029' ] }  
  prisma:engine stdout  Started http server on http://127.0.0.1:61029  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine Client Version: 2.25.0  
  prisma:engine Engine Version: query-engine c838e79f39885bc8e1611849b1eb28b5bb5bc922  
  prisma:engine Active provider: mongodb  
  prisma:engine stdout  PANIC in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:101:74
called `Option::unwrap()` on a `None` value  
  prisma:engine {
  prisma:engine   error: Error: read ECONNRESET
  prisma:engine       at TCP.onStreamRead (internal/stream_base_commons.js:209:20) {
  prisma:engine     errno: -4077,
  prisma:engine     code: 'ECONNRESET',
  prisma:engine     syscall: 'read'
  prisma:engine   }
  prisma:engine }  
  prisma:engine {
  prisma:engine   error: Error: connect ECONNREFUSED 127.0.0.1:61029
  prisma:engine       at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  prisma:engine     errno: -4078,
  prisma:engine     code: 'ECONNREFUSED',
  prisma:engine     syscall: 'connect',
  prisma:engine     address: '127.0.0.1',
  prisma:engine     port: 61029
  prisma:engine   }
  prisma:engine }  
  prisma:engine There is a child that still runs and we want to start again  
  prisma:engine { cwd: 'D:\\Projects\\Key Management System\\kms-backend-v2\\prisma' }  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '61036' ] }  
  prisma:engine stdout  Started http server on http://127.0.0.1:61036  
  prisma:engine Search for Query Engine in D:\Projects\Key Management System\kms-backend-v2\node_modules\.prisma\client  
  prisma:engine Client Version: 2.25.0  
  prisma:engine Engine Version: query-engine c838e79f39885bc8e1611849b1eb28b5bb5bc922  
  prisma:engine Active provider: mongodb  
  prisma:engine stdout  PANIC in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:101:74
called `Option::unwrap()` on a `None` value  
  prisma:engine {
  prisma:engine   error: Error: read ECONNRESET
  prisma:engine       at TCP.onStreamRead (internal/stream_base_commons.js:209:20) {
  prisma:engine     errno: -4077,
  prisma:engine     code: 'ECONNRESET',
  prisma:engine     syscall: 'read'
  prisma:engine   }
  prisma:engine }  

Client Snippet

 let deviceDetail = await this.prisma.deviceDetail.findFirst({
      where: {
        AND: [
          {
            device_id: device_id,
          },
        ],
      },
      include: {
        slots: true,
      },
    });

Schema

model DeviceDetail {
    id           String     @id @default(uuid()) @map("_id")
    user         User       @relation(fields: [db_user_id], references: [id])
    db_user_id   String
    kms_user_id  String     @unique
    rf_id        String?
    rf_id_pin    Int?
    device       Device     @relation(fields: [device_id], references: [id])
    device_id    String
    device_role  DeviceRole @default(USER)
    face_id      String
    face_id_path String?
    is_active    Boolean    @default(true)
    active_from  DateTime   @default(now())
    expiry       DateTime?
    slots        Slot[]

    @@unique([kms_user_id, device_id])
}

model Slot {
    id                String         @id @default(uuid()) @map("_id")
    slot              Int
    name              String
    description       String?
    status            SlotStatus
    rf_id             String
    device            Device         @relation(fields: [device_id], references: [id])
    device_id         String
    last_used_user_id String?
    schedules         Schedule[]
    device_details    DeviceDetail[]
}
@janpio janpio added the team/client Issue for team Client. label Jun 30, 2021
@matthewmueller matthewmueller added process/candidate topic: mongodb bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. and removed process/candidate labels Jul 6, 2021
@matthewmueller
Copy link
Contributor

matthewmueller commented Jul 6, 2021

I think this is the same as #7057, except it panics

@dpetrick
Copy link
Contributor

Please follow the same modeling advise from this ticket and try again: #6877 (comment)

@pantharshit00 pantharshit00 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Jul 16, 2021
@naveenrobo
Copy link
Author

okay. let me try.

@janpio
Copy link
Member

janpio commented Jan 3, 2022

6 months later no further information, so I think we can consider this closed.

If this ever happens again, please comment here or even better - create a new issue. Thanks.

@janpio janpio closed this as completed Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: mongodb
Projects
None yet
Development

No branches or pull requests

5 participants