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

owner_api panics with refresh argument #2105

Closed
tensor5 opened this issue Dec 8, 2018 · 3 comments · Fixed by #2128
Closed

owner_api panics with refresh argument #2105

tensor5 opened this issue Dec 8, 2018 · 3 comments · Fixed by #2128
Assignees
Labels

Comments

@tensor5
Copy link

tensor5 commented Dec 8, 2018

curl -i http://grin:<apisecret>@localhost:13420/v1/wallet/owner/retrieve_summary_info?refresh

panics the grin wallet owner_api

20181208 22:15:15.953 ERROR grin_util::logger - 
thread 'tokio-runtime-worker-1' panicked at 'nested block_on: EnterError { reason: "attempted to run an executor while another executor is already running" }': libcore/result.rs:1009stack backtrace:
   0:     0x56349592af8d - backtrace::backtrace::trace::h33a8de1a5de4f598
   1:     0x56349592a1a2 - <backtrace::capture::Backtrace as core::default::Default>::default::h13bf884e561085be
   2:     0x56349592a219 - backtrace::capture::Backtrace::new::h810796244ae4b8f2
   3:     0x56349589f720 - grin_util::logger::send_panic_to_log::{{closure}}::h4131e8199612a48b
   4:     0x5634959f6486 - std::panicking::rust_panic_with_hook::h71214e7ce0f7ac01
                        at libstd/panicking.rs:480
   5:     0x5634959f5fd1 - std::panicking::continue_panic_fmt::ha8b8442f4ea9bcac
                        at libstd/panicking.rs:390
   6:     0x5634959f5eb5 - rust_begin_unwind
                        at libstd/panicking.rs:325
   7:     0x563495a3f95c - core::panicking::panic_fmt::h0c93626b89c38af6
                        at libcore/panicking.rs:77
   8:     0x56349555adb6 - core::result::unwrap_failed::hd6d647e647f9d65f
   9:     0x56349555c90a - tokio::runtime::Runtime::block_on::h50c07489d8a34431
  10:     0x563495528fdd - grin_api::client::send_request::h58cd94e37f2486a3
  11:     0x5634953a0e3a - grin_api::client::get::hbbd2dcbfaea3a4b9
  12:     0x56349539976b - <grin_wallet::node_clients::http::HTTPNodeClient as grin_wallet::libwallet::types::NodeClient>::get_chain_height::ha4a82fe83f2fb5e3
  13:     0x5634951a5ed3 - grin_wallet::libwallet::internal::updater::refresh_outputs::he67ca7e885c2c77a
  14:     0x56349514cf02 - <grin_wallet::libwallet::api::APIOwner<W, C, K>>::retrieve_summary_info::h962086bf4a07c49c
  15:     0x5634951d0792 - <grin_wallet::controller::OwnerAPIHandler<T, C, K> as grin_api::router::Handler>::get::h8becc02a4b5c4a18
  16:     0x5634951e6350 - grin_api::router::Handler::call::h3592fee7f16fbddf
  17:     0x56349555ff9b - <grin_api::auth::BasicAuthMiddleware as grin_api::router::Handler>::call::hc53a654f81bc6502
  18:     0x5634954abe98 - <grin_api::router::Router as hyper::service::service::Service>::call::hbbd603eab9d00eef
  19:     0x56349556fff5 - <hyper::proto::h1::dispatch::Server<S> as hyper::proto::h1::dispatch::Dispatch>::recv_msg::hf8e1c05dc0b5c7f7
  20:     0x56349557b420 - <hyper::proto::h1::dispatch::Dispatcher<D, Bs, I, T>>::poll_catch::h0e93e88a5683ce62
  21:     0x5634955186ce - <hyper::server::conn::upgrades::UpgradeableConnection<I, S, E> as futures::future::Future>::poll::h03c736ccad93c676
  22:     0x5634955852aa - <hyper::server::conn::spawn_all::NewSvcTask<I, N, S, E, W> as futures::future::Future>::poll::h7c7480fa1a02b78a
  23:     0x563495711ef1 - futures::task_impl::std::set::hc4b047e2258852d7
  24:     0x563495712925 - <futures::task_impl::Spawn<T>>::poll_future_notify::h6b8b942bdee24293
  25:     0x563495716170 - std::panicking::try::do_call::h379db939d220e7ba
  26:     0x563495a08889 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  27:     0x56349571418b - tokio_threadpool::task::Task::run::hd407da1872c403cb
  28:     0x56349570c645 - tokio_threadpool::worker::Worker::run_task::h735b3514c6e90b44
  29:     0x56349570badd - tokio_threadpool::worker::Worker::run::ha56b3a90b49df5c9
  30:     0x5634956f26d5 - <std::thread::local::LocalKey<T>>::with::h2e2f8722784589ba
  31:     0x5634956f2828 - <std::thread::local::LocalKey<T>>::with::h65ffeee491ed9b24
  32:     0x5634956f2502 - <std::thread::local::LocalKey<T>>::with::h2207b72bbb3594a7
  33:     0x5634956f54ed - tokio::runtime::builder::Builder::build::{{closure}}::h33c8bf677f817e8b
  34:     0x56349571345c - <std::thread::local::LocalKey<T>>::with::h17a742e397d4af0c
  35:     0x5634957135c1 - <std::thread::local::LocalKey<T>>::with::h70802f72c7300a39
  36:     0x563495716aab - std::sys_common::backtrace::__rust_begin_short_backtrace::he05acf4f68e09c1c
  37:     0x56349571612b - std::panicking::try::do_call::h2a038064618082be
  38:     0x563495a08889 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  39:     0x563495710adf - <F as alloc::boxed::FnBox<A>>::call_box::h4ce92ff10f8c6050
  40:     0x5634959f2a1d - <alloc::boxed::Box<(dyn alloc::boxed::FnBox<A, Output=R> + 'a)> as core::ops::function::FnOnce<A>>::call_once::he3acfc8f1203786f
                        at liballoc/boxed.rs:682
                         - std::sys_common::thread::start_thread::h5213f803a61d7811
                        at libstd/sys_common/thread.rs:24
  41:     0x5634959ddaa5 - std::sys::unix::thread::Thread::new::thread_start::he89121f566d2a8c7
                        at libstd/sys/unix/thread.rs:90
  42:     0x7f3e40d0ea9c - start_thread
  43:     0x7f3e40c24b22 - clone
  44:                0x0 - <unknown>


Thread 'tokio-runtime-worker-1' panicked with message:
"nested block_on: EnterError { reason: "attempted to run an executor while another executor is already running" }"
See /home/nicola/.grin/grin-wallet.log for further details.

The same error comes up with othen owner_api calls whenever the refresh argument is present.

@quentinlesceller
Copy link
Member

Same here:

20181208 23:09:08.734 ERROR grin_util::logger -
thread 'tokio-runtime-worker-1' panicked at 'nested block_on: EnterError { reason: "attempted to run an executor while another executor is already running" }': libcore/result.rs:1009stack backtrace:
   0:     0x5587172a5aed - backtrace::backtrace::trace::h33a8de1a5de4f598
   1:     0x5587172a4d02 - <backtrace::capture::Backtrace as core::default::Default>::default::h13bf884e561085be
   2:     0x5587172a4d79 - backtrace::capture::Backtrace::new::h810796244ae4b8f2
   3:     0x558717217450 - grin_util::logger::send_panic_to_log::{{closure}}::h4131e8199612a48b
   4:     0x558717373896 - std::panicking::rust_panic_with_hook::h71214e7ce0f7ac01
                        at libstd/panicking.rs:480
   5:     0x5587173733e1 - std::panicking::continue_panic_fmt::ha8b8442f4ea9bcac
                        at libstd/panicking.rs:390
   6:     0x5587173732c5 - rust_begin_unwind
                        at libstd/panicking.rs:325
   7:     0x5587173bcd6c - core::panicking::panic_fmt::h0c93626b89c38af6
                        at libcore/panicking.rs:77
   8:     0x558716ed1d96 - core::result::unwrap_failed::hd6d647e647f9d65f
   9:     0x558716ed38ea - tokio::runtime::Runtime::block_on::h50c07489d8a34431
  10:     0x558716e9ffbd - grin_api::client::send_request::h58cd94e37f2486a3
  11:     0x558716d17e1a - grin_api::client::get::hbbd2dcbfaea3a4b9
  12:     0x558716d1074b - <grin_wallet::node_clients::http::HTTPNodeClient as grin_wallet::libwallet::types::NodeClient>::get_chain_height::ha4a82fe83f2fb5e3
  13:     0x558716b1ce83 - grin_wallet::libwallet::internal::updater::refresh_outputs::he67ca7e885c2c77a
  14:     0x558716ac3eb2 - <grin_wallet::libwallet::api::APIOwner<W, C, K>>::retrieve_summary_info::h962086bf4a07c49c
  15:     0x558716b47742 - <grin_wallet::controller::OwnerAPIHandler<T, C, K> as grin_api::router::Handler>::get::h8becc02a4b5c4a18
  16:     0x558716b5d300 - grin_api::router::Handler::call::h3592fee7f16fbddf
  17:     0x558716e22e78 - <grin_api::router::Router as hyper::service::service::Service>::call::hbbd603eab9d00eef
  18:     0x558716ee6fd5 - <hyper::proto::h1::dispatch::Server<S> as hyper::proto::h1::dispatch::Dispatch>::recv_msg::hf8e1c05dc0b5c7f7
  19:     0x558716ef2400 - <hyper::proto::h1::dispatch::Dispatcher<D, Bs, I, T>>::poll_catch::h0e93e88a5683ce62
  20:     0x558716e8f6ae - <hyper::server::conn::upgrades::UpgradeableConnection<I, S, E> as futures::future::Future>::poll::h03c736ccad93c676
  21:     0x558716efc28a - <hyper::server::conn::spawn_all::NewSvcTask<I, N, S, E, W> as futures::future::Future>::poll::h7c7480fa1a02b78a
  22:     0x558717089761 - futures::task_impl::std::set::hc4b047e2258852d7
  23:     0x55871708a195 - <futures::task_impl::Spawn<T>>::poll_future_notify::h6b8b942bdee24293
  24:     0x55871708d9e0 - std::panicking::try::do_call::h379db939d220e7ba
  25:     0x558717385c99 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  26:     0x55871708b9fb - tokio_threadpool::task::Task::run::hd407da1872c403cb
  27:     0x558717083eb5 - tokio_threadpool::worker::Worker::run_task::h735b3514c6e90b44
  28:     0x55871708352e - tokio_threadpool::worker::Worker::run::ha56b3a90b49df5c9
  29:     0x558717069f45 - <std::thread::local::LocalKey<T>>::with::h2e2f8722784589ba
  30:     0x55871706a098 - <std::thread::local::LocalKey<T>>::with::h65ffeee491ed9b24
  31:     0x558717069d72 - <std::thread::local::LocalKey<T>>::with::h2207b72bbb3594a7
  32:     0x55871706cd5d - tokio::runtime::builder::Builder::build::{{closure}}::h33c8bf677f817e8b
  33:     0x55871708accc - <std::thread::local::LocalKey<T>>::with::h17a742e397d4af0c
  34:     0x55871708ae31 - <std::thread::local::LocalKey<T>>::with::h70802f72c7300a39
  35:     0x55871708e31b - std::sys_common::backtrace::__rust_begin_short_backtrace::he05acf4f68e09c1c
  36:     0x55871708d99b - std::panicking::try::do_call::h2a038064618082be
  37:     0x558717385c99 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  38:     0x55871708834f - <F as alloc::boxed::FnBox<A>>::call_box::h4ce92ff10f8c6050
  39:     0x55871736fe2d - <alloc::boxed::Box<(dyn alloc::boxed::FnBox<A, Output=R> + 'a)> as core::ops::function::FnOnce<A>>::call_once::he3acfc8f1203786f
                        at liballoc/boxed.rs:682
                         - std::sys_common::thread::start_thread::h5213f803a61d7811
                        at libstd/sys_common/thread.rs:24
  40:     0x55871735aeb5 - std::sys::unix::thread::Thread::new::thread_start::he89121f566d2a8c7
                        at libstd/sys/unix/thread.rs:90
  41:     0x7fdaab6636b9 - start_thread
  42:     0x7fdaab18341c - clone
  43:                0x0 - <unknown>

@hashmap hashmap self-assigned this Dec 10, 2018
@hashmap
Copy link
Contributor

hashmap commented Dec 10, 2018

I'll take care of it

@hashmap
Copy link
Contributor

hashmap commented Dec 10, 2018

It's caused by changes in Tokio, most probably tokio-rs/tokio@7b5ef61
The proper way to fix it is to call client::get_async and return a future, but it's a serious change which breaks a lot of wallet apis. I'll check what else we could do.

@hashmap hashmap added the bug label Dec 11, 2018
hashmap added a commit to cyclefortytwo/grin that referenced this issue Dec 11, 2018
This is a tmp fix for  mimblewimble#2105, the current version of tokio doesn't allow
to call `block_on` on Runtime inside another Runtime. In our case we do
it to call API client from API handler. At the moment we switch to old
version of tokio and will implement a proper fix a bit later
hashmap added a commit to cyclefortytwo/grin that referenced this issue Dec 11, 2018
This is a tmp fix for  mimblewimble#2105, the current version of tokio doesn't allow
to call `block_on` on Runtime inside another Runtime. In our case we do
it to call API client from API handler. At the moment we switch to old
version of tokio and will implement a proper fix a bit later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants