redlib
redlib copied to clipboard
🐛 Bug Report: thread 'tokio-runtime-worker' panicked at src/post.rs:19:10
Describe the bug
This message pops up a fair bit on my public Redlib instance, typically doing so a lot at once (like 10 times in a row) and seemingly returns nothing to the client as NGINX marks the backend as down without my VTS module logging any error code that would cause such.
Steps to reproduce the bug
Not sure yet.
What's the expected behavior?
This error doesn't appear and Redlib either throws a normal error or returns something proper instead of not responding at all.
Additional context / screenshot
Output with RUST_BACKTRACE=1
index out of bounds: the len is 0 but the index is 0
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic_bounds_check
3: <usize as core::slice::index::SliceIndex<[T]>>::index
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/slice/index.rs:274:10
4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/slice/index.rs:18:15
5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
at /usr/src/debug/rust/rustc-1.90.0-src/library/alloc/src/vec/mod.rs:3571:9
6: redlib::post::_::<impl askama::Template for redlib::post::PostTemplate>::render_into_with_values
at ./src/post.rs:19:10
7: askama::Template::render_with_values
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/askama-0.14.0/src/lib.rs:127:14
8: askama::Template::render
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/askama-0.14.0/src/lib.rs:118:14
9: redlib::utils::template
at ./src/utils.rs:1309:11
10: redlib::post::item::{{closure}}
at ./src/post.rs:92:7
11: <core::pin::Pin<P> as core::future::future::Future>::poll
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/future/future.rs:133:9
12: redlib::server::Server::listen::{{closure}}::{{closure}}::{{closure}}::{{closure}}
at ./src/server.rs:363:20
13: <core::pin::Pin<P> as core::future::future::Future>::poll
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/future/future.rs:133:9
14: <hyper::proto::h1::dispatch::Server<S,hyper::body::body::Body> as hyper::proto::h1::dispatch::Dispatch>::poll_msg
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:502:48
15: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_write
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:303:72
16: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:164:26
17: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_inner
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:140:21
18: hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_catch
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:119:33
19: <hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/dispatch.rs:435:14
20: <hyper::server::conn::ProtoServer<T,B,S,E> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/server/conn.rs:1006:50
21: <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/server/conn.rs:1066:74
22: <hyper::common::drain::Watching<F,FN> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/common/drain.rs:96:46
23: <hyper::server::server::new_svc::NewSvcTask<I,N,S,E,W> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/server/server.rs:792:43
24: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/core.rs:331:24
25: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/loom/std/unsafe_cell.rs:16:9
26: tokio::runtime::task::core::Core<T,S>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/core.rs:320:30
27: tokio::runtime::task::harness::poll_future::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:532:30
28: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/panic/unwind_safe.rs:272:9
29: std::panicking::catch_unwind::do_call
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panicking.rs:589:40
30: __rust_try
31: std::panicking::catch_unwind
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panicking.rs:552:19
32: std::panic::catch_unwind
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panic.rs:359:14
33: tokio::runtime::task::harness::poll_future
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:520:18
34: tokio::runtime::task::harness::Harness<T,S>::poll_inner
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:209:27
35: tokio::runtime::task::harness::Harness<T,S>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:154:20
36: tokio::runtime::task::raw::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/raw.rs:271:13
37: tokio::runtime::task::raw::RawTask::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/raw.rs:201:18
38: tokio::runtime::task::LocalNotified<S>::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/mod.rs:463:13
39: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:674:22
40: tokio::task::coop::with_budget
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/task/coop/mod.rs:167:5
41: tokio::task::coop::budget
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/task/coop/mod.rs:133:5
42: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:594:9
43: tokio::runtime::scheduler::multi_thread::worker::Context::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:542:29
44: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:507:24
45: tokio::runtime::context::scoped::Scoped<T>::set
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/context/scoped.rs:40:9
46: tokio::runtime::context::set_scheduler::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/context.rs:180:38
47: std::thread::local::LocalKey<T>::try_with
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/thread/local.rs:315:12
48: std::thread::local::LocalKey<T>::with
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/thread/local.rs:279:20
49: tokio::runtime::context::set_scheduler
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/context.rs:180:17
50: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:502:9
51: tokio::runtime::context::runtime::enter_runtime
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/context/runtime.rs:65:16
52: tokio::runtime::scheduler::multi_thread::worker::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:494:5
53: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/scheduler/multi_thread/worker.rs:460:45
54: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/blocking/task.rs:42:21
55: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/core.rs:331:24
56: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/loom/std/unsafe_cell.rs:16:9
57: tokio::runtime::task::core::Core<T,S>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/core.rs:320:30
58: tokio::runtime::task::harness::poll_future::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:532:30
59: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /usr/src/debug/rust/rustc-1.90.0-src/library/core/src/panic/unwind_safe.rs:272:9
60: std::panicking::catch_unwind::do_call
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panicking.rs:589:40
61: __rust_try
62: std::panicking::catch_unwind
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panicking.rs:552:19
63: std::panic::catch_unwind
at /usr/src/debug/rust/rustc-1.90.0-src/library/std/src/panic.rs:359:14
64: tokio::runtime::task::harness::poll_future
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:520:18
65: tokio::runtime::task::harness::Harness<T,S>::poll_inner
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:209:27
66: tokio::runtime::task::harness::Harness<T,S>::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/harness.rs:154:20
67: tokio::runtime::task::raw::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/raw.rs:271:13
68: tokio::runtime::task::raw::RawTask::poll
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/raw.rs:201:18
69: tokio::runtime::task::UnownedTask<S>::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/mod.rs:500:13
70: tokio::runtime::blocking::pool::Task::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/blocking/pool.rs:161:19
71: tokio::runtime::blocking::pool::Inner::run
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/blocking/pool.rs:511:22
72: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
at /home/cat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/blocking/pool.rs:469:47
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
- [x] I checked that the instance that this was reported on is running the latest git commit, or I can reproduce it locally on the latest git commit