question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()`

See original GitHub issue

Bug description

When adding many to many relationships, I get this error when running Prisma client. This happens even when running prisma studio

thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value', query-engine/connectors/mongodb-query-connector/src/root_queries/read.rs:106:74

How to reproduce

  1. Create a many to many models
  2. Run prisma studio
  3. Go to model
  4. See error

Expected behavior

No response

Prisma information

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["mongodb"]
  binaryTargets   = ["native", "rhel-openssl-1.0.x"]
}
model Organisation {
  id             String          @id @default(dbgenerated()) @map("_id") @db.ObjectId
  name           String
  activityGroups ActivityGroup[]
}

model ActivityGroup {
  id            String         @id @default(dbgenerated()) @map("_id") @db.ObjectId
  name          String
  organisations Organisation[]
}
prisma.organisation.findMany({
  take: 100,
  skip: 0,
  select: {
    id: true,
    name: true,
    activityGroups: true,
  }
})

Environment & setup

  • OS: Mac OS
  • Database: MongoDB
  • Node.js version: 14.17.6

Prisma Version

3.2.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
HannesArnicommented, Jan 4, 2022

I encountered the same error at query-engine/core/src/query_document/parser.rs:250:87

In my case I was trying to create a record with a 22 decimal integer for a column with type Int. Changing that column and the value to a string fixed the issue for me.

  • Prisma version: 3.7.0
  • Database: Postgres
  • Node version: 16.11.1
  • Os: Mac OS Big Sur
1reaction
mikerudgecommented, Feb 14, 2022

Can you please try this with a more recent version of Prisma to make sure this did not already get fixed in the meantime before we start to investigate? Thanks.

Oh my bad. I actually encountered this on the latest version but then tried previous versions back to 3.2 to see if it was a recent thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thread 'tokio-runtime-worker' panicked at 'thread 'called ...
Hello, I made a tool with Rust and I use tokio::spawn to use multiple worker in my tool. The issue I have is...
Read more >
thread 'tokio-runtime-worker' panicked at 'called `Result ...
authenticator 4.1.4 from flathub is crashing on startup. It crashes in the same way even if all I do is run --version or...
Read more >
Panicked at 'called `Option::unwrap()` on a `None` value ...
Hi! I'm currently porting the Lox language from Crafting Interpreters , but I've been stuck for a while in an annoying bug.
Read more >
libpnet error: thread 'main' panicked at 'called `Option::unwrap ...
It seems that adding tcp_header.set_options() results in a panic. thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ...
Read more >
Builder in tokio::runtime - Rust - Docs.rs
... Runtime 's thread pool. The default name fn is || "tokio-runtime-worker".into() . ... ("thread unparking"); }) .build(); runtime.unwrap().block_on(async ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found