tokio-rs / axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
19.22k stars 1.06k forks source link

Fallback panics on CONNECT requests #1955

Closed Power2All closed 1 year ago

Power2All commented 1 year ago

Bug Report

Version

├── axum v0.6.16
│   ├── async-trait v0.1.68 (proc-macro) (*)
│   ├── axum-core v0.3.4
│   │   ├── async-trait v0.1.68 (proc-macro) (*)
│   │   ├── bytes v1.4.0
│   │   ├── futures-util v0.3.28
│   │   │   ├── futures-channel v0.3.28
│   │   │   │   ├── futures-core v0.3.28
│   │   │   │   └── futures-sink v0.3.28
│   │   │   ├── futures-core v0.3.28
│   │   │   ├── futures-io v0.3.28
│   │   │   ├── futures-macro v0.3.28 (proc-macro)
│   │   │   │   ├── proc-macro2 v1.0.56 (*)
│   │   │   │   ├── quote v1.0.26 (*)
│   │   │   │   └── syn v2.0.15 (*)
│   │   │   ├── futures-sink v0.3.28
│   │   │   ├── futures-task v0.3.28
│   │   │   ├── memchr v2.5.0
│   │   │   ├── pin-project-lite v0.2.9
│   │   │   ├── pin-utils v0.1.0
│   │   │   └── slab v0.4.8 (*)
│   │   ├── http v0.2.9
│   │   │   ├── bytes v1.4.0
│   │   │   ├── fnv v1.0.7
│   │   │   └── itoa v1.0.6
│   │   ├── http-body v0.4.5
│   │   │   ├── bytes v1.4.0
│   │   │   ├── http v0.2.9 (*)
│   │   │   └── pin-project-lite v0.2.9
│   │   ├── mime v0.3.17
│   │   ├── tower-layer v0.3.2
│   │   └── tower-service v0.3.2
│   │   [build-dependencies]
│   │   └── rustversion v1.0.12 (proc-macro)
│   ├── bitflags v1.3.2
│   ├── bytes v1.4.0
│   ├── futures-util v0.3.28 (*)
│   ├── http v0.2.9 (*)
│   ├── http-body v0.4.5 (*)
│   ├── hyper v0.14.26
│   │   ├── bytes v1.4.0
│   │   ├── futures-channel v0.3.28 (*)
│   │   ├── futures-core v0.3.28
│   │   ├── futures-util v0.3.28 (*)
│   │   ├── h2 v0.3.18
│   │   │   ├── bytes v1.4.0
│   │   │   ├── fnv v1.0.7
│   │   │   ├── futures-core v0.3.28
│   │   │   ├── futures-sink v0.3.28
│   │   │   ├── futures-util v0.3.28 (*)
│   │   │   ├── http v0.2.9 (*)
│   │   │   ├── indexmap v1.9.3
│   │   │   │   └── hashbrown v0.12.3
│   │   │   │       └── ahash v0.7.6
│   │   │   │           ├── getrandom v0.2.9
│   │   │   │           │   ├── cfg-if v1.0.0
│   │   │   │           │   └── libc v0.2.142
│   │   │   │           └── once_cell v1.17.1
│   │   │   │           [build-dependencies]
│   │   │   │           └── version_check v0.9.4
│   │   │   │   [build-dependencies]
│   │   │   │   └── autocfg v1.1.0
│   │   │   ├── slab v0.4.8 (*)
│   │   │   ├── tokio v1.27.0
│   │   │   │   ├── bytes v1.4.0
│   │   │   │   ├── libc v0.2.142
│   │   │   │   ├── mio v0.8.6
│   │   │   │   │   ├── libc v0.2.142
│   │   │   │   │   └── log v0.4.17 (*)
│   │   │   │   ├── num_cpus v1.15.0
│   │   │   │   │   └── libc v0.2.142
│   │   │   │   ├── parking_lot v0.12.1
│   │   │   │   │   ├── lock_api v0.4.9
│   │   │   │   │   │   └── scopeguard v1.1.0
│   │   │   │   │   │   [build-dependencies]
│   │   │   │   │   │   └── autocfg v1.1.0
│   │   │   │   │   └── parking_lot_core v0.9.7
│   │   │   │   │       ├── cfg-if v1.0.0
│   │   │   │   │       ├── libc v0.2.142
│   │   │   │   │       └── smallvec v1.10.0
│   │   │   │   ├── pin-project-lite v0.2.9
│   │   │   │   ├── signal-hook-registry v1.4.1
│   │   │   │   │   └── libc v0.2.142
│   │   │   │   ├── socket2 v0.4.9 (*)
│   │   │   │   └── tokio-macros v2.0.0 (proc-macro)
│   │   │   │       ├── proc-macro2 v1.0.56 (*)
│   │   │   │       ├── quote v1.0.26 (*)
│   │   │   │       └── syn v2.0.15 (*)
│   │   │   │   [build-dependencies]
│   │   │   │   └── autocfg v1.1.0
│   │   │   ├── tokio-util v0.7.7
│   │   │   │   ├── bytes v1.4.0
│   │   │   │   ├── futures-core v0.3.28
│   │   │   │   ├── futures-sink v0.3.28
│   │   │   │   ├── pin-project-lite v0.2.9
│   │   │   │   ├── tokio v1.27.0 (*)
│   │   │   │   └── tracing v0.1.37
│   │   │   │       ├── cfg-if v1.0.0
│   │   │   │       ├── log v0.4.17 (*)
│   │   │   │       ├── pin-project-lite v0.2.9
│   │   │   │       └── tracing-core v0.1.30
│   │   │   │           └── once_cell v1.17.1
│   │   │   └── tracing v0.1.37 (*)
│   │   ├── http v0.2.9 (*)
│   │   ├── http-body v0.4.5 (*)
│   │   ├── httparse v1.8.0
│   │   ├── httpdate v1.0.2
│   │   ├── itoa v1.0.6
│   │   ├── pin-project-lite v0.2.9
│   │   ├── socket2 v0.4.9 (*)
│   │   ├── tokio v1.27.0 (*)
│   │   ├── tower-service v0.3.2
│   │   ├── tracing v0.1.37 (*)
│   │   └── want v0.3.0
│   │       ├── log v0.4.17 (*)
│   │       └── try-lock v0.2.4
│   ├── itoa v1.0.6
│   ├── matchit v0.7.0
│   ├── memchr v2.5.0
│   ├── mime v0.3.17
│   ├── percent-encoding v2.2.0
│   ├── pin-project-lite v0.2.9
│   ├── serde v1.0.160
│   │   └── serde_derive v1.0.160 (proc-macro)
│   │       ├── proc-macro2 v1.0.56 (*)
│   │       ├── quote v1.0.26 (*)
│   │       └── syn v2.0.15 (*)
│   ├── serde_json v1.0.96
│   │   ├── itoa v1.0.6
│   │   ├── ryu v1.0.13
│   │   └── serde v1.0.160 (*)
│   ├── serde_path_to_error v0.1.11
│   │   └── serde v1.0.160 (*)
│   ├── serde_urlencoded v0.7.1
│   │   ├── form_urlencoded v1.1.0
│   │   │   └── percent-encoding v2.2.0
│   │   ├── itoa v1.0.6
│   │   ├── ryu v1.0.13
│   │   └── serde v1.0.160 (*)
│   ├── sync_wrapper v0.1.2
│   ├── tokio v1.27.0 (*)
│   ├── tower v0.4.13
│   │   ├── futures-core v0.3.28
│   │   ├── futures-util v0.3.28 (*)
│   │   ├── pin-project v1.0.12
│   │   │   └── pin-project-internal v1.0.12 (proc-macro)
│   │   │       ├── proc-macro2 v1.0.56 (*)
│   │   │       ├── quote v1.0.26 (*)
│   │   │       └── syn v1.0.109 (*)
│   │   ├── pin-project-lite v0.2.9
│   │   ├── tokio v1.27.0 (*)
│   │   ├── tower-layer v0.3.2
│   │   ├── tower-service v0.3.2
│   │   └── tracing v0.1.37 (*)
│   ├── tower-layer v0.3.2
│   └── tower-service v0.3.2
│   [build-dependencies]
│   └── rustversion v1.0.12 (proc-macro)
├── axum-client-ip v0.4.0
│   ├── axum v0.6.16 (*)
│   ├── forwarded-header-value v0.1.1
│   │   ├── nonempty v0.7.0
│   │   └── thiserror v1.0.40
│   │       └── thiserror-impl v1.0.40 (proc-macro)
│   │           ├── proc-macro2 v1.0.56 (*)
│   │           ├── quote v1.0.26 (*)
│   │           └── syn v2.0.15 (*)
│   └── serde v1.0.160 (*)
├── axum-server v0.4.7
│   ├── arc-swap v1.6.0
│   ├── bytes v1.4.0
│   ├── futures-util v0.3.28 (*)
│   ├── http v0.2.9 (*)
│   ├── http-body v0.4.5 (*)
│   ├── hyper v0.14.26 (*)
│   ├── pin-project-lite v0.2.9
│   ├── rustls v0.20.8
│   │   ├── log v0.4.17 (*)
│   │   ├── ring v0.16.20
│   │   │   ├── libc v0.2.142
│   │   │   ├── once_cell v1.17.1
│   │   │   ├── spin v0.5.2
│   │   │   └── untrusted v0.7.1
│   │   │   [build-dependencies]
│   │   │   └── cc v1.0.79
│   │   ├── sct v0.7.0
│   │   │   ├── ring v0.16.20 (*)
│   │   │   └── untrusted v0.7.1
│   │   └── webpki v0.22.0
│   │       ├── ring v0.16.20 (*)
│   │       └── untrusted v0.7.1
│   ├── rustls-pemfile v1.0.2
│   │   └── base64 v0.21.0
│   ├── tokio v1.27.0 (*)
│   ├── tokio-rustls v0.23.4
│   │   ├── rustls v0.20.8 (*)
│   │   ├── tokio v1.27.0 (*)
│   │   └── webpki v0.22.0 (*)
│   └── tower-service v0.3.2

Platform

Ubuntu 22.04

Description

There is a bug it seems in the Axum code of 0.6.16 where it reaches unreachable code, and panic errors.

thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:312:45

I tried to cleanup the registry and re-download and re-compile the code, but it still happens. Going to downgrade it a minor version, and see if it happens on former versions. Will report and edit this post if I got any.

davidpdrsn commented 1 year ago

Can you provide a reproduction script? Not much we can do when you don't post any code.

Power2All commented 1 year ago

@davidpdrsn I'm not sure, since it's not my code giving the error. However, you can look into the project itself using it: https://github.com/Power2All/torrust-axum/tree/v3.2.0 You can find the downgrade push there as well.

davidpdrsn commented 1 year ago

I'm not sure, since it's not my code giving the error.

But you're using axum and hitting this error. I need to see how you manage to do that.

you can look into the project itself using it:

That's a big project. Do you have a smaller reproduction?

Power2All commented 1 year ago

This is the exact trace:

thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:312:45
stack backtrace:
   0:     0x5630823924b0 - std::backtrace_rs::backtrace::libunwind::trace::h1d00f3fcf4cb5ac4
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5630823924b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h920a6ff332484ee2
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5630823924b0 - std::sys_common::backtrace::_print_fmt::hd7323920c925af6d
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5630823924b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3155a8c966b4beb5
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5630823b599e - core::fmt::write::h062c617411b691df
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/fmt/mod.rs:1209:17
   5:     0x56308238cc85 - std::io::Write::write_fmt::hb61fdf1275c61e1c
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/io/mod.rs:1682:15
   6:     0x563082392275 - std::sys_common::backtrace::_print::hd1b4d9664ab500e0
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x563082392275 - std::sys_common::backtrace::print::hca896ae22beb06cb
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5630823939af - std::panicking::default_hook::{{closure}}::h0b5eeed5cf36ab5f
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:267:22
   9:     0x5630823936ea - std::panicking::default_hook::h8932b573145a321b
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:286:9
  10:     0x5630823940a8 - std::panicking::rust_panic_with_hook::h4b1447a24e3e94f8
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:688:13
  11:     0x563082393e01 - std::panicking::begin_panic_handler::{{closure}}::h8701da9995a3820c
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:577:13
  12:     0x56308239295c - std::sys_common::backtrace::__rust_end_short_backtrace::hb696c5ed02a01598
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x563082393b62 - rust_begin_unwind
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:575:5
  14:     0x563081075db3 - core::panicking::panic_fmt::h8aa706a976963c88
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panicking.rs:65:14
  15:     0x563081075e8d - core::panicking::panic::h622b2a38bce78ff3
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panicking.rs:115:5
  16:     0x5630811f8145 - axum::routing::Router<S,B>::call_with_state::{{closure}}::h77b33fa8ad3eb589
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:312:45
  17:     0x5630810d19f3 - core::result::Result<T,E>::unwrap_or_else::h976ca9f7cfba6407
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/result.rs:1504:23
  18:     0x5630811f8010 - axum::routing::Router<S,B>::call_with_state::h95a5b79a8f4effb3
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:310:28
  19:     0x5630811f782c - <axum::routing::Router<(),B> as tower_service::Service<http::request::Request<B>>>::call::h3b238e57dff5f69d
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:386:9
  20:     0x5630811c4029 - <axum::extension::AddExtension<S,T> as tower_service::Service<http::request::Request<ResBody>>>::call::h6cf5efa8b9ed8552
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/extension.rs:166:9
  21:     0x5630811c41fc - <T as hyper::service::http::HttpService<B1>>::call::hb42a57ecac819e28
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/service/http.rs:45:9
  22:     0x5630814875be - <hyper::proto::h1::dispatch::Server<S,hyper::body::body::Body> as hyper::proto::h1::dispatch::Dispatch>::recv_msg::h2976e42537ea45b0
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:517:23
  23:     0x5630814936fe - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_read_head::h201e74229461f7bf
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:264:17
  24:     0x56308149a3b1 - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_read::ha87b832ff5ec43f2
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:188:24
  25:     0x56308149761f - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop::hd9164b52083ea731
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:160:21
  26:     0x563081489d7f - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_inner::hc7d80b3bf53fb206
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:137:16
  27:     0x563081488128 - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_catch::he046e90d01513b43
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:120:28
  28:     0x5630814857a5 - <hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T> as core::future::future::Future>::poll::h73af4fe1e4dc83da
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/proto/h1/dispatch.rs:424:9
  29:     0x5630810c9972 - <hyper::server::conn::ProtoServer<T,B,S,E> as core::future::future::Future>::poll::h76ab7a8928c0696e
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/server/conn.rs:986:47
  30:     0x5630811c1aae - <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll::h71c2c488ee9640cc
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.26/src/server/conn.rs:1046:30
  31:     0x5630811c2b58 - <&mut F as core::future::future::Future>::poll::he3be0f7a6c4054a7
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/future/future.rs:112:9
  32:     0x563081310ef8 - axum_server::server::Server<A>::serve::{{closure}}::{{closure}}::{{closure}}::{{closure}}::hf50f0f7da768dfbe
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/macros/select.rs:524:49
  33:     0x5630810c709b - <tokio::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::hc7ba027b03b3ca0a
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/future/poll_fn.rs:58:9
  34:     0x56308130dcc1 - axum_server::server::Server<A>::serve::{{closure}}::{{closure}}::{{closure}}::h4bb061434d5895bf
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-server-0.4.7/src/server.rs:203:25
  35:     0x563081107f1c - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h94e5a19c169044e7
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/future/mod.rs:91:19
  36:     0x56308134c65f - <core::pin::Pin<P> as core::future::future::Future>::poll::hd4638f427352e465
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/future/future.rs:124:9
  37:     0x5630814c63b4 - tokio::runtime::task::core::Core<T,S>::poll::{{closure}}::h450569605c23fbb6
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/core.rs:223:17
  38:     0x5630811ca7df - tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::h02b6fd8f3b5f70c6
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/loom/std/unsafe_cell.rs:14:9
  39:     0x5630814c3aeb - tokio::runtime::task::core::Core<T,S>::poll::h7ab3be4d9cbe9cef
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/core.rs:212:13
  40:     0x5630813ae091 - tokio::runtime::task::harness::poll_future::{{closure}}::h3f5760aad4f02052
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:476:19
  41:     0x56308117ac43 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h63456b7b3867a51b
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panic/unwind_safe.rs:271:9
  42:     0x56308138da9d - std::panicking::try::do_call::h16091659658fe641
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:483:40
  43:     0x56308139efbb - __rust_try
  44:     0x563081384875 - std::panicking::try::h44431320b48fd674
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:447:19
  45:     0x56308115f44a - std::panic::catch_unwind::ha2c5da90e1be82be
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panic.rs:137:14
  46:     0x5630813a36d6 - tokio::runtime::task::harness::poll_future::h146f249370965dc1
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:464:18
  47:     0x5630813b4e42 - tokio::runtime::task::harness::Harness<T,S>::poll_inner::hc23bbea3b1fd33d8
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:198:27
  48:     0x5630813c03a3 - tokio::runtime::task::harness::Harness<T,S>::poll::h6d3042f42ebabbe5
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:152:15
  49:     0x5630813e0de0 - tokio::runtime::task::raw::poll::h4f6bb32b259ab813
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/raw.rs:255:5
  50:     0x5630822e713f - tokio::runtime::task::raw::RawTask::poll::h7ace252fa3009624
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/raw.rs:200:18
  51:     0x5630822f11b2 - tokio::runtime::task::LocalNotified<S>::run::h296e38a4047a37bd
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/mod.rs:394:9
  52:     0x56308227e0fc - tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}::hab6ca858c684494f
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:464:13
  53:     0x56308227df8c - tokio::runtime::coop::with_budget::hf3ddf9b6583b093f
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/coop.rs:107:5
  54:     0x56308227df8c - tokio::runtime::coop::budget::h07f1a520b6caa95f
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/coop.rs:73:5
  55:     0x56308227df8c - tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h6c95e04f68df5796
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:463:9
  56:     0x56308227d686 - tokio::runtime::scheduler::multi_thread::worker::Context::run::h78e122b772e256e8
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:426:24
  57:     0x56308227d44d - tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}::h1c05d906fefce8a9
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:406:17
  58:     0x56308227ae92 - tokio::macros::scoped_tls::ScopedKey<T>::set::hc55fc41e17532e17
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/macros/scoped_tls.rs:61:9
  59:     0x56308227d2b7 - tokio::runtime::scheduler::multi_thread::worker::run::h60e9f0136a062885
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:403:5
  60:     0x56308227d05b - tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}::heffb7d2255a39e4f
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/scheduler/multi_thread/worker.rs:365:45
  61:     0x5630822f1853 - <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h4662eda56d064cfc
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/blocking/task.rs:42:21
  62:     0x5630822eef47 - tokio::runtime::task::core::Core<T,S>::poll::{{closure}}::ha24388f4b4e10854
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/core.rs:223:17
  63:     0x5630822639af - tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::hf05d1facdacf1a15
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/loom/std/unsafe_cell.rs:14:9
  64:     0x5630822ee8dc - tokio::runtime::task::core::Core<T,S>::poll::h9f7910fb883126f4
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/core.rs:212:13
  65:     0x5630822ac4b5 - tokio::runtime::task::harness::poll_future::{{closure}}::h904e905d316895d8
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:476:19
  66:     0x5630822dd9b3 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h78f5c40a18d89f03
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panic/unwind_safe.rs:271:9
  67:     0x563082302d2e - std::panicking::try::do_call::h064940e9285f83b7
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:483:40
  68:     0x5630823049fb - __rust_try
  69:     0x563082301bf5 - std::panicking::try::h2ae25752b4f8fd1e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:447:19
  70:     0x56308228e9cb - std::panic::catch_unwind::ha301fedf94e5cdba
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panic.rs:137:14
  71:     0x5630822aba67 - tokio::runtime::task::harness::poll_future::h44bcbaec0ce31d42
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:464:18
  72:     0x5630822a934c - tokio::runtime::task::harness::Harness<T,S>::poll_inner::ha1d5c572531e1fa2
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:198:27
  73:     0x5630822a8f44 - tokio::runtime::task::harness::Harness<T,S>::poll::h700145379b47c6ad
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/harness.rs:152:15
  74:     0x5630822e72d2 - tokio::runtime::task::raw::poll::h506c9406ee7e54d5
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/raw.rs:255:5
  75:     0x5630822e713f - tokio::runtime::task::raw::RawTask::poll::h7ace252fa3009624
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/raw.rs:200:18
  76:     0x5630822f1274 - tokio::runtime::task::UnownedTask<S>::run::hcf62e1dffecd22a3
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/task/mod.rs:431:9
  77:     0x563082281017 - tokio::runtime::blocking::pool::Task::run::h263e0f13e794f41d
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/blocking/pool.rs:159:9
  78:     0x563082284a68 - tokio::runtime::blocking::pool::Inner::run::hbfb4da40061007b4
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/blocking/pool.rs:513:17
  79:     0x563082283f44 - tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}::haf2459155a2db665
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/blocking/pool.rs:471:13
  80:     0x5630822b92b1 - std::sys_common::backtrace::__rust_begin_short_backtrace::h917ba926e1a6eac2
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:121:18
  81:     0x563082287762 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::he9bdeb9c73b58f42
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/thread/mod.rs:551:17
  82:     0x5630822dda22 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h82ee443fb94850d8
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panic/unwind_safe.rs:271:9
  83:     0x5630823030e2 - std::panicking::try::do_call::h2eef2d6375e946a5
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:483:40
  84:     0x5630823049fb - __rust_try
  85:     0x563082302a6f - std::panicking::try::hf2ce844daf537d3e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:447:19
  86:     0x56308228e832 - std::panic::catch_unwind::h719c2b8e1fc9994c
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panic.rs:137:14
  87:     0x563082287558 - std::thread::Builder::spawn_unchecked_::{{closure}}::h9033da3e933c0a2e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/thread/mod.rs:550:30
  88:     0x5630822b978f - core::ops::function::FnOnce::call_once{{vtable.shim}}::h07e706c078f8fea5
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/ops/function.rs:251:5
  89:     0x563082396dd3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6202d10b0224e7b0
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/alloc/src/boxed.rs:1987:9
  90:     0x563082396dd3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4dbea73c9cec160b
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/alloc/src/boxed.rs:1987:9
  91:     0x563082396dd3 - std::sys::unix::thread::Thread::new::thread_start::h0a2f4c32ba2f2278
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys/unix/thread.rs:108:17
  92:     0x7f81620eab43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  93:     0x7f816217ca00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  94:                0x0 - <unknown>

[Edit] Put the debug tracelog, this should say a bit more.

Power2All commented 1 year ago

Update: Tested until v0.6.12 and that looks to be stable. v0.6.13 showed a ton of debugging messages, so I didn't try use that to see if it crashed. Since v0.6.13+ the code became unstable and crashes with the previous post with tracelog data. Please investigate, as this doesn't seem to be related to my own code.

davidpdrsn commented 1 year ago

Please investigate, as this doesn't seem to be related to my own code.

It's a bug in axum sure, but I need a way to reproduce the bug. You gotta help me help you by providing a way to reproduce it.

Power2All commented 1 year ago

Please investigate, as this doesn't seem to be related to my own code.

It's a bug in axum sure, but I need a way to reproduce the bug. You gotta help me help you by providing a way to reproduce it.

I'm not sure how to. It happens when I activate the app, since I deal with thousands of request per second, it hits this error eventually. What would you like me to test or how ?

davidpdrsn commented 1 year ago

I'm not sure what you expect me to do. Do you want me to run your app and randomly send it requests until I hit the bug? Sorry but I can't do that.

Without a way to reproduce it how can I know if my changes to axum have actually fixed it?

Power2All commented 1 year ago
  • Log the request that causes the panic

    • Send that request yourself and see you can repro the panic consistently

    • Then reproduce that with a smaller amount of code until you find a minimal way to reproduce it

I'm not sure what you expect me to do. Do you want me to run your app and randomly send it requests until I hit the bug? Sorry but I can't do that.

Without a way to reproduce it how can I know if my changes to axum have actually fixed it?

I'll see what I can do. As I said, I get a ton of connection requests on the server, so trying to catch that single request is going to take some time, since my Rust is not nearly close to being "good", since I've been learning Rust after GoLang was failing on me.

davidpdrsn commented 1 year ago

I've tried making a test with all the routes your app has:

#[tokio::test]
async fn foobar() {
    async fn handler() {}

    let app = Router::new()
        .route("/webgui/*path", get(handler))
        .route("/api/stats", get(handler))
        .route("/api/torrent/:info_hash", get(handler).delete(handler))
        .route("/api/torrents", get(handler))
        .route("/api/whitelist", get(handler))
        .route("/api/whitelist/reload", get(handler))
        .route(
            "/api/whitelist/:info_hash",
            get(handler).post(handler).delete(handler),
        )
        .route("/api/blacklist", get(handler))
        .route("/api/blacklist/reload", get(handler))
        .route(
            "/api/blacklist/:info_hash",
            get(handler).post(handler).delete(handler),
        )
        .route("/api/keys", get(handler))
        .route("/api/keys/reload", get(handler))
        .route("/api/keys/:key", get(handler).delete(handler))
        .route(
            "/api/keys/:key/:seconds_valid",
            post(handler).patch(handler),
        )
        .route("/api/maintenance/enable", get(handler))
        .route("/api/maintenance/disable", get(handler))
        .route("/announce", get(handler))
        .route("/announce/:key", get(handler))
        .route("/scrape", get(handler))
        .route("/scrape/:key", get(handler))
        // doesn't matter if we leave this on or not
        .fallback(|| async {});

    let client = TestClient::new(app);

    client.get("/foo").send().await;
}

but that doesn't hit it. It's got something to do with fallbacks so maybe it's a request for an unmatched route.

I would also have guessed nesting was involved but you don't use Router::nest it seems 🤔

Power2All commented 1 year ago

I'm about to leave Turkey (holiday), will try and add a request logger to determine what request might possibly do this later at home.

Power2All commented 1 year ago

@davidpdrsn Do you know how I could simply apply a "access.log" kind of logger to Axum? As I said, my Rust knowledge is not that high yet, and I'm still learning good practices, so I wondered if you could show me or tell me how I could simply can add a Apache like logging method to Axum, so I can start logging this to a file until it crashes, thus we know which request does the panic error. Do know, it will write away, a lot, since it gets roughly a ton of connections per second, to give you a hint: 345.025 connections in a minute. So far with version v0.6.12 the software is rock stable.

davidpdrsn commented 1 year ago

Hm I just realized that since the panic happens inside axum during routing, and middleware run after routing, its not as simple as I would have thought 🤔 I'll work on it today and try and come up with an example for you.

This code path is going away in the next major version of axum (https://github.com/tokio-rs/axum/pull/1956) so won't be problem then (but we should still fix it of course)

davidpdrsn commented 1 year ago

This seems to work:

// Cargo.toml:
//
// ```toml
// [dependencies]
// axum = "0.6"
// tokio = { version = "1.0", features = ["full"] }
// tracing = "0.1"
// tracing-subscriber = { version = "0.3", features = ["env-filter"] }
// futures = "0.3"

// # required because of tracing-subscriber bug
// regex = { version = "1", features = ["unicode-case"] }
// ```

use axum::{
    http::{HeaderMap, Method, Request, StatusCode, Uri},
    middleware::{from_fn, Next},
    response::{IntoResponse, Response},
    routing::{get, MethodRouter},
    Router,
};
use futures::FutureExt;
use std::{
    any::Any,
    net::SocketAddr,
    panic::{catch_unwind, AssertUnwindSafe},
};

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt::init();

    let app = Router::new().route("/", get(|| async { "OK" }));

    // we have to apply the middleware around the whole router
    // because middleware run after routing, so if a panic happens during routing
    // middleware normally wont see them
    let app_with_panic_logging: MethodRouter =
        axum::routing::any_service(app).layer(from_fn(log_panic));

    let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
    tracing::debug!("listening on {}", addr);
    axum::Server::bind(&addr)
        .serve(app_with_panic_logging.into_make_service())
        .await
        .unwrap();
}

async fn log_panic<B>(request: Request<B>, next: Next<B>) -> Response {
    let method = request.method().clone();
    let uri = request.uri().clone();
    let headers = request.headers().clone();

    let future = match catch_unwind(AssertUnwindSafe(|| next.run(request))) {
        Ok(future) => future,
        Err(err) => {
            return handle_panic(&method, &uri, &headers, err);
        }
    };

    match AssertUnwindSafe(future).catch_unwind().await {
        Ok(response) => response,
        Err(err) => handle_panic(&method, &uri, &headers, err),
    }
}

fn handle_panic(
    method: &Method,
    uri: &Uri,
    headers: &HeaderMap,
    err: Box<dyn Any + Send>,
) -> Response {
    let details = if let Some(s) = err.downcast_ref::<String>() {
        s.clone()
    } else if let Some(s) = err.downcast_ref::<&str>() {
        s.to_string()
    } else {
        "Unknown panic message".to_string()
    };

    tracing::error!(details, ?method, ?uri, ?headers, "request panicked");

    StatusCode::INTERNAL_SERVER_ERROR.into_response()
}
Power2All commented 1 year ago

This seems to work:

// Cargo.toml:
//
// ```toml
// [dependencies]
// axum = "0.6"
// tokio = { version = "1.0", features = ["full"] }
// tracing = "0.1"
// tracing-subscriber = { version = "0.3", features = ["env-filter"] }
// futures = "0.3"

// # required because of tracing-subscriber bug
// regex = { version = "1", features = ["unicode-case"] }
// ```

use axum::{
    http::{HeaderMap, Method, Request, StatusCode, Uri},
    middleware::{from_fn, Next},
    response::{IntoResponse, Response},
    routing::{get, MethodRouter},
    Router,
};
use futures::FutureExt;
use std::{
    any::Any,
    net::SocketAddr,
    panic::{catch_unwind, AssertUnwindSafe},
};

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt::init();

    let app = Router::new().route("/", get(|| async { "OK" }));

    // we have to apply the middleware around the whole router
    // because middleware run after routing, so if a panic happens during routing
    // middleware normally wont see them
    let app_with_panic_logging: MethodRouter =
        axum::routing::any_service(app).layer(from_fn(log_panic));

    let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
    tracing::debug!("listening on {}", addr);
    axum::Server::bind(&addr)
        .serve(app_with_panic_logging.into_make_service())
        .await
        .unwrap();
}

async fn log_panic<B>(request: Request<B>, next: Next<B>) -> Response {
    let method = request.method().clone();
    let uri = request.uri().clone();
    let headers = request.headers().clone();

    let future = match catch_unwind(AssertUnwindSafe(|| next.run(request))) {
        Ok(future) => future,
        Err(err) => {
            return handle_panic(&method, &uri, &headers, err);
        }
    };

    match AssertUnwindSafe(future).catch_unwind().await {
        Ok(response) => response,
        Err(err) => handle_panic(&method, &uri, &headers, err),
    }
}

fn handle_panic(
    method: &Method,
    uri: &Uri,
    headers: &HeaderMap,
    err: Box<dyn Any + Send>,
) -> Response {
    let details = if let Some(s) = err.downcast_ref::<String>() {
        s.clone()
    } else if let Some(s) = err.downcast_ref::<&str>() {
        s.to_string()
    } else {
        "Unknown panic message".to_string()
    };

    tracing::error!(details, ?method, ?uri, ?headers, "request panicked");

    StatusCode::INTERNAL_SERVER_ERROR.into_response()
}

Alright, I'll try and implement it :)

Power2All commented 1 year ago

@davidpdrsn What should I do with this ? image

Nevermind, fixed ;)

Power2All commented 1 year ago

Another error I try to figure out: image

heh, also fixed after trying to move some stuff. Seems I got it working for the API software. Will now implement it for the main service, and then test it out on my live environment, and see if it trace panic errors on the latest version.

davidpdrsn commented 1 year ago

Great! Thanks :D

Power2All commented 1 year ago

Great! Thanks :D

Alright, I'm running it with the new code enabled now to stdout and stderr log files. If anything happens, it should be logged in those files, so I can share the output with you here.

Power2All commented 1 year ago

Sadly, no return data is given. Same error as before: thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:312:45 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

jplatte commented 1 year ago

Maybe add RUST_BACKTRACE=1 to the environment variables for your process as suggested by the error message? A backtrace could be helpful.

Power2All commented 1 year ago

Maybe add RUST_BACKTRACE=1 to the environment variables for your process as suggested by the error message? A backtrace could be helpful.

Running now with RUST_BACKTRACE=1 ./torrust-axum > stdout.log 2> stderr.log and see what it shows.

davidpdrsn commented 1 year ago

Sadly, no return data is given.

Do you mean that nothing gets logged? I guess you didn't configure the logging correctly. How did you do it?

Power2All commented 1 year ago

Sadly, no return data is given.

Do you mean that nothing gets logged? I guess you didn't configure the logging correctly. How did you do it?

https://github.com/Power2All/torrust-axum/commit/f0498ec62802a7f209774864a5fe0d233843f367

It wraps the route as you suggested, and then add the panic as well to the object.

davidpdrsn commented 1 year ago

Its not immediately obvious to me why its not working.

I pushed a commit (07cd3c8f4f281) that always panics in the router similarly to that real issue. Try to use that commit of axum instead:

axum = { git = "https://github.com/tokio-rs/axum", rev = "07cd3c8f4f281" }

Then you can debug your logging setup as it'll panic on all requests.

Obviously don't push this rev to production 😅

Power2All commented 1 year ago
https://github.com/tokio-rs/axum

image

What might be the case ? Something is unsatisfied, not sure why, using your git branch.

davidpdrsn commented 1 year ago

Sorry my bad. You need to use a patch:

# bottom of Cargo.toml
[patch.crates-io]
axum = { git = "https://github.com/tokio-rs/axum", rev = "07cd3c8f4f281" }

I've verified that that at least builds.

Power2All commented 1 year ago

Sorry my bad. You need to use a patch:

# bottom of Cargo.toml
[patch.crates-io]
axum = { git = "https://github.com/tokio-rs/axum", rev = "07cd3c8f4f281" }

I've verified that that at least builds.

Works. Seems to panic on a non-existing path.

2023-04-24 16:10:11.196996400 [INFO ][torrust_axum::http_api] [API] Starting server listener on 0.0.0.0:9090
2023-04-24 16:10:11.198532400 [INFO ][torrust_axum::http_service] [HTTP] Starting server listener on 0.0.0.0:6969
2023-04-24 16:10:12.630631300 [DEBUG][hyper::proto::h1::io] parsed 11 headers
2023-04-24 16:10:12.630787600 [DEBUG][hyper::proto::h1::conn] incoming body is empty
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:310:17
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\std\src\panicking.rs:575
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\panicking.rs:65
   2: core::panicking::panic
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\panicking.rs:115
   3: axum::routing::Router<tuple$<>,hyper::body::body::Body>::call_with_state<tuple$<>,hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:310
   4: axum::routing::impl$5::call<hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:389
   5: tower::util::map_response::impl$2::call<axum::routing::Router<tuple$<>,hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\map_response.rs:75
   6: tower::util::map_future::impl$1::call<http::request::Request<hyper::body::body::Body>,tower::util::map_response::MapResponse<axum::routing::Router<tuple$<>,hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<b
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\map_future.rs:65
   7: tower_service::impl$1::call<dyn$<tower::util::boxed_clone::CloneService<http::request::Request<hyper::body::body::Body>,assoc$<Future,core::pin::Pin<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::respon
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-service-0.3.2\src\lib.rs:387
   8: tower::util::boxed_clone::impl$1::call<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\boxed_clone.rs:101
   9: tower::util::oneshot::impl$3::poll<tower::util::boxed_clone::BoxCloneService<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<cor
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\oneshot.rs:93
  10: axum::routing::route::impl$5::poll<hyper::body::body::Body,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\route.rs:161
  11: futures_core::future::impl$2::try_poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,en
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  12: futures_util::future::try_future::into_future::impl$2::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  13: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >,futures_util::fns::MapOkFn<http::response::Response<h
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  14: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >,futures_util::fns::MapOkFn<http::response::Response<http_
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  15: futures_util::future::try_future::impl$56::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Er
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  16: tower::util::map_response::impl$10::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > 
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  17: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  18: axum::middleware::from_fn::impl$5::run::async_fn$0<hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:335
  19: core::future::from_generator::impl$1::poll<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  20: core::panic::unwind_safe::impl$26::poll<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:296
  21: futures_util::future::future::catch_unwind::impl$1::poll::closure$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\catch_unwind.rs:36
  22: core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > > >,futures_util::future::future::catch_unwind::impl$1::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:271
  23: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_unwind::impl$1::poll::closure_env$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::fro
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:483
  24: std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$1<core::future::from_generator::GenFuture<enum2$<sqlx_core::pool::inner::spawn_maintenance_tasks::async_block_env$0<sqlx_core:
  25: std::panicking::try<enum2$<core::task::poll::Poll<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > > >,core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_un
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:447
  26: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_unwind::impl$1::poll::closure_env$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panic.rs:137
  27: futures_util::future::future::catch_unwind::impl$1::poll<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\catch_unwind.rs:36
  28: torrust_axum::http_service::http_service_log_panic::async_fn$0<hyper::body::body::Body>
             at .\src\http_service.rs:76
  29: core::future::from_generator::impl$1::poll<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  30: axum::middleware::from_fn::impl$11::call::async_block$0<core::future::from_generator::GenFuture<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > > (*)(http::request::Request<hyper::body::body::Body>,axum
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:300
  31: core::future::from_generator::impl$1::poll<enum2$<axum::middleware::from_fn::impl$11::call::async_block_env$0<core::future::from_generator::GenFuture<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > > (*
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  32: axum::middleware::from_fn::impl$9::poll
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:381
  33: futures_core::future::impl$2::try_poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  34: futures_util::future::try_future::into_future::impl$2::poll<axum::middleware::from_fn::ResponseFuture>
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  35: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<axum::middleware::from_fn::ResponseFuture>,futures_util::fns::MapOkFn<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  36: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<axum::middleware::from_fn::ResponseFuture>,futures_util::fns::MapOkFn<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::byt
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  37: futures_util::future::try_future::impl$56::poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body::combi
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  38: tower::util::map_response::impl$10::poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body::combinators:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  39: futures_core::future::impl$2::try_poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  40: futures_util::future::try_future::into_future::impl$2::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::erro
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  41: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::Uns
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  42: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncB
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  43: futures_util::future::try_future::impl$61::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > 
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  44: tower::util::map_err::impl$10::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::re
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  45: futures_core::future::impl$2::try_poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,a
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  46: futures_util::future::try_future::into_future::impl$2::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  47: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<ht
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  48: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_b
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  49: futures_util::future::try_future::impl$56::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  50: tower::util::map_response::impl$10::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  51: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  52: tower::util::oneshot::impl$3::poll<tower::util::boxed_clone::BoxCloneService<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<cor
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\oneshot.rs:97
  53: axum::routing::route::impl$5::poll<hyper::body::body::Body,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\route.rs:161
  54: hyper::proto::h1::dispatch::impl$6::poll_msg<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectInfo<enum2$<std::net::socket_ad
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:491
  55: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:297
  56: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:161
  57: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:137
  58: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:120
  59: hyper::proto::h1::dispatch::impl$1::poll<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::Connect
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:424
  60: hyper::server::conn::impl$8::poll<hyper::server::tcp::addr_stream::AddrStream,http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error>,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,h
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\server\conn.rs:986
  61: hyper::server::conn::upgrades::impl$1::poll<hyper::server::tcp::addr_stream::AddrStream,http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error>,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\server\conn.rs:1046
  62: core::future::future::impl$0::poll<hyper::server::conn::upgrades::UpgradeableConnection<hyper::server::tcp::addr_stream::AddrStream,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::con
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:112
  63: axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1::closure$0<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\macros\select.rs:524
  64: tokio::future::poll_fn::impl$1::poll<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1::__tokio_select_util::Out<tuple$<>,tuple$<>,enum2$<core::result::Result<tuple$<>,hyper::error::Error> > > >,axum_server::server::impl$
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\future\poll_fn.rs:58
  65: axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\axum-server-0.4.7\src\server.rs:203
  66: core::future::from_generator::impl$1::poll<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routi
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  67: core::future::future::impl$1::poll<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMake
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  68: tokio::runtime::task::core::impl$6::poll::closure$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:223
  69: tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\loom\std\unsafe_cell.rs:14
  70: tokio::runtime::task::core::Core<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_i
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:212
  71: tokio::runtime::task::harness::poll_future::closure$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axu
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:476
  72: core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:271
  73: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:483
  74: std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$1<core::future::from_generator::GenFuture<enum2$<sqlx_core::pool::inner::spawn_maintenance_tasks::async_block_env$0<sqlx_core:
  75: std::panicking::try<enum2$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:447
  76: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::a
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panic.rs:137
  77: tokio::runtime::task::harness::poll_future<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:464
  78: tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::con
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:198
  79: tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::con
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:152
  80: tokio::runtime::task::raw::poll<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_in
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:255
  81: tokio::runtime::task::raw::RawTask::poll
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:200
  82: tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle> >::run<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\mod.rs:394
  83: tokio::runtime::scheduler::multi_thread::worker::impl$1::run_task::closure$0
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:464
  84: tokio::runtime::coop::with_budget
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:107
  85: tokio::runtime::coop::budget
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:73
  86: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:463
  87: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:426
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2023-04-24 16:10:12.775750000 [ERROR][torrust_axum::http_service] internal error: entered unreachable code GET /test {"host": "localhost:6969", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8", "accept-language": "en-US,en;q=0.5", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "cookie": "mybb[lastvisit]=1679318243; mybb[lastactive]=1679339616; loginattempts=1; collapsed=; inlinemod_thread189=|1519|2261|2812|3794|5055|7032|7091|7132|; undefined=|134|57|14|12|1211|1192|1193|1194|1195|1208|1178|1209|1177|1176|1175|1173|1170|1168|1167|1161|; inlinemod_thread57=|2393|2443|2944|3722|3752|3795|7097|7107|; mybbuser=1_NQy3kdloUllXgIrxJ91Rvid9ffBDaeyJu8PG0gCiS09dwEpX74", "upgrade-insecure-requests": "1", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "cross-site"} request panicked!
2023-04-24 16:10:12.776077900 [DEBUG][hyper::proto::h1::io] flushed 94 bytes
2023-04-24 16:10:12.815163000 [DEBUG][hyper::proto::h1::io] parsed 11 headers
2023-04-24 16:10:12.815214500 [DEBUG][hyper::proto::h1::conn] incoming body is empty
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:310:17
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\std\src\panicking.rs:575
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\panicking.rs:65
   2: core::panicking::panic
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library\core\src\panicking.rs:115
   3: axum::routing::Router<tuple$<>,hyper::body::body::Body>::call_with_state<tuple$<>,hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:310
   4: axum::routing::impl$5::call<hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\mod.rs:389
   5: tower::util::map_response::impl$2::call<axum::routing::Router<tuple$<>,hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\map_response.rs:75
   6: tower::util::map_future::impl$1::call<http::request::Request<hyper::body::body::Body>,tower::util::map_response::MapResponse<axum::routing::Router<tuple$<>,hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<b
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\map_future.rs:65
   7: tower_service::impl$1::call<dyn$<tower::util::boxed_clone::CloneService<http::request::Request<hyper::body::body::Body>,assoc$<Future,core::pin::Pin<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::respon
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-service-0.3.2\src\lib.rs:387
   8: tower::util::boxed_clone::impl$1::call<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\boxed_clone.rs:101
   9: tower::util::oneshot::impl$3::poll<tower::util::boxed_clone::BoxCloneService<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<cor
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\oneshot.rs:93
  10: axum::routing::route::impl$5::poll<hyper::body::body::Body,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\route.rs:161
  11: futures_core::future::impl$2::try_poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,en
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  12: futures_util::future::try_future::into_future::impl$2::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  13: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >,futures_util::fns::MapOkFn<http::response::Response<h
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  14: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> > >,futures_util::fns::MapOkFn<http::response::Response<http_
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  15: futures_util::future::try_future::impl$56::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Er
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  16: tower::util::map_response::impl$10::poll<axum::routing::route::RouteFuture<hyper::body::body::Body,enum2$<core::convert::Infallible> >,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > 
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  17: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  18: axum::middleware::from_fn::impl$5::run::async_fn$0<hyper::body::body::Body>
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:335
  19: core::future::from_generator::impl$1::poll<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  20: core::panic::unwind_safe::impl$26::poll<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:296
  21: futures_util::future::future::catch_unwind::impl$1::poll::closure$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\catch_unwind.rs:36
  22: core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > > >,futures_util::future::future::catch_unwind::impl$1::poll
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:271
  23: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_unwind::impl$1::poll::closure_env$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::fro
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:483
  24: std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$1<core::future::from_generator::GenFuture<enum2$<sqlx_core::pool::inner::spawn_maintenance_tasks::async_block_env$0<sqlx_core:
  25: std::panicking::try<enum2$<core::task::poll::Poll<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > > >,core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_un
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:447
  26: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<futures_util::future::future::catch_unwind::impl$1::poll::closure_env$0<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panic.rs:137
  27: futures_util::future::future::catch_unwind::impl$1::poll<core::panic::unwind_safe::AssertUnwindSafe<core::future::from_generator::GenFuture<enum2$<axum::middleware::from_fn::impl$5::run::async_fn_env$0<hyper::body::body::Body> > > > >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\catch_unwind.rs:36
  28: torrust_axum::http_service::http_service_log_panic::async_fn$0<hyper::body::body::Body>
             at .\src\http_service.rs:76
  29: core::future::from_generator::impl$1::poll<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > >
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  30: axum::middleware::from_fn::impl$11::call::async_block$0<core::future::from_generator::GenFuture<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > > (*)(http::request::Request<hyper::body::body::Body>,axum
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:300
  31: core::future::from_generator::impl$1::poll<enum2$<axum::middleware::from_fn::impl$11::call::async_block_env$0<core::future::from_generator::GenFuture<enum2$<torrust_axum::http_service::http_service_log_panic::async_fn_env$0<hyper::body::body::Body> > > (*
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  32: axum::middleware::from_fn::impl$9::poll
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\middleware\from_fn.rs:381
  33: futures_core::future::impl$2::try_poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  34: futures_util::future::try_future::into_future::impl$2::poll<axum::middleware::from_fn::ResponseFuture>
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  35: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<axum::middleware::from_fn::ResponseFuture>,futures_util::fns::MapOkFn<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  36: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<axum::middleware::from_fn::ResponseFuture>,futures_util::fns::MapOkFn<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::byt
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  37: futures_util::future::try_future::impl$56::poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body::combi
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  38: tower::util::map_response::impl$10::poll<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::response::Response<http_body::combinators:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  39: futures_core::future::impl$2::try_poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  40: futures_util::future::try_future::into_future::impl$2::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::erro
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  41: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::Uns
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  42: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncB
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  43: futures_util::future::try_future::impl$61::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > 
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  44: tower::util::map_err::impl$10::poll<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> > (*)(http::re
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  45: futures_core::future::impl$2::try_poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,a
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-core-0.3.28\src\future.rs:82
  46: futures_util::future::try_future::into_future::impl$2::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\try_future\into_future.rs:34
  47: futures_util::future::future::map::impl$2::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<ht
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\future\future\map.rs:55
  48: futures_util::future::future::impl$15::poll<futures_util::future::try_future::into_future::IntoFuture<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_b
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  49: futures_util::future::try_future::impl$56::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.28\src\lib.rs:91
  50: tower::util::map_response::impl$10::poll<tower::util::map_err::MapErrFuture<tower::util::map_response::MapResponseFuture<axum::middleware::from_fn::ResponseFuture,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\macros.rs:38
  51: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  52: tower::util::oneshot::impl$3::poll<tower::util::boxed_clone::BoxCloneService<http::request::Request<hyper::body::body::Body>,http::response::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error> >,enum2$<cor
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tower-0.4.13\src\util\oneshot.rs:97
  53: axum::routing::route::impl$5::poll<hyper::body::body::Body,enum2$<core::convert::Infallible> >
             at C:\Users\Power2All\.cargo\git\checkouts\axum-3a6345d9aff97fa3\07cd3c8\axum\src\routing\route.rs:161
  54: hyper::proto::h1::dispatch::impl$6::poll_msg<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectInfo<enum2$<std::net::socket_ad
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:491
  55: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:297
  56: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:161
  57: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:137
  58: hyper::proto::h1::dispatch::Dispatcher<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::ConnectIn
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:120
  59: hyper::proto::h1::dispatch::impl$1::poll<hyper::proto::h1::dispatch::Server<axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::convert::Infallible> >,axum::extract::connect_info::Connect
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\proto\h1\dispatch.rs:424
  60: hyper::server::conn::impl$8::poll<hyper::server::tcp::addr_stream::AddrStream,http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error>,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,h
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\server\conn.rs:986
  61: hyper::server::conn::upgrades::impl$1::poll<hyper::server::tcp::addr_stream::AddrStream,http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes,axum_core::error::Error>,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.26\src\server\conn.rs:1046
  62: core::future::future::impl$0::poll<hyper::server::conn::upgrades::UpgradeableConnection<hyper::server::tcp::addr_stream::AddrStream,axum::extension::AddExtension<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum2$<core::con
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:112
  63: axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1::closure$0<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\macros\select.rs:524
  64: tokio::future::poll_fn::impl$1::poll<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1::__tokio_select_util::Out<tuple$<>,tuple$<>,enum2$<core::result::Result<tuple$<>,hyper::error::Error> > > >,axum_server::server::impl$
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\future\poll_fn.rs:58
  65: axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routing::MethodRouter<tuple$<>,hyper::body::body::Body,enum
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\axum-server-0.4.7\src\server.rs:203
  66: core::future::from_generator::impl$1::poll<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMakeServiceWithConnectInfo<axum::routing::method_routi
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\mod.rs:91
  67: core::future::future::impl$1::poll<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_info::IntoMake
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\future\future.rs:124
  68: tokio::runtime::task::core::impl$6::poll::closure$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:223
  69: tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\loom\std\unsafe_cell.rs:14
  70: tokio::runtime::task::core::Core<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_i
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:212
  71: tokio::runtime::task::harness::poll_future::closure$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axu
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:476
  72: core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\core\src\panic\unwind_safe.rs:271
  73: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:483
  74: std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$1<core::future::from_generator::GenFuture<enum2$<sqlx_core::pool::inner::spawn_maintenance_tasks::async_block_env$0<sqlx_core:
  75: std::panicking::try<enum2$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panicking.rs:447
  76: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::a
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943\library\std\src\panic.rs:137
  77: tokio::runtime::task::harness::poll_future<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract:
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:464
  78: tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::con
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:198
  79: tokio::runtime::task::harness::Harness<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::con
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:152
  80: tokio::runtime::task::raw::poll<core::pin::Pin<alloc::boxed::Box<core::future::from_generator::GenFuture<enum2$<axum_server::server::impl$1::serve::async_fn$0::async_block$0::async_block_env$1<axum_server::accept::DefaultAcceptor,axum::extract::connect_in
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:255
  81: tokio::runtime::task::raw::RawTask::poll
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:200
  82: tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle> >::run<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle> >
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\mod.rs:394
  83: tokio::runtime::scheduler::multi_thread::worker::impl$1::run_task::closure$0
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:464
  84: tokio::runtime::coop::with_budget
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:107
  85: tokio::runtime::coop::budget
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:73
  86: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:463
  87: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at C:\Users\Power2All\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:426
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2023-04-24 16:10:12.827785500 [ERROR][torrust_axum::http_service] internal error: entered unreachable code GET /favicon.ico {"host": "localhost:6969", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0", "accept": "image/avif,image/jxl,image/webp,*/*", "accept-language": "en-US,en;q=0.5", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "referer": "http://localhost:6969/test", "cookie": "mybb[lastvisit]=1679318243; mybb[lastactive]=1679339616; loginattempts=1; collapsed=; inlinemod_thread189=|1519|2261|2812|3794|5055|7032|7091|7132|; undefined=|134|57|14|12|1211|1192|1193|1194|1195|1208|1178|1209|1177|1176|1175|1173|1170|1168|1167|1161|; inlinemod_thread57=|2393|2443|2944|3722|3752|3795|7097|7107|; mybbuser=1_NQy3kdloUllXgIrxJ91Rvid9ffBDaeyJu8PG0gCiS09dwEpX74", "sec-fetch-dest": "image", "sec-fetch-mode": "no-cors", "sec-fetch-site": "same-origin"} request panicked!
2023-04-24 16:10:12.828011200 [DEBUG][hyper::proto::h1::io] flushed 94 bytes
2023-04-24 16:10:12.828192900 [DEBUG][hyper::proto::h1::conn] read eof
davidpdrsn commented 1 year ago

And do you see anything the logs from the middleware?

Power2All commented 1 year ago

Yes, see the internal error line on the logs I pasted. That's the middleware. Does this mean that the panic error triggers not the routing issue, and if it did, it would have triggered the middleware, right ?

davidpdrsn commented 1 year ago

I don't understand. If https://github.com/tokio-rs/axum/blob/07cd3c8f4f2815557f994b17755886b18315d392/axum/src/routing/mod.rs#L310 hits the middleware then why doesn't https://github.com/tokio-rs/axum/blob/07cd3c8f4f2815557f994b17755886b18315d392/axum/src/routing/mod.rs#L315 🤔

Power2All commented 1 year ago

I don't understand. If

https://github.com/tokio-rs/axum/blob/07cd3c8f4f2815557f994b17755886b18315d392/axum/src/routing/mod.rs#L310 hits the middleware then why doesn't

https://github.com/tokio-rs/axum/blob/07cd3c8f4f2815557f994b17755886b18315d392/axum/src/routing/mod.rs#L315 🤔

If you like, I could give 0.6.13 a try, and if that doesn't die almost instantly, 0.6.14. Between 0.6.12 and 0.6.16 something changed that it do this.

davidpdrsn commented 1 year ago

I guess another way to go about it is to put the request info in the panic message itself. I did that in d935c1b8fd658. Try to run with that.

Power2All commented 1 year ago

I guess way to go about it is to put the request info in the panic message itself. I did that in d935c1b. Try to run with that.

Will do, let you know asap.

[edit] Strange, the main branch with your patch is not triggering the panic error... Running almost a half hour now. Will run it now with the live environment (don't worry, it's still my testing ground, just people use it publicly). If it crashes with your patch, we can determine what is going on, but right now, the main branch with your patch is not hitting anything yet.

Power2All commented 1 year ago

We got a hit @davidpdrsn !

thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: version=HTTP/1.1; method=CONNECT; uri=cn.aol.com:443; headers={"user-agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36", "connection": "Keep-Alive", "content-length": "0", "host": "cn.aol.com", "pragma": "no-cache"}', /root/.cargo/git/checkouts/axum-3a6345d9aff97fa3/d935c1b/axum/src/routing/mod.rs:317:29
stack backtrace:
   0:     0x557ade5a5c09 - <unknown>
   1:     0x557ade4739ae - <unknown>
   2:     0x557ade582174 - <unknown>
   3:     0x557ade5a6c9f - <unknown>
   4:     0x557ade5a689f - <unknown>
   5:     0x557ade5a7908 - <unknown>
   6:     0x557ade5a73f2 - <unknown>
   7:     0x557ade5a735c - <unknown>
   8:     0x557ade5a7331 - <unknown>
   9:     0x557ade36a3c2 - <unknown>
  10:     0x557ade42b6f1 - <unknown>
  11:     0x557ade3e0390 - <unknown>
  12:     0x557ade375b50 - <unknown>
  13:     0x557ade378e33 - <unknown>
  14:     0x557ade41613f - <unknown>
  15:     0x557ade37606c - <unknown>
  16:     0x557ade3e03e1 - <unknown>
  17:     0x557ade37a7e8 - <unknown>
  18:     0x557ade3cca7f - <unknown>
  19:     0x557ade3d65c6 - <unknown>
  20:     0x557ade41707d - <unknown>
  21:     0x557ade3cfa9b - <unknown>
  22:     0x557ade5aca52 - <unknown>
  23:     0x557ade5b577f - <unknown>
  24:     0x557ade5ab8b7 - <unknown>
  25:     0x557ade5ab590 - <unknown>
  26:     0x557ade5b09bf - <unknown>
  27:     0x557ade5a8635 - <unknown>
  28:     0x7f4bf344bb43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  29:     0x7f4bf34dda00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  30:                0x0 - <unknown>

Seems someone did try to manipulate the header uri host. Might that be the problem ? Content-Length seems to be interesting issue as well. Would the system panic if this is bad ?

davidpdrsn commented 1 year ago

No. Those headers don't influence the routing, which is where the panic is coming from. I really don't understand how that request could hit it. It should just go to the fallback like any other request.

Power2All commented 1 year ago

No. Those headers don't influence the routing, which is where the panic is coming from. I really don't understand how that request could hit it. It should just go to the fallback like any other request.

Good question. You want me to try to see which version exactly crashes the system ?

davidpdrsn commented 1 year ago

Which version of axum? I would expect that to be 0.6.13, 0.6.14, 0.6.15, and 0.6.16. Those versions all have the code path that panics, previous versions don't.

What would be more helpful would be if you can run your app locally, send it the request we're seeing (sending CONNECT requests is always annoying), and see if you can get the panic. I've tried that myself in a separate project with the same routes but I couldn't get it to panic.

Power2All commented 1 year ago

Somehow could we dump the raw data in base64 somewhere to a file if it triggers the panic ? That way, we could look into the full request if there is anything it trips on.

davidpdrsn commented 1 year ago

Somehow could we dump the raw data in base64 somewhere to a file if it triggers the panic ?

You mean the raw request? No I don't think that's possible.

Power2All commented 1 year ago

Somehow could we dump the raw data in base64 somewhere to a file if it triggers the panic ?

You mean the raw request? No I don't think that's possible.

Mmm that's sad. Would have been easy to replay the issue with a raw request, which you can send to the client, thus it would crash (possibly) again. Do you have anything else you like me to try ?

Power2All commented 1 year ago
path_router hit
path_router hit
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.13/src/routing/mod.rs:315:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted

It's defenitely happening since v0.6.13

davidpdrsn commented 1 year ago

I've pushed another commit that includes the whole router in the panic message. I'm curious to see which paths the fallback router has internally. Sha is 264462131f00e. Are you able to test with that?

Thanks for being so engaged with testing by the way! This is slowly driving me crazy 😅

Power2All commented 1 year ago

No worries, I had my time on brain cranking moments too. Happy to help :) (I've had a hard time trying to get this project working in Go, but switched to Rust cause of the shitty garbage collector in Go). It also helps me learning Rust :)

Power2All commented 1 year ago

@davidpdrsn Got this error logged.

2023-04-24 20:54:49.229256777 [ERROR][torrust_axum::http_service] internal error: entered unreachable code: router=Router { path_router: PathRouter { routes: {RouteId(2): MethodRouter(MethodRouter { get: BoxedHandler, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: Default(Route), allow_header: Bytes(b"GET,HEAD") }), RouteId(3): MethodRouter(MethodRouter { get: BoxedHandler, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: Default(Route), allow_header: Bytes(b"GET,HEAD") }), RouteId(1): MethodRouter(MethodRouter { get: BoxedHandler, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: Default(Route), allow_header: Bytes(b"GET,HEAD") }), RouteId(4): MethodRouter(MethodRouter { get: BoxedHandler, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: Default(Route), allow_header: Bytes(b"GET,HEAD") })}, node: Node { paths: {RouteId(3): "/scrape", RouteId(2): "/announce/:key", RouteId(1): "/announce", RouteId(4): "/scrape/:key"} } }, fallback_router: PathRouter { routes: {RouteId(1): MethodRouter(MethodRouter { get: None, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: BoxedHandler, allow_header: Skip }), RouteId(2): MethodRouter(MethodRouter { get: None, head: None, delete: None, options: None, patch: None, post: None, put: None, trace: None, fallback: BoxedHandler, allow_header: Skip })}, node: Node { paths: {RouteId(1): "/", RouteId(2): "/*__private__axum_fallback"} } }, default_fallback: false }; version=HTTP/1.1; method=CONNECT; uri=www.yahoo.com:443; headers={"host": "www.yahoo.com:443", "user-agent": "Go-http-client/1.1"} CONNECT www.yahoo.com:443 {"host": "www.yahoo.com:443", "user-agent": "Go-http-client/1.1"} request panicked!
davidpdrsn commented 1 year ago

Indeed it was helpful! I have a minimal reproduction now!

The fallback was totally normal so I was thinking it had to do with something else. Most likely that someone is trying to proxy through your app, since they're sending a CONNECT request. And you can indeed repro the panic with:

use axum::Router;

#[tokio::main]
async fn main() {
    let app = Router::new().fallback(|| async {});

    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}

Run that and then curl -x http://127.0.0.1:3000 https://example.com/.

That hits the panic:

thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /Users/david.pedersen/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.6.16/src/routing/mod.rs:312:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'll investigate further!

Power2All commented 1 year ago

Awesome ! Hopefully it will become stable again, so I can update the Axum to latest version again. Thanks for your support on helping me finding the problem too :)

davidpdrsn commented 1 year ago

Hopefully it will become stable again

Definitely! I expect to have a fix out by the end of the week.

davidpdrsn commented 1 year ago

https://github.com/tokio-rs/axum/pull/1958 should fix it. You are able to test with 7c4cdf787044d29664688ec9bae87889d3183627?

Power2All commented 1 year ago

1958 should fix it. You are able to test with 7c4cdf7?

Testing now with this. Will let it run for 30 minutes, unless it panic kills itself again. Should know soon enough if it works or not.