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 running tutorial migration #798

Closed
packapotatoes opened this Issue Mar 13, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@packapotatoes

packapotatoes commented Mar 13, 2017

I'm working on the getting started guide, but when i run diesel migration run I get the following cryptic error:

Running migration 20170313193655
thread 'main' panicked at 'internal error: entered unreachable code: Per PGs documentation, all errors should have a message', .cargo/registry/src/github.com-1ecc6299db9ec823/diesel-0.11.4/src/pg/connection/result.rs:91
note: Run with `RUST_BACKTRACE=1` for a backtrace.

I believe I have done everything correctly preceding this.

I am using

  • rustc 1.17.0-nightly
  • diesel 0.11.0
@killercup

This comment has been minimized.

Member

killercup commented Mar 13, 2017

@packapotatoes

This comment has been minimized.

packapotatoes commented Mar 13, 2017

I am running Linux Mint 18.1 (Ubuntu 16.04)
I believe I am using postgres 9.6, how can I check for sure?

Here is the additional output:

Running migration 20170313193655
thread 'main' panicked at 'internal error: entered unreachable code: Per PGs documentation, all errors should have a message', .cargo/registry/src/github.com-1ecc6299db9ec823/diesel-0.11.4/src/pg/connection/result.rs:91
stack backtrace:
   0:     0x55c054dba043 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h3c67687ba454b78b
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55c054db6524 - std::sys_common::backtrace::_print::h701c2403afe49d2d
                               at /checkout/src/libstd/sys_common/backtrace.rs:71
   2:     0x55c054dbc19c - std::panicking::default_hook::{{closure}}::h07b8ee04b5734d1a
                               at /checkout/src/libstd/sys_common/backtrace.rs:60
                               at /checkout/src/libstd/panicking.rs:355
   3:     0x55c054dbbd66 - std::panicking::default_hook::h23eeafbf7c1c05c3
                               at /checkout/src/libstd/panicking.rs:371
   4:     0x55c054dbc59b - std::panicking::rust_panic_with_hook::hd0067971b6d1240e
                               at /checkout/src/libstd/panicking.rs:549
   5:     0x55c054dbc424 - std::panicking::begin_panic::h1fd1f10a3de8f902
                               at /checkout/src/libstd/panicking.rs:511
   6:     0x55c054dbc399 - std::panicking::begin_panic_fmt::haa043917b5d6f21b
                               at /checkout/src/libstd/panicking.rs:495
   7:     0x55c054d93b06 - <diesel::pg::connection::result::PgErrorInformation as diesel::result::DatabaseErrorInformation>::message::he632342bedd1fc35
   8:     0x55c054d98c05 - <diesel::result::Error as std::error::Error>::description::he3bf3999aefbb8de
   9:     0x55c054d977a5 - <diesel::migrations::migration_error::RunMigrationsError as core::fmt::Display>::fmt::hf638487e386e20cb
  10:     0x55c054de6255 - core::fmt::write::h0dfe169107a72abb
                               at /checkout/src/libcore/fmt/mod.rs:911
  11:     0x55c054db2193 - <std::io::stdio::Stdout as std::io::Write>::write_fmt::h334c4f73bdd7ac1f
                               at /checkout/src/libstd/io/mod.rs:1015
                               at /checkout/src/libstd/io/stdio.rs:460
  12:     0x55c054db2fc6 - std::io::stdio::_print::h83b8589704f0a522
                               at /checkout/src/libstd/io/stdio.rs:680
  13:     0x55c054caf91e - diesel::run_migration_command::h7aeda08d0b501122
  14:     0x55c054caa72f - diesel::main::h0e6d44d4297b2522
  15:     0x55c054dc353a - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/lib.rs:98
  16:     0x55c054dbcd46 - std::rt::lang_start::hb7fc7ec87b663023
                               at /checkout/src/libstd/panicking.rs:433
                               at /checkout/src/libstd/panic.rs:361
                               at /checkout/src/libstd/rt.rs:57
  17:     0x7f84fac5782f - __libc_start_main
  18:     0x55c054c84438 - _start
  19:                0x0 - <unknown>
@sgrif

This comment has been minimized.

Member

sgrif commented Mar 13, 2017

psql -c 'select version();' will give you the version

@killercup

This comment has been minimized.

Member

killercup commented Mar 13, 2017

@Eijebong

This comment has been minimized.

Member

Eijebong commented Mar 13, 2017

The last time I had an error like that it's because I was trying to run an empty migration. I fixed that in 2c4db01
Are you sure your up.sql isn't empty (Not sure if 0.11.0 has that commit)

There were other status that diesel treats as an error and do not have error messages.
https://github.com/postgres/postgres/blob/93e6e40574bccf9c6f33c520a4189d3e98e2fd1f/src/interfaces/libpq/fe-exec.c#L177
Maybe something in there ?

@packapotatoes

This comment has been minimized.

packapotatoes commented Mar 13, 2017

psql -c 'select version();' gives me

 PostgreSQL 9.5.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413, 64-bit

postgres --version tells me No command 'postgres' found, is that a problem?

apt-cache show postgresql shows both 9.6 and 9.5 installed. Is this a problem? Should I uninstall one of them?

@Eijebong up.sql is identical to what is on the getting started page

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 14, 2017

Are you able to run the migrations from the examples directory in our source tree? (e.g. cd examples/postgres/getting_started_step_1 && diesel migration run)

@packapotatoes

This comment has been minimized.

packapotatoes commented Mar 14, 2017

well....I'm an idiot. Instead of editing the created up.sql and down.sql I accidentally made my own new files in the wrong directory. Problem solved, thanks all.

@sgrif sgrif closed this Mar 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment