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/value.rs:100:24 not yet implemented: (ObjectId, List([String("609675d400e7693e0090e48c")])) #6998

Closed
oudmane opened this issue May 9, 2021 · 5 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: mongodb
Milestone

Comments

@oudmane
Copy link

oudmane commented May 9, 2021

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

Versions

Name Version
Node v16.0.0
OS darwin
Prisma Client 2.22.1
Query Engine query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c
Database undefined

Query

query {
  findManyDevice(where: {
    id: {
      in: ["X"]
    }
  }) {
    token
  }
}

Logs

tHub/reqas/SMSGateWayAPI/node_modules/.prisma/client  
  plusX Execution permissions of /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client/query-engine-darwin are fine  
  prisma:engine Client Version: 2.22.1  
  prisma:engine Engine Version: query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c  
  prisma:engine Active provider: mongodb  
  prisma:engine Stopping Prisma engine4  
  prisma:engine Waiting for start promise  
  prisma:engine Done waiting for start promise  
  prisma:engine { cwd: '/Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/prisma' }  +4s
  prisma:engine Search for Query Engine in /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client  
  plusX Execution permissions of /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client/query-engine-darwin are fine  +4s
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '54364' ] }  
  prisma:engine stdout  Started http server on http://127.0.0.1:54364  
  prisma:engine Search for Query Engine in /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client  
  plusX Execution permissions of /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client/query-engine-darwin are fine  
  prisma:engine Client Version: 2.22.1  
  prisma:engine Engine Version: query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c  
  prisma:engine Active provider: mongodb  
  prisma:engine stdout  PANIC in query-engine/connectors/mongodb-query-connector/src/value.rs:100:24
not yet implemented: (ObjectId, List([String("609675d400e7693e0090e48c")]))  
  prisma:engine {
  prisma:engine   error: SocketError: other side closed
  prisma:engine       at Socket.onSocketEnd (/Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/@prisma/client/runtime/index.js:25530:24)
  prisma:engine       at Socket.emit (node:events:377:35)
  prisma:engine       at Socket.emit (node:domain:470:12)
  prisma:engine       at endReadableNT (node:internal/streams/readable:1312:12)
  prisma:engine       at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  prisma:engine     code: 'UND_ERR_SOCKET'
  prisma:engine   }
  prisma:engine }  
  prisma:engine {
  prisma:engine   error: Error: connect ECONNREFUSED 127.0.0.1:54364
  prisma:engine       at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
  prisma:engine     errno: -61,
  prisma:engine     code: 'ECONNREFUSED',
  prisma:engine     syscall: 'connect',
  prisma:engine     address: '127.0.0.1',
  prisma:engine     port: 54364
  prisma:engine   }
  prisma:engine }  
  prisma:engine { cwd: '/Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/prisma' }  
  prisma:engine Search for Query Engine in /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client  
  plusX Execution permissions of /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client/query-engine-darwin are fine  
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '54369' ] }  
  prisma:engine stdout  Started http server on http://127.0.0.1:54369  
  prisma:engine Search for Query Engine in /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client  
  plusX Execution permissions of /Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/.prisma/client/query-engine-darwin are fine  
  prisma:engine stdout  PANIC in query-engine/connectors/mongodb-query-connector/src/value.rs:100:24
not yet implemented: (ObjectId, List([String("609675d400e7693e0090e48c")]))  
  prisma:engine {
  prisma:engine   error: SocketError: other side closed
  prisma:engine       at Socket.onSocketEnd (/Users/oudmane/Documents/GitHub/reqas/SMSGateWayAPI/node_modules/@prisma/client/runtime/index.js:25530:24)
  prisma:engine       at Socket.emit (node:events:377:35)
  prisma:engine       at Socket.emit (node:domain:470:12)
  prisma:engine       at endReadableNT (node:internal/streams/readable:1312:12)
  prisma:engine       at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  prisma:engine     code: 'UND_ERR_SOCKET'
  prisma:engine   }
  prisma:engine }  

Client Snippet

prisma.device.findMany({
        where: {
            id: {in: ["609675d400e7693e0090e48c"]}
        },
        select: {
            token: true
        }
    })

Schema

model Device {
  id         String     @id @default(dbgenerated()) @map("_id") @db.ObjectId
  token      String?
  version    String?
  number     String?
  priority   Int?
  operators  Int[]
  createdAt  DateTime   @default(now())
  updatedAt  DateTime   @updatedAt
}
@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels May 10, 2021
@janpio
Copy link
Member

janpio commented May 10, 2021

Did I induce correctly from your use of @db.ObjectId that you actually are using the early access mongodb provider @oudmane?

@oudmane
Copy link
Author

oudmane commented May 10, 2021

Yes, I'm using mongodb provider. I'm trying bit on a side project, and found this bug.

@pantharshit00
Copy link
Contributor

I can reproduce the panic in 2.22.1 but it doesn't panic in 2.23.0-dev.25 so we did add some code to handle these errors.

But we need to fix the conversion here. It throws the following error now:

❯ yarn start
yarn run v1.22.5
$ ts-node main.ts
(node:6008) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.device.findMany()` invocation:


  Inconsistent column data: Failed to convert 'List([String("609675d400e7693e0090e48c")])' to 'ObjectId'.
    at cb (C:\Users\harshit\code\reproductions\issue_6998\node_modules\@prisma\client\runtime\index.js:35097:17)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at main (C:\Users\harshit\code\reproductions\issue_6998\main.ts:6:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6008) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insi
de of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To termina
te the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs
.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6008) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Terminate batch job (Y/N)?

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels May 13, 2021
@matthewmueller matthewmueller added the team/client Issue for team Client. label May 19, 2021
@dpetrick dpetrick self-assigned this May 19, 2021
@matthewmueller
Copy link
Contributor

matthewmueller commented Jul 6, 2021

@oudmane could you try the following:

const ObjectID = require('mongodb').ObjectID

prisma.device.findMany({
        where: {
            id: {in: [new ObjectID("609675d400e7693e0090e48c")]}
        },
        select: {
            token: true
        }
    })

And see if that works?

@dpetrick
Copy link
Contributor

Fixed in 2.28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: mongodb
Projects
None yet
Development

No branches or pull requests

6 participants