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: QueryError(QueryError(UniqueConstraintViolation { field_name: "A, _MovieToWriter" } #768

Closed
nikolasburk opened this issue Oct 16, 2019 · 5 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@nikolasburk
Copy link
Member

I have created another example dataset based on the IMDB dataset. You can find it here: https://github.com/prisma/prisma-datasets/tree/master/datasets/sqlite/imdb

When trying to run the development mode using prisma2 dev, it throws the following error (and hangs):

$ prisma2 dev

Error

Error: QueryError(QueryError(UniqueConstraintViolation { field_name: "A, _MovieToWriter" }

stack backtrace:
   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new_unresolved
   2: failure::backtrace::internal::InternalBacktrace::new
   3: <failure::backtrace::Backtrace as core::default::Default>::default
   4: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from
   5: sql_migration_connector::sql_database_step_applier::SqlDatabaseStepApplier::apply_next_step
   6: <sql_migration_connector::sql_database_step_applier::SqlDatabaseStepApplier as 
migration_connector::database_migration_step_applier::DatabaseMigrationStepApplier<sql_migration_connector::
sql_migration::SqlMigration>>::apply_step
   7: <migration_connector::migration_applier::MigrationApplierImpl<T> as migration_connector::migration_app
lier::MigrationApplier<T>>::apply
   8: migration_engine::commands::apply_migration::ApplyMigrationCommand::handle_migration
   9: <migration_engine::api::MigrationApi<C,D> as migration_engine::api::GenericApi>::apply_migration
  10: migration_engine::api::rpc::RpcApi::create_sync_handler
  11: tokio_executor::enter::exit
  12: tokio_threadpool::blocking::blocking
  13: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll
  14: futures::future::chain::Chain<A,B,C>::poll
  15: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  16: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll
  17: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  18: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  19: <futures::future::either::Either<A,B> as futures::future::Future>::poll
  20: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  21: <futures::future::map_err::MapErr<A,F> as futures::future::Future>::poll
  22: <futures::stream::and_then::AndThen<S,F,U> as futures::stream::Stream>::poll
  23: <futures::stream::forward::Forward<T,U> as futures::future::Future>::poll
  24: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  25: <futures::future::map_err::MapErr<A,F> as futures::future::Future>::poll
  26: futures::task_impl::std::set
  27: std::panicking::try::do_call
  28: __rust_maybe_catch_panic
  29: tokio_threadpool::task::Task::run
  30: tokio_threadpool::worker::Worker::run_task
  31: tokio_threadpool::worker::Worker::run
  32: std::thread::local::LocalKey<T>::with
  33: std::thread::local::LocalKey<T>::with
  34: std::thread::local::LocalKey<T>::with
  35: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
  36: std::thread::local::LocalKey<T>::with
  37: std::thread::local::LocalKey<T>::with
  38: std::sys_common::backtrace::__rust_begin_short_backtrace
  39: std::panicking::try::do_call
  40: __rust_maybe_catch_panic
  41: core::ops::function::FnOnce::call_once{{vtable.shim}}
  42: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  43: std::sys::unix::thread::Thread::new::thread_start
  44: _pthread_start
)

stack backtrace:
   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new_unresolved
   2: failure::backtrace::internal::InternalBacktrace::new
   3: <failure::backtrace::Backtrace as core::default::Default>::default
   4: <sql_migration_connector::sql_database_step_applier::SqlDatabaseStepApplier as 
migration_connector::database_migration_step_applier::DatabaseMigrationStepApplier<sql_migration_connector::
sql_migration::SqlMigration>>::apply_step
   5: <migration_connector::migration_applier::MigrationApplierImpl<T> as migration_connector::migration_app
lier::MigrationApplier<T>>::apply
   6: migration_engine::commands::apply_migration::ApplyMigrationCommand::handle_migration
   7: <migration_engine::api::MigrationApi<C,D> as migration_engine::api::GenericApi>::apply_migration
   8: migration_engine::api::rpc::RpcApi::create_sync_handler
   9: tokio_executor::enter::exit
  10: tokio_threadpool::blocking::blocking
  11: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll
  12: futures::future::chain::Chain<A,B,C>::poll
  13: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  14: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll
  15: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  16: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  17: <futures::future::either::Either<A,B> as futures::future::Future>::poll
  18: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  19: <futures::future::map_err::MapErr<A,F> as futures::future::Future>::poll
  20: <futures::stream::and_then::AndThen<S,F,U> as futures::stream::Stream>::poll
  21: <futures::stream::forward::Forward<T,U> as futures::future::Future>::poll
  22: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  23: <futures::future::map_err::MapErr<A,F> as futures::future::Future>::poll
  24: futures::task_impl::std::set
  25: std::panicking::try::do_call
  26: __rust_maybe_catch_panic
  27: tokio_threadpool::task::Task::run
  28: tokio_threadpool::worker::Worker::run_task
  29: tokio_threadpool::worker::Worker::run
  30: std::thread::local::LocalKey<T>::with
  31: std::thread::local::LocalKey<T>::with
  32: std::thread::local::LocalKey<T>::with
  33: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
  34: std::thread::local::LocalKey<T>::with
  35: std::thread::local::LocalKey<T>::with
  36: std::sys_common::backtrace::__rust_begin_short_backtrace
  37: std::panicking::try::do_call
  38: __rust_maybe_catch_panic
  39: core::ops::function::FnOnce::call_once{{vtable.shim}}
  40: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  41: std::sys::unix::thread::Thread::new::thread_start
  42: _pthread_start
)
    at Object.<anonymous> (/Users/nikolasburk/.config/yarn/global/node_modules/prisma2/build/index.js:215347
:40)
    at LiftEngine.handleResponse (/Users/nikolasburk/.config/yarn/global/node_modules/prisma2/build/index.js
:215257:42)
    at LineStream.<anonymous> (/Users/nikolasburk/.config/yarn/global/node_modules/prisma2/build/index.js:21
5322:26)
    at LineStream.emit (events.js:196:13)
    at LineStream.EventEmitter.emit (domain.js:471:20)
    at addChunk (_stream_readable.js:290:12)
    at readableAddChunk (_stream_readable.js:271:11)
    at LineStream.Readable.push (_stream_readable.js:226:10)
    at LineStream.Transform.push (_stream_transform.js:150:32)
    at LineStream.module.exports.LineStream._pushBuffer (/Users/nikolasburk/.config/yarn/global/node_modules
/prisma2/build/index.js:429136:23)

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Oct 16, 2019
@pantharshit00
Copy link
Contributor

I can confirm this

@mavilein
Copy link
Member

Let's try this one when we have merged the big refactoring PR for the query engine. That will happen this week.

@janpio janpio added this to the Preview 16 milestone Oct 28, 2019
@mavilein mavilein assigned dpetrick and mavilein and unassigned mavilein Oct 29, 2019
@mavilein mavilein assigned mavilein and tomhoule and unassigned mavilein and dpetrick Oct 31, 2019
@tomhoule
Copy link
Contributor

tomhoule commented Nov 7, 2019

I haven't had time to work on this yet (to investigate), but it's on my radar.

@mavilein
Copy link
Member

mavilein commented Nov 7, 2019

@tomhoule : I looked into this and know what is going on here. Let's talk about it offline when i'm back at the office.

@mavilein
Copy link
Member

I talked with @tomhoule about this. He is implementing the errors spec right now. This error will be more understandable once the errors spec is implemented.

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.
Projects
None yet
Development

No branches or pull requests

7 participants