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

thread 'actix-rt:worker:1' panicked at 'called Result::unwrap() on an Err value: ()' #52

Closed
svenstaro opened this issue Oct 3, 2019 · 4 comments

Comments

@svenstaro
Copy link
Contributor

svenstaro commented Oct 3, 2019

This is a weird one. So I have a web server written in actix and a reverse proxy written in actix. I'm using a simple set up with these two services: curl -> reverse proxy -> web server. This works just fine. However, when I run that set up in Docker, I get this:

thread 'actix-rt:worker:0' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:1084:5
stack backtrace:
   0:          0x14e6952 - backtrace::backtrace::libunwind::trace::h23a1372728ae23d0
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
   1:          0x14e6952 - backtrace::backtrace::trace_unsynchronized::h7c93075f10fab669
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
   2:          0x14e6952 - std::sys_common::backtrace::_print::ha066fa82ede9fd87
                               at src/libstd/sys_common/backtrace.rs:47
   3:          0x14e6952 - std::sys_common::backtrace::print::hed1589cd35280fb7
                               at src/libstd/sys_common/backtrace.rs:36
   4:          0x14e6952 - std::panicking::default_hook::{{closure}}::hd861923931ed9089
                               at src/libstd/panicking.rs:200
   5:          0x14e6636 - std::panicking::default_hook::h9b7b335db906b95d
                               at src/libstd/panicking.rs:214
   6:          0x14e70a5 - std::panicking::rust_panic_with_hook::h9ab61e4bfd455f53
                               at src/libstd/panicking.rs:477
   7:          0x14e6c42 - std::panicking::continue_panic_fmt::hd3ae5a0983e1ec4a
                               at src/libstd/panicking.rs:384
   8:          0x14e6b36 - rust_begin_unwind
                               at src/libstd/panicking.rs:311
   9:          0x150ca7a - core::panicking::panic_fmt::hd549f33df856c689
                               at src/libcore/panicking.rs:85
  10:          0x150cb77 - core::result::unwrap_failed::haa0856db93fbf3af
                               at src/libcore/result.rs:1084
  11:           0x86b1e0 - core::result::Result<T,E>::unwrap::h031e020cf820b88c
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libcore/result.rs:852
  12:           0x8316d8 - <actix_connect::ssl::rustls::RustlsConnectorService<T,U> as actix_service::Service>::call::h8a3ba52545ef1fa8
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-connect-0.2.5/src/ssl/rustls.rs:100
  13:           0x8b692e - <actix_service::map_err::MapErr<A,F,E> as actix_service::Service>::call::h244bfec4a5cf2a92
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/map_err.rs:61
  14:           0x800f5e - <actix_service::map::Map<A,F,Response> as actix_service::Service>::call::h1adc0109b3d9b4f9
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/map.rs:60
  15:           0x8b5266 - <actix_service::boxed::ServiceWrapper<T> as actix_service::Service>::call::hf8d1132ca7f24f43
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/boxed.rs:144
  16:           0x8e6a01 - <alloc::boxed::Box<S> as actix_service::Service>::call::h3dfa124ade339f5d
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/lib.rs:369
  17:           0x8ebfed - <actix_service::and_then::AndThenFuture<A,B> as futures::future::Future>::poll::haebe3dc9620b3a7b
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/and_then.rs:102
  18:           0x9108cf - <actix_utils::timeout::TimeoutServiceResponse<T> as futures::future::Future>::poll::hba40e94254fff9be
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-utils-0.4.5/src/timeout.rs:161
  19:           0x8ba0be - <actix_service::map_err::MapErrFuture<A,F,E> as futures::future::Future>::poll::hc81cd47ae3702438
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/map_err.rs:93
  20:           0x8bb1d1 - <actix_http::client::pool::OpenConnection<F,Io> as futures::future::Future>::poll::h6b6b8d5e42479310
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-http-0.2.10/src/client/pool.rs:270
  21:           0x908fca - <futures::future::either::Either<A,B> as futures::future::Future>::poll::hf12abf2dcbcb01b0
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  22:           0x9087ca - <futures::future::either::Either<A,B> as futures::future::Future>::poll::h096a80bb52c3ff6f
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  23:           0x7c9e4a - <actix_http::client::connector::connect_impl::InnerConnectorResponseB<T,Io1,Io2> as futures::future::Future>::poll::h9bb0a671f7cee801
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-http-0.2.10/src/client/connector.rs:534
  24:           0x908d4a - <futures::future::either::Either<A,B> as futures::future::Future>::poll::hb60c170b92d0e97c
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  25:           0x9088ca - <futures::future::either::Either<A,B> as futures::future::Future>::poll::h2b08b5dfc258caba
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  26:           0x8ea422 - <futures::future::from_err::FromErr<A,E> as futures::future::Future>::poll::h05b9f9067cb7ec25
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/from_err.rs:29
  27:           0x8d95af - futures::future::chain::Chain<A,B,C>::poll::hf2c344d6a8ef4aa5
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:26
  28:           0x84af8e - <futures::future::and_then::AndThen<A,B,F> as futures::future::Future>::poll::h842a9f10643c9e36
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/and_then.rs:32
  29:           0x906922 - <futures::future::map::Map<A,F> as futures::future::Future>::poll::h686950db7a0e568e
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
  30:           0x8e6b20 - <alloc::boxed::Box<F> as futures::future::Future>::poll::he6fd8ca437c7fd76
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
  31:           0x8ec603 - <awc::sender::SendClientRequest as futures::future::Future>::poll::h7a335ade87b5e3c2
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/awc-0.2.7/src/sender.rs:82
  32:           0x4351da - <futures::future::map_err::MapErr<A,F> as futures::future::Future>::poll::h72182557316c9279
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map_err.rs:30
  33:           0x4300e1 - <futures::future::map::Map<A,F> as futures::future::Future>::poll::h263aa1f81508716b
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
  34:           0x4dd6e8 - <actix_web::handler::AsyncHandlerServiceResponse<T> as futures::future::Future>::poll::hf1edfd33209cc7d2
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-1.0.8/src/handler.rs:249
  35:           0x4de7c0 - <actix_web::handler::ExtractResponse<T,S> as futures::future::Future>::poll::h5d3ebc282448cc32
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-1.0.8/src/handler.rs:361
  36:           0x4e0220 - futures::future::chain::Chain<A,B,C>::poll::h1925403f4da92b97
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:26
  37:           0x4dbf1d - <futures::future::then::Then<A,B,F> as futures::future::Future>::poll::h18fed1d27521182e
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/then.rs:32
  38:           0x79dcf0 - <alloc::boxed::Box<F> as futures::future::Future>::poll::h7253149fb66b9f19
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
  39:           0x79619a - <futures::future::either::Either<A,B> as futures::future::Future>::poll::h5060d2a3d917dfdf
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  40:           0x79dcf0 - <alloc::boxed::Box<F> as futures::future::Future>::poll::h7253149fb66b9f19
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
  41:           0x79619a - <futures::future::either::Either<A,B> as futures::future::Future>::poll::h5060d2a3d917dfdf
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/either.rs:36
  42:           0x4d294b - actix_http::h1::dispatcher::InnerDispatcher<T,S,B,X,U>::poll_response::hbb7880595ac84800
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-http-0.2.10/src/h1/dispatcher.rs:381
  43:           0x4c4657 - <actix_http::h1::dispatcher::Dispatcher<T,S,B,X,U> as futures::future::Future>::poll::h35ca21642a64c6c7
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-http-0.2.10/src/h1/dispatcher.rs:727
  44:           0x4be597 - <actix_http::service::HttpServiceHandlerResponse<T,S,B,X,U> as futures::future::Future>::poll::h439913f08ef31d66
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-http-0.2.10/src/service.rs:464
  45:           0x42fd6b - <actix_service::map_err::MapErrFuture<A,F,E> as futures::future::Future>::poll::h8eba52320b99bbee
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/map_err.rs:93
  46:           0x485f28 - <actix_service::and_then::AndThenFuture<A,B> as futures::future::Future>::poll::h0e77d965810fd100
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-service-0.4.2/src/and_then.rs:96
  47:           0x4e0e32 - futures::future::chain::Chain<A,B,C>::poll::h6e1ad57049fed90e
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:26
  48:           0x4dbf46 - <futures::future::then::Then<A,B,F> as futures::future::Future>::poll::h93859fb36bc3aadc
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/then.rs:32
  49:           0x4b7b36 - <alloc::boxed::Box<F> as futures::future::Future>::poll::hb3a3ae21f8c15b2f
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
  50:           0xdb6058 - <alloc::boxed::Box<F> as futures::future::Future>::poll::h963e6ae22feeaa51
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
  51:           0xdbac04 - futures::task_impl::Spawn<T>::poll_future_notify::{{closure}}::h297563f5b373ac39
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
  52:           0xdbb1a4 - futures::task_impl::Spawn<T>::enter::{{closure}}::h42c258f3be180436
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
  53:           0xdc5514 - futures::task_impl::std::set::h6e12adcafc7abbc1
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/std/mod.rs:83
  54:           0xdbb0ff - futures::task_impl::Spawn<T>::enter::h878fd896e7f1c676
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
  55:           0xdba8e5 - futures::task_impl::Spawn<T>::poll_fn_notify::h5d72cbec9e6ba54e
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:291
  56:           0xdbab18 - futures::task_impl::Spawn<T>::poll_future_notify::h4535b8ea296cf39d
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
  57:           0xdcb5d7 - tokio_current_thread::scheduler::Scheduled<U>::tick::h4b64fc1ef04bd453
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/scheduler.rs:351
  58:           0xdcc2a4 - tokio_current_thread::scheduler::Scheduler<U>::tick::{{closure}}::hfc79c46169fe00d3
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/scheduler.rs:330
  59:           0xdc71b4 - tokio_current_thread::Borrow<U>::enter::{{closure}}::{{closure}}::h2dab440be4dc5a46
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:788
  60:           0xdc6b93 - tokio_current_thread::CurrentRunner::set_spawn::hdc705e415144b127
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:825
  61:           0xdc7088 - tokio_current_thread::Borrow<U>::enter::{{closure}}::h73b2126db847ae09
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:788
  62:           0xdb0838 - std::thread::local::LocalKey<T>::try_with::hd6aace9a5617dada
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:262
  63:           0xdadd58 - std::thread::local::LocalKey<T>::with::hba65eac1eb3cde7d
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:239
  64:           0xdc6d7e - tokio_current_thread::Borrow<U>::enter::heed68cf146e8bfd5
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:786
  65:           0xdcc1a6 - tokio_current_thread::scheduler::Scheduler<U>::tick::h25f256566955619e
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/scheduler.rs:330
  66:           0xdc742d - tokio_current_thread::Entered<P>::tick::hf7976717860d0ba1
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:612
  67:           0xdc7980 - tokio_current_thread::Entered<P>::block_on::h97bc414d24393e00
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-current-thread-0.1.6/src/lib.rs:502
  68:           0xdbbbde - actix_rt::runtime::Runtime::block_on::{{closure}}::hec5c602b940d208a
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:128
  69:           0xdbc1b1 - actix_rt::runtime::Runtime::enter::{{closure}}::{{closure}}::{{closure}}::{{closure}}::hbdc236d83ce41a02
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:168
  70:           0xde319d - tokio_executor::global::with_default::{{closure}}::h69fdbe1499110400
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:209
  71:           0xdb0318 - std::thread::local::LocalKey<T>::try_with::h9a289e10fe88e4ee
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:262
  72:           0xdad83c - std::thread::local::LocalKey<T>::with::h547a23ab6fdb590b
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:239
  73:           0xde3062 - tokio_executor::global::with_default::hfa3b9d2777d9dc7a
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:178
  74:           0xdbc3de - actix_rt::runtime::Runtime::enter::{{closure}}::{{closure}}::{{closure}}::hc776cd59025edf48
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:166
  75:           0xdd47d2 - tokio_timer::timer::handle::with_default::{{closure}}::hb17f316a8924784d
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.11/src/timer/handle.rs:101
  76:           0xdae548 - std::thread::local::LocalKey<T>::try_with::h099fac83787588be
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:262
  77:           0xdad73c - std::thread::local::LocalKey<T>::with::h4df2963c0c9d86ec
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:239
  78:           0xdd3f95 - tokio_timer::timer::handle::with_default::h7773d178fbc343c8
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.11/src/timer/handle.rs:84
  79:           0xdbc569 - actix_rt::runtime::Runtime::enter::{{closure}}::{{closure}}::h9f06767876690b5c
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:159
  80:           0xdaa318 - tokio_timer::clock::clock::with_default::{{closure}}::h720b3d8750b410f6
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.11/src/clock/clock.rs:137
  81:           0xdaeec4 - std::thread::local::LocalKey<T>::try_with::h2cf4ccffbe4faf75
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:262
  82:           0xdad5ad - std::thread::local::LocalKey<T>::with::h30cac76df5a9ff8c
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:239
  83:           0xda9ffe - tokio_timer::clock::clock::with_default::hae6b31e02e766c7b
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.11/src/clock/clock.rs:117
  84:           0xdbc60d - actix_rt::runtime::Runtime::enter::{{closure}}::h34cc78a37498d1fb
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:158
  85:           0xdd4cbf - tokio_reactor::with_default::{{closure}}::h00910751dcf03322
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.10/src/lib.rs:237
  86:           0xdb09c4 - std::thread::local::LocalKey<T>::try_with::hd8e19bac2fa83819
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:262
  87:           0xdad7bd - std::thread::local::LocalKey<T>::with::h4e319e7059abb380
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/local.rs:239
  88:           0xdd4a98 - tokio_reactor::with_default::hae0eb15589bf0fb0
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.10/src/lib.rs:217
  89:           0xdbbd0c - actix_rt::runtime::Runtime::enter::h3cc288abb674bd32
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:157
  90:           0xdbba08 - actix_rt::runtime::Runtime::block_on::h5c9158a7a069e9f1
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/runtime.rs:126
  91:           0xddbf93 - actix_rt::arbiter::Arbiter::new::{{closure}}::h608762cb554dee26
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-0.2.5/src/arbiter.rs:113
  92:           0xdc8d35 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd39392a9b098cc23
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/sys_common/backtrace.rs:77
  93:           0xdbea41 - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h21fd417bea5cdb08
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/mod.rs:470
  94:           0xdb0e64 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h97c648887094eeb7
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/panic.rs:315
  95:           0xde3c8e - std::panicking::try::do_call::h202a11e8e863fd25
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/panicking.rs:296
  96:          0x14ea53a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  97:           0xde3af0 - std::panicking::try::he2207e60ab1cb385
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/panicking.rs:275
  98:           0xdb1456 - std::panic::catch_unwind::hd61d56eddbf98268
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/panic.rs:394
  99:           0xdbe832 - std::thread::Builder::spawn_unchecked::{{closure}}::h6b8013461217867c
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libstd/thread/mod.rs:469
  100:           0xdbebd4 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h5abf8bbc2752c5c2
                               at /rustc/760226733e940cb375f791e894fbb554555eeb01/src/libcore/ops/function.rs:235
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic in Arbiter thread, shutting down system.

I also tested it in VMs (parallels and VirtualBox) on Linux and Mac hosts. It always results in this exact failure.

The command was curl --http1.1 -v -k http://localhost:8080. Port 8080 is the exposed reverse proxy. It turns out that enabling TLS makes a big difference in the web server and it doesn't crash at all if the reverse proxy connects to the web server via plain HTTP.

curl reverse proxy web server TLS enabled crashes
on host on host on host yes no
on host on host on host no no
on host in Docker on host yes yes
on host in Docker on host no no
on host in VM on host yes yes
on host in VM on host no no

Having just the web server run in Docker is just fine, whether TLS is enabled or not. The command used was just curl --http1.1 localhost:8080 where 8080 is the port exposed by Docker for the web server.

curl web server TLS enabled crashes
on host on host yes no
on host in Docker yes no
on host on host no no
on host in Docker no no

So it only crashes if connecting to a TLS web server on the host through a virtual interface. I don't really know what to make of this.

The reverse proxy is here: https://github.com/svenstaro/proxyboi/ and the relevant code is around htis part: https://github.com/svenstaro/proxyboi/blob/3c58ace975a06f13b3e4e34b0724161dc3b401b3/src/main.rs#L103
It's very similar to the actix-web reverse proxy example but with added stuff for allowing invalid TLS certificates.

I'll try to create a minimal code example. However, maybe the info supplied is already useful to somebody somehow.

@fafhrd91
Copy link
Member

fafhrd91 commented Oct 3, 2019

this code panics DNSNameRef::try_from_ascii_str(stream.host()).unwrap()

we should remove unwrap()

@svenstaro
Copy link
Contributor Author

Relevant actual issue when using IPs instead of hostnames is here: briansmith/webpki#54

@fafhrd91
Copy link
Member

fafhrd91 commented Oct 3, 2019

in any case we must fix this .unwrap

@svenstaro
Copy link
Contributor Author

I made a cheap PR. Perhaps the proper way to do this is using error propagation but it kind of is a programming error at this stage. I'll let you decide. It's a better situation than unwrap at any rate.
By the way, this is how another project fixed this problem: databricks/click#110 It's not ideal 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants