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

Write test repro for "We assume an internally valid datamodel before mutating." from example schema #5859

Closed
tomhoule opened this issue Feb 26, 2021 · 6 comments
Assignees
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.
Milestone

Comments

@tomhoule
Copy link
Contributor

Command: prisma introspect
Version: 2.17.0
Binary Version: 3c463ebd78b1d21d8fdacdd27899e280cf686223
Report: https://prisma-errors.netlify.app/report/13029
OS: x64 darwin 19.2.0

JS Stacktrace:

Error: [libs/datamodel/connectors/dml/src/model.rs:166:14] We assume an internally valid datamodel before mutating.
    at ChildProcess.child.on (/Users/mac/Desktop/codestates/insta-clone/node_modules/prisma/build/index.js:39181:28)
    at ChildProcess.emit (events.js:182:13)
    at ChildProcess.EventEmitter.emit (domain.js:442:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

Rust Stacktrace:

   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: user_facing_errors::Error::new_in_panic_hook
   3: user_facing_errors::panic_hook::set_panic_hook::{{closure}}
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic_handler::{{closure}}
   6: std::sys_common::backtrace::__rust_end_short_backtrace
   7: _rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::option::expect_failed
  10: dml::datamodel::Datamodel::find_relation_field_mut
  11: sql_introspection_connector::re_introspection::enrich
  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::compat::compat03as01::Compat<Fut> as futures::future::Future>::poll
  16: <futures::future::either::Either<A,B> as futures::future::Future>::poll
  17: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  18: <futures::future::either::Either<A,B> as futures::future::Future>::poll
  19: futures::task_impl::Spawn<T>::enter::{{closure}}
  20: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  21: introspection_engine::main
  22: std::sys_common::backtrace::__rust_begin_short_backtrace
  23: std::rt::lang_start::{{closure}}
  24: std::rt::lang_start_internal
  25: std::rt::lang_start

@tomhoule tomhoule added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. process/candidate team/schema Issue for team Schema. labels Feb 26, 2021
@tomhoule
Copy link
Contributor Author

Error reports: 13029 and 13036

@tomhoule
Copy link
Contributor Author

And 13045

@tomhoule tomhoule added this to the 2.19.0 milestone Mar 3, 2021
@do4gr
Copy link
Member

do4gr commented Mar 5, 2021

They all seem to be triggered during the re-introspection part of introspection. This could be fixed by our changes to datamodel parsing, but not sure.

It's hard to reproduce at the moment since we only have one of the inputs to replay introspection in the correct shape in the error reports (the datamodel). The second one, the introspected sql schema we only have as a string, but have no easy way of deserializing it into a sql schema again.

@janpio
Copy link
Member

janpio commented Mar 5, 2021

Do we have an easy way to get from the schema/datamodel we have, to the sql schema string version of that? Then we could diff the both string representations - which should be pretty close - and see where they are different. This could possibly lead to us being able to reverse engineer the missing SQL - or come up with a theory what is happening directly.

@do4gr
Copy link
Member

do4gr commented Mar 11, 2021

We'll reintroduce deserializable logging that should allow us to replay the issues. I manually did that for 13029, but it's too much monkey work to want to do it again.

@do4gr
Copy link
Member

do4gr commented Mar 12, 2021

Unfortunately we were not collecting the information in our error reporting in a format that allows us to replay the bug. That has changed with 2.19 which should be out next Tuesday.

I'm closing this one now because we cannot act on it.

@do4gr do4gr closed this as completed Mar 12, 2021
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.
Projects
None yet
Development

No branches or pull requests

3 participants