question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MySQL 5.7 "Error in lift engine for rpc listMigrations" when DB name has a hyphen

See original GitHub issue

I’m connecting to a local MySQL database with prisma2@2.0.0-preview-3.2

datasource db {
  provider = "mysql"
  url      = "mysql://root:123456789@127.0.0.1:3306/prisma-nexus"
}

and after running prisma2 lift save --name init it throws Error: Error in lift engine for rpc listMigrations

Failed listMigrations at 2019-08-02T10:34:28.976Z

RPC Input One Line

{"id":1,"jsonrpc":"2.0","method":"listMigrations","params":{"projectInfo":"","sourceConfig":"datasource db {\n  provider = \"mysql\"\n  url      = \"mysql://root:123456789@127.0.0.1:3306/prisma-nexus\"\n}\n\ngenerator photon {\n  provider = \"photonjs\"\n}\n\ngenerator nexus_prisma {\n  provider = \"nexus-prisma\"\n}\n\nmodel User {\n  id    String  @default(cuid()) @id @unique\n  email String  @unique\n  name  String?\n  posts Post[]\n}\n\nmodel Post {\n  id        String   @default(cuid()) @id @unique\n  createdAt DateTime @default(now())\n  updatedAt DateTime @updatedAt\n  published Boolean\n  title     String\n  content   String?\n  author    User?\n}"}}

RPC Input Readable

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "listMigrations",
  "params": {
    "projectInfo": "",
    "sourceConfig": "datasource db {\n  provider = \"mysql\"\n  url      = \"mysql://root:123456789@127.0.0.1:3306/prisma-nexus\"\n}\n\ngenerator photon {\n  provider = \"photonjs\"\n}\n\ngenerator nexus_prisma {\n  provider = \"nexus-prisma\"\n}\n\nmodel User {\n  id    String  @default(cuid()) @id @unique\n  email String  @unique\n  name  String?\n  posts Post[]\n}\n\nmodel Post {\n  id        String   @default(cuid()) @id @unique\n  createdAt DateTime @default(now())\n  updatedAt DateTime @updatedAt\n  published Boolean\n  title     String\n  content   String?\n  author    User?\n}"
  }
}

RPC Response

null

Stack Trace

[migration-engine/connectors/sql-migration-connector/src/lib.rs:397] format!("CREATE SCHEMA IF NOT EXISTS `{}` DEFAULT CHARACTER SET latin1;" , &
        self . schema_name) = "CREATE SCHEMA IF NOT EXISTS `prisma-nexus` DEFAULT CHARACTER SET latin1;"
[migration-engine/connectors/sql-migration-connector/src/sql_migration_persistence.rs:39] m.make_from(barrel_variant) = "CREATE TABLE prisma-nexus._Migration (revision INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name TEXT NOT NULL, datamodel TEXT NOT NULL, status TEXT NOT NULL, applied INTEGER NOT NULL, rolled_back INTEGER NOT NULL, datamodel_steps TEXT NOT NULL, database_migration TEXT NOT NULL, errors TEXT NOT NULL, started_at datetime(3) NOT NULL, finished_at datetime(3));"
[/var/root/.cargo/git/checkouts/prisma-query-a8c45647247f5d6d/1107e25/src/connector/mysql.rs:60] visitor::Mysql::build(q) = (
    "SELECT `prisma-nexus`.`_Migration`.* FROM `prisma-nexus`.`_Migration`",
    [],
)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: QueryError(MySqlError { ERROR 1146 (42S02): Table 'prisma-nexus._migration' doesn't exist }

stack backtrace:
   0: backtrace::backtrace::trace::h1a2de69e72ae183d (0x10676a09e)
   1: backtrace::capture::Backtrace::new_unresolved::h930294fe2b60b491 (0x1067682c8)
   2: failure::backtrace::internal::InternalBacktrace::new::hb4d9ca333d8b97ee (0x106767c69)
   3: <failure::backtrace::Backtrace as core::default::Default>::default::h84240357500db3cb (0x106767e55)
   4: prisma_query::connector::mysql::error::<impl core::convert::From<mysql::error::Error> for prisma_query::error::Error>::from::hd9ac809d97265a5e (0x106292bae)
   5: <prisma_query::connector::mysql::Mysql as prisma_query::connector::queryable::Queryable>::query_raw::h102759ab16aef12f (0x106251c93)
   6: <prisma_query::connector::mysql::Mysql as prisma_query::connector::queryable::Queryable>::query::hb200e493e5047c00 (0x106251b37)
   7: <sql_migration_connector::migration_database::Mysql as sql_migration_connector::migration_database::MigrationDatabase>::query::h89eefdfc5002596c (0x1061fa88d)
   8: <sql_migration_connector::sql_migration_persistence::SqlMigrationPersistence as migration_connector::migration_persistence::MigrationPersistence>::load_all::haf015ef1aa539b74 (0x1061bdebb)
   9: <migration_core::commands::list_migrations::ListMigrationStepsCommand as migration_core::commands::command::MigrationCommand>::execute::hf17fdb946a3e2f31 (0x1060f2b2d)
  10: <F as jsonrpc_core::calls::RpcMethodSimple>::call::hf01039403477fca5 (0x10613fbd1)
  11: <F as jsonrpc_core::calls::RpcMethod<T>>::call::hd1036222cec53b94 (0x1060e21ec)
  12: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll::h4ec51a25c6821507 (0x1060f5612)
  13: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll::h237d5669254ecf15 (0x1060e2880)
  14: <futures::future::map::Map<A,F> as futures::future::Future>::poll::h76b2cfbd5571eb5d (0x1060fedbf)
  15: <futures::future::either::Either<A,B> as futures::future::Future>::poll::hd7ff4e9d1b2217d8 (0x1060f5920)
  16: futures::task_impl::std::set::hcdf643d1bd2f42af (0x10613219f)
  17: std::thread::local::LocalKey<T>::with::h7ae26f1524deb689 (0x106135e16)
  18: futures::future::Future::wait::h605fe0633ff08219 (0x1060fec0f)
  19: jsonrpc_core::io::IoHandler<M>::handle_request_sync::h066bd9bc4caba49b (0x1060dc42f)
  20: migration_core::rpc_api::RpcApi::handle::h7a17577fdd3ef47d (0x10614248b)
  21: migration_engine::main::hc86c74d4107213aa (0x1060b874d)
  22: std::rt::lang_start::{{closure}}::h7f81fc3af650a78e (0x1060b87b6)
  23: std::panicking::try::do_call::h1252fc9a2ff235eb (0x10678e5a8)
  24: __rust_maybe_catch_panic (0x10679298f)
  25: std::rt::lang_start_internal::h4c054360e442146c (0x10678f08e)
  26: main (0x1060b87a9))', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: <sql_migration_connector::sql_migration_persistence::SqlMigrationPersistence as migration_connector::migration_persistence::MigrationPersistence>::load_all
  10: <migration_core::commands::list_migrations::ListMigrationStepsCommand as migration_core::commands::command::MigrationCommand>::execute
  11: <F as jsonrpc_core::calls::RpcMethodSimple>::call
  12: <F as jsonrpc_core::calls::RpcMethod<T>>::call
  13: <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll
  14: <futures::future::then::Then<A,B,F> as futures::future::Future>::poll
  15: <futures::future::map::Map<A,F> as futures::future::Future>::poll
  16: <futures::future::either::Either<A,B> as futures::future::Future>::poll
  17: futures::task_impl::std::set
  18: std::thread::local::LocalKey<T>::with
  19: futures::future::Future::wait
  20: jsonrpc_core::io::IoHandler<M>::handle_request_sync
  21: migration_core::rpc_api::RpcApi::handle
  22: migration_engine::main
  23: std::rt::lang_start::{{closure}}
  24: std::panicking::try::do_call
  25: __rust_maybe_catch_panic
  26: std::rt::lang_start_internal
  27: main

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mavileincommented, Aug 20, 2019

This is fixed in latest alpha for MySQL and Postgres.

0reactions
pantharshit00commented, Aug 20, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma on Twitter: " Prisma 2 preview release 8 addressed three ...
... Tab characters make schema parser unhappy + unclear error ◇ MySQL 5.7 "Error in lift engine for rpc listMigrations" when DB name...
Read more >
Can't upgrade from 5.7 to 8.0 if any database have a hyphen ...
Description: When you try to upgrade an existing server from version 5.7 to version 8.0 and you have any databases (using InnoDB) with...
Read more >
2 Server Error Message Reference - MySQL :: Developer Zone
The MySQL server writes some error messages to its error log, and sends others to client ... Message: Table storage engine for '%s'...
Read more >
461: dash both allowed and disallowed in database name
Description: if I use mysqladmin -uroot -p****** create mambo-cfcl ... I still get the error: mysql> drop database 'dbname-with-dash'; ERROR ...
Read more >
81896: Can't use JSON when json name has dash inside
Description: When I use JSON type with fieldname containing dash - I can't extract value from this field. I am getting error: ERROR...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found