faokunega / pg-embed

Run a Postgresql database locally on Linux, MacOS or Windows as part of another Rust application or test.
MIT License
116 stars 26 forks source link

error handling output: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" } #9

Closed itschrono closed 3 years ago

itschrono commented 3 years ago

Hello, I am trying to run pg-embed with a minimal code and I get a really weird error.

main.rs:

use pg_embed::pg_enums::PgAuthMethod;
// use pg_embed::pg_fetch;
use pg_embed::pg_fetch::{PgFetchSettings, PG_V13};
use pg_embed::postgres::{PgEmbed, PgSettings};
use pg_embed::pg_errors::PgEmbedError;
use std::path::PathBuf;
use std::time::Duration;

#[tokio::main]
async fn main() {
    dbg! ("main…");
    setup().await.unwrap();
}

pub async fn setup() -> Result<PgEmbed, PgEmbedError> {
    // Postgresql settings
    let pg_settings = PgSettings {
        // Where to store the postgresql database
        database_dir: PathBuf::from("data/db"),
        port: 6543,
        user: "____".to_string(),
        password: "_____".to_string(),
        // authentication method
        auth_method: PgAuthMethod::Plain,
        // If persistent is false clean up files and directories on drop, otherwise keep them
        persistent: true,
        // duration to wait before terminating process execution
        // pg_ctl start/stop and initdb timeout
        // if set to None the process will not be terminated
        timeout: Some(Duration::from_secs(1500)),
        // If migration sql scripts need to be run, the directory containing those scripts can be
        // specified here with `Some(PathBuf(path_to_dir)), otherwise `None` to run no migrations.
        // To enable migrations view the **Usage** section for details
        migration_dir: None,

    };

    // Postgresql binaries download settings
    let fetch_settings = PgFetchSettings {
        version: PG_V13,
        ..Default::default()
    };
    dbg! ("Database new instance…");
    // Create a new instance
    let mut pg = PgEmbed::new(pg_settings, fetch_settings).await?;

    dbg! ("Database setup…");
    // Download, unpack, create password file and database cluster
    pg.setup().await?;

    dbg! ("Database setup [OK]");
    // start postgresql database
    dbg! ("Database starting…");
    pg.start_db().await?;
    dbg! ("Database started [OK]");

    tokio::time::sleep(Duration::from_millis(10000)).await;

    return Ok(pg);
    // // create a new database
    // // to enable migrations view the [Usage] section for details
    // pg.create_database("database_name").await;

    // // drop a database
    // // to enable migrations view [Usage] for details
    // pg.drop_database("database_name").await;

    // // check database existence
    // // to enable migrations view [Usage] for details
    // pg.database_exists("database_name").await;

    // // run migration sql scripts
    // // to enable migrations view [Usage] for details
    // pg.migrate("database_name").await;

    // // stop postgresql database
    // pg.stop_db().await;
}

shell output

     Running `target\debug\its_control_center.exe`
[src\main.rs:12] "main…" = "main…"
[src\main.rs:44] "Database new instance…" = "Database new instance…"
[src\main.rs:48] "Database setup…" = "Database setup…"
[src\main.rs:52] "Database setup [OK]" = "Database setup [OK]"
[src\main.rs:54] "Database starting…" = "Database starting…"  
[src\main.rsthread ':tokio-runtime-worker56' panicked at '] error handling output: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" }"Database started [OK]"',  = C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\pg-embed-0.6.1\src\command_executor.rs":Database started [OK]129":
56
stack backtrace:
   0:     0x7ff71627116e - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff71627116e - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66    
   2:     0x7ff71627116e - std::sys_common::backtrace::_print_fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:67
   3:     0x7ff71627116e - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:46
   4:     0x7ff71628d18a - core::fmt::write
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\fmt\mod.rs:1150
   5:     0x7ff71626a278 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\io\mod.rs:1667
   6:     0x7ff716273cb6 - std::sys_common::backtrace::_print
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:49
   7:     0x7ff716273cb6 - std::sys_common::backtrace::print
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:36
   8:     0x7ff716273cb6 - std::panicking::default_hook::closure$1
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:210
   9:     0x7ff7162737a4 - std::panicking::default_hook
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:227
  10:     0x7ff716274315 - std::panicking::rust_panic_with_hook
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:624
  11:     0x7ff716273efb - std::panicking::begin_panic_handler::closure$0
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:521
  12:     0x7ff716271ab7 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure$0,never$>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys_common\backtrace.rs:141
  13:     0x7ff716273e59 - std::panicking::begin_panic_handler
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\panicking.rs:517
  14:     0x7ff7162eba60 - core::panicking::panic_fmt
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\panicking.rs:101
  15:     0x7ff7162ebb73 - core::result::unwrap_failed
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\core\src\result.rs:1617
  16:     0x7ff715d71b65 - enum$<core::result::Result<enum$<core::option::Option<alloc::string::String>, 1, 18446744073709551615, Some>,std::io::error::Error> >::expect<enum$<core::option::Option<alloc::string::String>, 1, 18446744073709551615, Some>,std::io::error::Error>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\result.rs:1259
  17:     0x7ff715d61de9 - pg_embed::command_executor::impl$0::handle_output::generator$0<enum$<pg_embed::pg_enums::PgServerStatus>,pg_embed::pg_errors::PgEmbedError,enum$<pg_embed::pg_enums::PgProcessType>,tokio::process::ChildStdout>
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\pg-embed-0.6.1\src\command_executor.rs:129
  18:     0x7ff715db3129 - core::future::from_generator::impl$1::poll<pg_embed::command_executor::impl$0::handle_output::generator$0>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\future\mod.rs:80
  19:     0x7ff715d62ecb - pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0<enum$<pg_embed::pg_enums::PgServerStatus>,pg_embed::pg_errors::PgEmbedError,enum$<pg_embed::pg_enums::PgProcessType> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\pg-embed-0.6.1\src\command_executor.rs:175
  20:     0x7ff715db22a9 - core::future::from_generator::impl$1::poll<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\future\mod.rs:80
  21:     0x7ff715d80583 - tokio::runtime::task::core::impl$3::poll::closure$0<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\core.rs:161
  22:     0x7ff715da0c82 - tokio::loom::std::unsafe_cell::UnsafeCell<enum$<tokio::runtime::task::core::Stage<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0> > > >::with_mut<enum$<tokio::runtime::task::core::St
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\loom\std\unsafe_cell.rs:14
  23:     0x7ff715d7fc9f - tokio::runtime::task::core::CoreStage<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0> >::poll<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_exec
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\core.rs:151
  24:     0x7ff715d8e23a - tokio::runtime::task::harness::poll_future::closure$0<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:461
  25:     0x7ff715d6cfd3 - core::panic::unwind_safe::impl$23::call_once<enum$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure$0>       
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\panic\unwind_safe.rs:271
  26:     0x7ff715d84f40 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0>,enum$<core::task::poll::Poll<tuple$<> > > >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:403
  27:     0x7ff715d87143 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::impl$1::drop_join_handle_slow::closure$0>,tuple$<> >
  28:     0x7ff715d83289 - std::panicking::try<enum$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:367
  29:     0x7ff715d5b14b - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0>,enum$<core::task::poll::Poll<tuple$<> > > >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panic.rs:129
  30:     0x7ff715d8cc2b - tokio::runtime::task::harness::poll_future<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:449
  31:     0x7ff715d8f079 - tokio::runtime::task::harness::Harness<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0>,alloc::sync::Arc<tokio::runtime::thread_pool::worker::Shared> >::poll_inner<core::future::from_
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:98
  32:     0x7ff715d93f13 - tokio::runtime::task::harness::Harness<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0>,alloc::sync::Arc<tokio::runtime::thread_pool::worker::Shared> >::poll<core::future::from_genera
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:53
  33:     0x7ff715d8a032 - tokio::runtime::task::raw::poll<core::future::from_generator::GenFuture<pg_embed::command_executor::impl$0::command_execution::generator$0::generator$0>,alloc::sync::Arc<tokio::runtime::thread_pool::worker::Shared> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\raw.rs:113
  34:     0x7ff7161841d0 - tokio::runtime::task::raw::RawTask::poll
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\raw.rs:70
  35:     0x7ff716204672 - tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::runtime::thread_pool::worker::Shared> >::run<alloc::sync::Arc<tokio::runtime::thread_pool::worker::Shared> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\mod.rs:343
  36:     0x7ff7161e563d - tokio::runtime::thread_pool::worker::impl$1::run_task::closure$0
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:420
  37:     0x7ff7161a7f79 - tokio::coop::with_budget::closure$0<enum$<core::result::Result<alloc::boxed::Box<tokio::runtime::thread_pool::worker::Core,alloc::alloc::Global>,tuple$<> >, 1, 18446744073709551615, Ok>,tokio::runtime::thread_pool::worker::impl$1::run_task::closure$0>
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\coop.rs:106
  38:     0x7ff7161e9c52 - std::thread::local::LocalKey<core::cell::Cell<tokio::coop::Budget> >::try_with<core::cell::Cell<tokio::coop::Budget>,tokio::coop::with_budget::closure$0,enum$<core::result::Result<alloc::boxed::Box<tokio::runtime::thread_pool::worker::Core,alloc::alloc::G
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\thread\local.rs:399
  39:     0x7ff7161e924d - std::thread::local::LocalKey<core::cell::Cell<tokio::coop::Budget> >::with<core::cell::Cell<tokio::coop::Budget>,tokio::coop::with_budget::closure$0,enum$<core::result::Result<alloc::boxed::Box<tokio::runtime::thread_pool::worker::Core,alloc::alloc::Globa
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\thread\local.rs:375
  40:     0x7ff7161e548c - tokio::coop::with_budget
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\coop.rs:99
  41:     0x7ff7161e548c - tokio::coop::budget
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\coop.rs:76
  42:     0x7ff7161e548c - tokio::runtime::thread_pool::worker::Context::run_task
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:419
  43:     0x7ff7161e500c - tokio::runtime::thread_pool::worker::Context::run
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:386
  44:     0x7ff7161e4ea7 - tokio::runtime::thread_pool::worker::run::closure$0
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:371
  45:     0x7ff7161ff536 - tokio::macros::scoped_tls::ScopedKey<tokio::runtime::thread_pool::worker::Context>::set<tokio::runtime::thread_pool::worker::Context,tokio::runtime::thread_pool::worker::run::closure$0,tuple$<> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\macros\scoped_tls.rs:61
  46:     0x7ff7161e4d79 - tokio::runtime::thread_pool::worker::run
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:368
  47:     0x7ff7161e4c6e - tokio::runtime::thread_pool::worker::impl$0::launch::closure$0
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\thread_pool\worker.rs:347
  48:     0x7ff716198e8b - tokio::runtime::blocking::task::impl$2::poll<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0,tuple$<> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\blocking\task.rs:42
  49:     0x7ff7161837b3 - tokio::runtime::task::core::impl$3::poll::closure$0<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\core.rs:161
  50:     0x7ff7161ce0b2 - tokio::loom::std::unsafe_cell::UnsafeCell<enum$<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0> > > >::with_mut<enum$<tokio::runtime::task::core::Stage<tokio::r
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\loom\std\unsafe_cell.rs:14
  51:     0x7ff71618350f - tokio::runtime::task::core::CoreStage<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0> >::poll<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::cl
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\core.rs:151
  52:     0x7ff716207ffa - tokio::runtime::task::harness::poll_future::closure$0<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:461
  53:     0x7ff71619b183 - core::panic::unwind_safe::impl$23::call_once<enum$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure$0>       
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\panic\unwind_safe.rs:271
  54:     0x7ff716208fe0 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0>,enum$<core::task::poll::Poll<tuple$<> > > >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:403
  55:     0x7ff7162097f3 - std::panicking::panicking
  56:     0x7ff7162086d9 - std::panicking::try<enum$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:367
  57:     0x7ff7161af65b - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure$0>,enum$<core::task::poll::Poll<tuple$<> > > >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panic.rs:129
  58:     0x7ff716207b0b - tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0> >
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:449
  59:     0x7ff716205f81 - tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0>,tokio::runtime::blocking::schedule::NoopSchedule>::poll_inner<tokio::runtime::blocking::task::BlockingTask<
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:98
  60:     0x7ff716205d03 - tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0>,tokio::runtime::blocking::schedule::NoopSchedule>::poll<tokio::runtime::blocking::task::BlockingTask<tokio:
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\harness.rs:53
  61:     0x7ff716184322 - tokio::runtime::task::raw::poll<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::thread_pool::worker::impl$0::launch::closure$0>,tokio::runtime::blocking::schedule::NoopSchedule>
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\raw.rs:113
  62:     0x7ff7161841d0 - tokio::runtime::task::raw::RawTask::poll
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\raw.rs:70
  63:     0x7ff716204728 - tokio::runtime::task::UnownedTask<tokio::runtime::blocking::schedule::NoopSchedule>::run<tokio::runtime::blocking::schedule::NoopSchedule>
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\task\mod.rs:379
  64:     0x7ff7161aad52 - tokio::runtime::blocking::pool::Inner::run
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\blocking\pool.rs:265
  65:     0x7ff7161aa4bb - tokio::runtime::blocking::pool::impl$3::spawn_thread::closure$0
                               at C:\Users\Antoine\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.13.0\src\runtime\blocking\pool.rs:245
  66:     0x7ff7161f3cb2 - std::sys_common::backtrace::__rust_begin_short_backtrace<tokio::runtime::blocking::pool::impl$3::spawn_thread::closure$0,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\sys_common\backtrace.rs:125
  67:     0x7ff71619bf01 - std::thread::impl$0::spawn_unchecked::closure$0::closure$0<tokio::runtime::blocking::pool::impl$3::spawn_thread::closure$0,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\thread\mod.rs:481
  68:     0x7ff71619b2a1 - core::panic::unwind_safe::impl$23::call_once<tuple$<>,std::thread::impl$0::spawn_unchecked::closure$0::closure$0>
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\panic\unwind_safe.rs:271
  69:     0x7ff716208e7b - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked::closure$0::closure$0>,tuple$<> >      
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:403
  70:     0x7ff7162097f3 - std::panicking::panicking
  71:     0x7ff7162083ab - std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked::closure$0::closure$0> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panicking.rs:367
  72:     0x7ff7161af841 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked::closure$0::closure$0>,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\panic.rs:129
  73:     0x7ff71619bd48 - std::thread::impl$0::spawn_unchecked::closure$0<tokio::runtime::blocking::pool::impl$3::spawn_thread::closure$0,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\std\src\thread\mod.rs:480
  74:     0x7ff71619c1fe - core::ops::function::FnOnce::call_once<std::thread::impl$0::spawn_unchecked::closure$0,tuple$<> >
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\core\src\ops\function.rs:227
  75:     0x7ff71627cffc - alloc::boxed::impl$44::call_once
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\alloc\src\boxed.rs:1636
  76:     0x7ff71627cffc - alloc::boxed::impl$44::call_once
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\library\alloc\src\boxed.rs:1636
  77:     0x7ff71627cffc - std::sys::windows::thread::impl$0::new::thread_start
                               at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa\/library\std\src\sys\windows\thread.rs:58
  78:     0x7ffd88457034 - BaseThreadInitThunk
  79:     0x7ffd89dc2651 - RtlUserThreadStart

I use rustc 1.56.0 with toolchain stable-x86_64-pc-windows-msvc.

Thanks

itschrono commented 3 years ago

My pg-embed version is 0.6.1 but I tried with 0.6.0 and 0.5.4 and got the same error.

faokunega commented 3 years ago

Hi, I'm looking into this. Could you please post your Cargo.toml dependency settings. Thanks in advance

itschrono commented 3 years ago

Of course:

[dependencies]
futures = "0.3.17"
pg-embed = { version = "=0.6.1", default-features = false, features = ["rt_tokio"] }
tokio = { version = "=1.13.0", features = ["full"] }
faokunega commented 3 years ago

I published a new version (v0.6.4). Hopefully it will now work for you. Had to remove part of the logging on Windows for it to work, because the Windows console is not properly supported with std::io::stderr. Thanks for the hint, I'm usually testing on MacOS and wouldn't have caught the error if it weren't for you.

itschrono commented 3 years ago

Ok good to hear. Thanks for your (command)-promptness 😄