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

thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine\connectors\sql-query-connector\src\model_extensions\scalar_field.rs:70:44 #18517

Closed
benkroeger opened this issue Mar 27, 2023 · 4 comments · Fixed by prisma/prisma-engines#3960
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: entered unreachable code topic: prisma-client topic: Unsupported Scalar pseudo type `Unsupported`
Milestone

Comments

@benkroeger
Copy link
Contributor

benkroeger commented Mar 27, 2023

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

This issue seems to be related to the use of unsupported on my model's field path (which is of type ltree).
Issue does not happen with PrismaClient@4.10.1

internal error: entered unreachable code: No unsupported field should reach that path

This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.

Versions

Name Version
Node v18.14.2
OS darwin
Prisma Client 4.11.0
Query Engine 8fde8fef4033376662cad983758335009d522acb
Database postgresql

Logs

prisma:tryLoadEnv Environment variables loaded from .env
prisma:tryLoadEnv Environment variables loaded from .env
prisma:client dirname node_modules/.prisma/client
prisma:client relativePath ../../../prisma
prisma:client cwd prisma
prisma:client protocol graphql
prisma:client clientVersion 4.11.0
prisma:client clientEngineType library
prisma:client:libraryEngine internalSetup
prisma:client:libraryEngine:loader Searching for Query Engine Library in node_modules/.prisma/client
prisma:client:libraryEngine:loader loadEngine using node_modules/.prisma/client/libquery_engine-darwin.dylib.node
prisma:client:libraryEngine library starting
prisma:client:libraryEngine library started
prisma:client:libraryEngine sending request, this.libraryStarted: true

Client Snippet

prisma.container.findFirstOrThrow({
    where: { label: 'root', parentId: null },
});

Schema

model Container {
  id                    String                 @id @default(dbgenerated("xid()")) @db.Char(20)
  createdAt             DateTime               @default(now())
  label                 String?
  parent                Container?             @relation("ContainerToContainer", fields: [parentId], references: [id], onDelete: Cascade)
  parentId              String?                @db.Char(20)
  path                  Unsupported("ltree")?  @unique
  childContainers       Container[]            @relation("ContainerToContainer")
}

Prisma Engine Query

{"X":{}}
@janpio janpio added team/client Issue for team Client. kind/bug A reported bug. labels Mar 27, 2023
@jfemia
Copy link

jfemia commented Apr 25, 2023

Also seeing this error message when running prisma generate while trying to update to 4.13. Schema contains Unsupported("tstzrange")

Prisma schema loaded from prisma/schema.prisma
Oops, an unexpected error occurred!
RuntimeError: panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine/schema-builder/src/input_types/mod.rs:28:40

Node v16.18
darwin-arm64
Postgresql

@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: prisma generate CLI: prisma generate labels Apr 26, 2023
@janpio
Copy link
Member

janpio commented Apr 26, 2023

Can you shared your schema @jfemia? When I used the schema above and run prisma generate everything works fine.

@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. topic: prisma-client and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: prisma generate CLI: prisma generate labels Apr 26, 2023
@janpio
Copy link
Member

janpio commented Apr 26, 2023

But I can confirm this when running the code from above:

PS C:\Users\Jan\Documents\throwaway\18517> node .\script.js
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine\connectors\sql-query-connector\src\model_extensions\scalar_field.rs:70:44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PrismaClientRustPanicError: 
Invalid `prisma.container.findFirstOrThrow()` invocation in
C:\Users\Jan\Documents\throwaway\18517\script.js:7:28

  4 
  5 // A `main` function so that we can use async/await
  6 async function main() {
→ 7     await prisma.container.findFirstOrThrow(
internal error: entered unreachable code: No unsupported field should reach that path

This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.

https://github.com/prisma/prisma/issue...hat+path&template=bug_report.md

If you want the Prisma team to look into it, please open the link above 🙏
To increase the chance of success, please post your schema and a snippet of
how you used Prisma Client in the issue. 

    at pn.handleRequestError (C:\Users\Jan\Documents\throwaway\18517\node_modules\@prisma\client\runtime\library.js:176:6802)
    at pn.handleAndLogRequestError (C:\Users\Jan\Documents\throwaway\18517\node_modules\@prisma\client\runtime\library.js:176:5907)
    at pn.request (C:\Users\Jan\Documents\throwaway\18517\node_modules\@prisma\client\runtime\library.js:176:5786)
    at async t._request (C:\Users\Jan\Documents\throwaway\18517\node_modules\@prisma\client\runtime\library.js:179:10484)
    at async C:\Users\Jan\Documents\throwaway\18517\node_modules\@prisma\client\runtime\library.js:164:6641
    at async main (C:\Users\Jan\Documents\throwaway\18517\script.js:7:5) {
  clientVersion: '4.13.0'
}

And with full backtrace:

> node .\script.js
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine\connectors\sql-query-connector\src\model_extensions\scalar_field.rs:70:44
stack backtrace:
   0:     0x7ffb9dcfe403 - napi_register_module_v1
   1:     0x7ffb9d447bbb - <unknown>
   2:     0x7ffb9dcee5e1 - napi_register_module_v1
   3:     0x7ffb9dd0089b - napi_register_module_v1
   4:     0x7ffb9dd00467 - napi_register_module_v1
   5:     0x7ffb9dd0141f - napi_register_module_v1
   6:     0x7ffb9dd00e56 - napi_register_module_v1
   7:     0x7ffb9dd00d9f - napi_register_module_v1
   8:     0x7ffb9dd00d74 - napi_register_module_v1
   9:     0x7ffb9deaac95 - napi_register_module_v1
  10:     0x7ffb9dc4b90f - napi_register_module_v1
  11:     0x7ffb9dc51643 - napi_register_module_v1
  12:     0x7ffb9dc4d04e - napi_register_module_v1
  13:     0x7ffb9dc8ef96 - napi_register_module_v1
  14:     0x7ffb9dc92f22 - napi_register_module_v1
  15:     0x7ffb9dcc36f9 - napi_register_module_v1
  16:     0x7ffb9dcd40ae - napi_register_module_v1
  17:     0x7ffb9daab17e - napi_register_module_v1
  18:     0x7ffb9da9a629 - napi_register_module_v1
  19:     0x7ffb9dae090e - napi_register_module_v1
  20:     0x7ffb9dae8fb2 - napi_register_module_v1
  21:     0x7ffb9d32f64f - <unknown>
  22:     0x7ffb9d33213e - <unknown>
  23:     0x7ffb9d3564b8 - <unknown>
  24:     0x7ffb9d353206 - <unknown>
  25:     0x7ffb9d33c2ce - <unknown>
  26:     0x7ffb9d3afff5 - <unknown>
  27:     0x7ffb9d384cd5 - <unknown>
  28:     0x7ffb9d38dc18 - <unknown>
  29:     0x7ffb9dd1b49c - napi_register_module_v1
  30:     0x7ffb9dd269db - napi_register_module_v1
  31:     0x7ffb9dd1edd2 - napi_register_module_v1
  32:     0x7ffb9dd1e60e - napi_register_module_v1
  33:     0x7ffb9dd1f2c6 - napi_register_module_v1
  34:     0x7ffb9dcfd4fb - napi_register_module_v1
  35:     0x7ffc4761269d - BaseThreadInitThunk
  36:     0x7ffc4882a9f8 - RtlUserThreadStart
PrismaClientRustPanicError: 
Invalid `prisma.container.findFirstOrThrow()` invocation in
C:\Users\Jan\Documents\throwaway\18517\script.js:7:28

  4
  5 // A `main` function so that we can use async/await
  6 async function main() {
→ 7     await prisma.container.findFirstOrThrow(
internal error: entered unreachable code: No unsupported field should reach that path

Tested with 4.13.0.

Note that my error is different from yours @jfemia, so this might still be something different - please share more about your case.

@janpio janpio changed the title internal error: entered unreachable code: No unsupported field should reach that path thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine\connectors\sql-query-connector\src\model_extensions\scalar_field.rs:70:44 Apr 26, 2023
@Medvedscak
Copy link

Medvedscak commented Apr 29, 2023

Seeing the same issue starting from 4.11.0 (checked on 4.11, 4.12, 4.13. It's working fine up to v.4.10.1). I'm using the unsupported field for storing postgis points (postgres): Unsupported("geometry(Point, 4326)"). It looks like something has happened to the unsupported types in v4.11.0

tomhoule added a commit to prisma/prisma-engines that referenced this issue May 8, 2023
They are not usable by the query engine, and currently cause crashes
whenever querying the model containing them.

closes prisma/prisma#18517
tomhoule added a commit to prisma/prisma-engines that referenced this issue May 8, 2023
They are not usable by the query engine, and currently cause crashes
whenever querying the model containing them.

closes prisma/prisma#18517
@janpio janpio added the topic: Unsupported Scalar pseudo type `Unsupported` label May 8, 2023
tomhoule added a commit to prisma/prisma-engines that referenced this issue May 8, 2023
They are not usable by the query engine, and currently cause crashes
whenever querying the model containing them.

closes prisma/prisma#18517
tomhoule added a commit to prisma/prisma-engines that referenced this issue May 8, 2023
They are not usable by the query engine, and currently cause crashes
whenever querying the model containing them.

closes prisma/prisma#18517
@janpio janpio added this to the 4.14.0 milestone May 8, 2023
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: entered unreachable code topic: prisma-client topic: Unsupported Scalar pseudo type `Unsupported`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants