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

Error: [libs/datamodel/connectors/dml/src/model.rs:338:29] Crash probably due to cyrillic table names #12615

Closed
tomhoule opened this issue Apr 1, 2022 · 0 comments
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: prisma db pull CLI: prisma db pull topic: Your friendly prisma developers
Milestone

Comments

@tomhoule
Copy link
Contributor

tomhoule commented Apr 1, 2022

State error boop, may be from cyrillic table names.

Command: prisma db pull
Version: 3.11.1
Binary Version: 1a2506facaf1a4727b7c26850735e88ec779dee9
Report: https://prisma-errors.netlify.app/report/13721
OS: x64 linux 4.19.128-microsoft-standard

JS Stacktrace:

Error: [libs/datamodel/connectors/dml/src/model.rs:338:29] Hi there! We've been seeing this error in our error reporting backend, but cannot reproduce it in our own tests. The problem is that we have a primary key in the model `SKU` that uses the column `` which we for some reason don't have in our internal representation. If you see this, could you please file an issue to https://github.com/prisma/prisma so we can discuss about fixing this. -- Your friendly prisma developers. 
    at ChildProcess.<anonymous> (/.../node-playground/deleteme/node_modules/prisma/build/index.js:46144:30)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

Rust Stacktrace:

   0: user_facing_errors::Error::new_in_panic_hook
   1: user_facing_errors::panic_hook::set_panic_hook::{{closure}}
   2: std::panicking::rust_panic_with_hook
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:610:17
   3: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:502:13
   4: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:139:18
   5: rust_begin_unwind
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
   6: core::panicking::panic_fmt
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
   7: core::panicking::panic_display
   8: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   9: dml::model::Model::unique_criterias
  10: dml::model::Model::strict_unique_criterias_disregarding_unsupported
  11: sql_introspection_connector::commenting_out_guardrails::commenting_out_guardrails
  12: sql_introspection_connector::calculate_datamodel::calculate_datamodel
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  14: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  15: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
  16: <futures_util::future::future::Then<Fut1,Fut2,F> as core::future::future::Future>::poll
  17: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
  18: tokio::runtime::task::harness::poll_future
  19: tokio::runtime::task::raw::poll
  20: std::thread::local::LocalKey<T>::with
  21: tokio::runtime::thread_pool::worker::Context::run_task
  22: tokio::runtime::thread_pool::worker::Context::run
  23: tokio::macros::scoped_tls::ScopedKey<T>::set
  24: tokio::runtime::thread_pool::worker::run
  25: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  26: std::panicking::try
  27: tokio::runtime::task::harness::Harness<T,S>::poll
  28: tokio::runtime::blocking::pool::Inner::run
  29: std::sys_common::backtrace::__rust_begin_short_backtrace
  30: core::ops::function::FnOnce::call_once{{vtable.shim}}
  31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/alloc/src/boxed.rs:1854:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/alloc/src/boxed.rs:1854:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys/unix/thread.rs:108:17
  32: start_thread
  33: clone

@tomhoule tomhoule added kind/bug A reported bug. topic: error reporting Issues created via Prisma's CLI Crash Reporting team/schema Issue for team Schema. labels Apr 1, 2022
@tomhoule tomhoule changed the title Error: [libs/datamodel/connectors/dml/src/model.rs:338:29] Hi there! We've been seeing this error in our error reporting backend, but cannot reproduce it in our own tests. The problem is that we have a primary key in the model SKU that uses the column `` which we for some reason don't have in our internal representation. If you see this, could you please file an issue to https://github.com/prisma/prisma so we can discuss about fixing this. -- Your friendly prisma developers. Error: [libs/datamodel/connectors/dml/src/model.rs:338:29] Crash probably due to cyrillic table names Apr 1, 2022
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: prisma db pull CLI: prisma db pull labels Apr 4, 2022
tomhoule added a commit to prisma/prisma-engines that referenced this issue Aug 8, 2022
On MSSQL, indexes can have an `INCLUDE` clause. Columns listed in that
clause are _not part of the key_, meaning they are not indexed, but they
are stored at the leaf. This is useful for queries that only care about
columns that are part of the key or INCLUDed: they will not need to
fetch the whole tuple from the main table, the query can be resolved
purely from the index. This commit changes sql-schema-describer to
ignore included columns: they are not part of the index and should not
show up in introspected schemas.

Before Prisma 4.1, we already erroneously introspected the included columns
as part of the index. Due to a data structure change in 4.1, we
continued wrongly introspecting them, but _at the end of a different
index_ (the previous one), potentially on another model, triggering the
error about "your friendly prisma developers" you can see in the issues
below.

See the official docs on included columns:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql?view=sql-server-ver16#include-column---n--

closes prisma/prisma#14636
closes prisma/prisma#12615
closes prisma/prisma#14438
closes prisma/prisma#14403
closes prisma/prisma#14511
closes prisma/prisma#14611
closes prisma/prisma#14647
closes prisma/prisma#14462
tomhoule added a commit to prisma/prisma-engines that referenced this issue Aug 8, 2022
On MSSQL, indexes can have an `INCLUDE` clause. Columns listed in that
clause are _not part of the key_, meaning they are not indexed, but they
are stored at the leaf. This is useful for queries that only care about
columns that are part of the key or INCLUDed: they will not need to
fetch the whole tuple from the main table, the query can be resolved
purely from the index. This commit changes sql-schema-describer to
ignore included columns: they are not part of the index and should not
show up in introspected schemas.

Before Prisma 4.1, we already erroneously introspected the included columns
as part of the index. Due to a data structure change in 4.1, we
continued wrongly introspecting them, but _at the end of a different
index_ (the previous one), potentially on another model, triggering the
error about "your friendly prisma developers" you can see in the issues
below.

See the official docs on included columns:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql?view=sql-server-ver16#include-column---n--

closes prisma/prisma#14636
closes prisma/prisma#12615
closes prisma/prisma#14438
closes prisma/prisma#14403
closes prisma/prisma#14511
closes prisma/prisma#14611
closes prisma/prisma#14647
closes prisma/prisma#14462
@janpio janpio added this to the 4.2.0 milestone Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: prisma db pull CLI: prisma db pull topic: Your friendly prisma developers
Projects
None yet
Development

No branches or pull requests

2 participants