prisma: `npx prisma generate` on a schema with more than 26 thousand lines, and more than 100 tables: `error: RuntimeError: unreachable`

Hi Prisma Team! The following command just crashed.

I’m trying to run “npx prism generate” on a schema with more than 26 thousand lines, and more than 100 tables. But after some time waiting for me generates the error below.

It has DEBUG=*

Command

generate

Versions

Name Version
Platform windows
Node v18.14.2
Prisma CLI 4.11.0
Engine 8fde8fef4033376662cad983758335009d522acb

Error

D:\Projetos\ServiceLogic\slhub-tms-api>npx prisma generate
  prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:loadEnv  project root found at D:\Projetos\ServiceLogic\slhub-tms-api\package.json +0ms
  prisma:tryLoadEnv  Environment variables loaded from D:\Projetos\ServiceLogic\slhub-tms-api\.env +0ms
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
  prisma:getConfig  Using getConfig Wasm +0ms
  prisma:getConfig  config data retrieved without errors in getConfig Wasm +281ms        
  prisma:getDMMF  Using getDmmf Wasm +0ms
  prisma:getDMMF  Using given datamodel +0ms
  prisma:getDMMF  error of type "wasm-error" in getDmmfWasm:
 {
  reason: '(get-dmmf wasm)',
  error: RuntimeError: unreachable
      at alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle::h2f330cff56001ed4 (wasm://wasm/009b3a26:wasm-function[2074]:0x185852)
      at <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<&T,core::slice::iter::Iter<T>>>::spec_extend::h022d560facd884e0 (wasm://wasm/009b3a26:wasm-function[2020]:0x18484d)
      at serde_json::ser::format_escaped_str::h72aa805615b7154b (wasm://wasm/009b3a26:wasm-function[552]:0x12f9d3)
      at serde::ser::SerializeMap::serialize_entry::h1e52f07b61684995 (wasm://wasm/009b3a26:wasm-function[950]:0x158d31)
      at serde::ser::SerializeMap::serialize_entry::h6dd23d648f67ee8e (wasm://wasm/009b3a26:wasm-function[662]:0x13ddcd)
      at dmmf::dmmf_json_from_schema::h13cf46943e33cd96 (wasm://wasm/009b3a26:wasm-function[10]:0x3719d)
      at get_dmmf (wasm://wasm/009b3a26:wasm-function[135]:0xc7ea3)
      at module2.exports.get_dmmf (D:\Projetos\ServiceLogic\slhub-tms-api\node_modules\prisma\build\index.js:12094:14)
      at tryCatch.type (D:\Projetos\ServiceLogic\slhub-tms-api\node_modules\prisma\build\index.js:91194:57)
      at tryCatch (D:\Projetos\ServiceLogic\slhub-tms-api\node_modules\prisma\build\index.js:87979:19)
} +9m
Oops, an unexpected error occurred!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

With DEBUG=* env var set, it looks like this for me:

C:\Users\Jan\Downloads\18255>npx prisma generate
  prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:loadEnv  project root found at C:\Users\Jan\Downloads\18255\package.json +0ms
  prisma:tryLoadEnv  Environment variables not found at null +0ms
  prisma:tryLoadEnv  Environment variables not found at undefined +1ms
  prisma:tryLoadEnv  No Environment variables loaded +0ms
Prisma schema loaded from schema.prisma
  prisma:getConfig  Using getConfig Wasm +0ms
  prisma:getConfig  config data retrieved without errors in getConfig Wasm +194ms
  prisma:getDMMF  Using getDmmf Wasm +0ms
  prisma:getDMMF  Using given datamodel +0ms
  prisma:getDMMF  error of type "wasm-error" in getDmmfWasm:
 {
  reason: '(get-dmmf wasm)',
  error: RuntimeError: unreachable
      at alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle::h2f330cff56001ed4 (wasm://wasm/009b3a26:wasm-function[2074]:0x185852)
      at <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<&T,core::slice::iter::Iter<T>>>::spec_extend::h022d560facd884e0 (wasm://wasm/009b3a26:wasm-function[2020]:0x18484d)
      at serde::ser::SerializeMap::serialize_entry::h5f6297fa2eeca6be (wasm://wasm/009b3a26:wasm-function[1332]:0x16f068)
      at serde::ser::SerializeMap::serialize_entry::h6dd23d648f67ee8e (wasm://wasm/009b3a26:wasm-function[662]:0x13ddac)
      at dmmf::dmmf_json_from_schema::h13cf46943e33cd96 (wasm://wasm/009b3a26:wasm-function[10]:0x3719d)
      at get_dmmf (wasm://wasm/009b3a26:wasm-function[135]:0xc7ea3)
      at module2.exports.get_dmmf (C:\Users\Jan\Downloads\18255\node_modules\prisma\build\index.js:12094:14)
      at tryCatch.type (C:\Users\Jan\Downloads\18255\node_modules\prisma\build\index.js:91194:57)
      at tryCatch (C:\Users\Jan\Downloads\18255\node_modules\prisma\build\index.js:87979:19)
      at C:\Users\Jan\Downloads\18255\node_modules\prisma\build\index.js:91184:9
} +12m

So same output as you - so this is reproducible.

Thanks, received: >3MB and >26.000 lines as you described. Will play with it.

I just sent it, if you can help me, it will be of great value. Because I really want to be able to use Prisma in this project.

Can you share the schema file with us? Happy to accept in private via schemas@prisma.io. We can also sign an NDA if needed.