Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Called Option::unwrap() on a None value in rhai extensions #6489

Open
ThomasJamesCrawford opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@ThomasJamesCrawford
Copy link

ThomasJamesCrawford commented Dec 19, 2024

Describe the bug

Had this error randomly pop up a few times, router seems to panic in rhai code.

2024-12-18T23:48:48.619570Z ERROR tokio-runtime-worker ThreadId(06)  panicked at /sources/rhai-1.19.0-61797318be89b1a268a018a92a7657096d83f3ecb31418b9e9c16dcbb043b702/src/engine.rs:347:58: |  
-- | --
  |   | called `Option::unwrap()` on a `None` value |  
  |   | 0: apollo_router::executable::setup_panic_handler::{{closure}} |  
  |   | 1: std::panicking::rust_panic_with_hook |  
  |   | 2: std::panicking::begin_panic_handler::{{closure}} |  
  |   | 3: std::sys_common::backtrace::__rust_end_short_backtrace |  
  |   | 4: rust_begin_unwind |  
  |   | 5: core::panicking::panic_fmt |  
  |   | 6: core::panicking::panic |  
  |   | 7: rhai::engine::Engine::get_interned_string |  
  |   | 8: rhai::eval::stmt::<impl rhai::engine::Engine>::eval_stmt |  
  |   | 9: rhai::eval::stmt::<impl rhai::engine::Engine>::eval_stmt_block |  
  |   | 10: rhai::func::script::<impl rhai::engine::Engine>::call_script_fn |  
  |   | 11: rhai::func::call::<impl rhai::engine::Engine>::exec_fn_call |  
  |   | 12: rhai::func::call::<impl rhai::engine::Engine>::make_function_call |  
  |   | 13: rhai::func::call::<impl rhai::engine::Engine>::eval_fn_call_expr |  
  |   | 14: rhai::eval::expr::<impl rhai::engine::Engine>::eval_expr |  
  |   | 15: rhai::eval::expr::<impl rhai::engine::Engine>::eval_expr |  
  |   | 16: rhai::func::call::<impl rhai::engine::Engine>::get_arg_value |  
  |   | 17: rhai::func::call::<impl rhai::engine::Engine>::make_function_call |  
  |   | 18: rhai::func::call::<impl rhai::engine::Engine>::eval_fn_call_expr |  
  |   | 19: rhai::eval::stmt::<impl rhai::engine::Engine>::eval_stmt |  
  |   | 20: rhai::eval::stmt::<impl rhai::engine::Engine>::eval_stmt_block |  
  |   | 21: rhai::func::script::<impl rhai::engine::Engine>::call_script_fn |  
  |   | 22: rhai::func::call::<impl rhai::engine::Engine>::exec_fn_call |  
  |   | 23: rhai::types::fn_ptr::FnPtr::call_raw |  
  |   | 24: <T as futures_util::fns::FnOnce1<A>>::call_once |  
  |   | 25: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 26: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll |  
  |   | 27: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 28: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 29: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 30: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 31: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 32: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 33: apollo_router::query_planner::fetch::FetchNode::fetch_node::{{closure}} |  
  |   | 34: apollo_router::query_planner::execution::<impl apollo_router::query_planner::plan::PlanNode>::execute_recursively::{{closure}} |  
  |   | 35: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 36: apollo_router::query_planner::execution::<impl apollo_router::query_planner::plan::PlanNode>::execute_recursively::{{closure}} |  
  |   | 37: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 38: futures_util::stream::stream::StreamExt::poll_next_unpin |  
  |   | 39: apollo_router::query_planner::execution::<impl apollo_router::query_planner::plan::PlanNode>::execute_recursively::{{closure}} |  
  |   | 40: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 41: apollo_router::query_planner::execution::<impl apollo_router::query_planner::plan::PlanNode>::execute_recursively::{{closure}} |  
  |   | 42: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 43: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 44: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 45: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 46: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 47: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 48: apollo_router::services::supergraph::service::service_call::{{closure}} |  
  |   | 49: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 50: <futures_util::future::try_future::try_flatten_err::TryFlattenErr<Fut,<Fut as futures_core::future::TryFuture>::Error> as core::future::future::Future>::poll |  
  |   | 51: <futures_util::future::try_future::OrElse<Fut1,Fut2,F> as core::future::future::Future>::poll |  
  |   | 52: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 53: <apollo_router::plugins::traffic_shaping::timeout::future::ResponseFuture<F> as core::future::future::Future>::poll |  
  |   | 54: apollo_router::plugins::traffic_shaping::TrafficShaping::supergraph_service_internal::{{closure}}::{{closure}} |  
  |   | 55: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 56: <apollo_router::layers::async_checkpoint::OneShotAsyncCheckpointService<S,Fut,Request> as tower_service::Service<Request>>::call::{{closure}} |  
  |   | 57: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 58: <apollo_router::plugins::expose_query_plan::ExposeQueryPlan as apollo_router::plugin::Plugin>::supergraph_service::{{closure}}::{{closure}} |  
  |   | 59: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 60: <apollo_router::layers::async_checkpoint::OneShotAsyncCheckpointService<S,Fut,Request> as tower_service::Service<Request>>::call::{{closure}} |  
  |   | 61: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 62: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 63: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 64: <futures_util::future::try_future::try_flatten::TryFlatten<Fut,<Fut as futures_core::future::TryFuture>::Ok> as core::future::future::Future>::poll |  
  |   | 65: <tower::util::and_then::AndThenFuture<F1,F2,N> as core::future::future::Future>::poll |  
  |   | 66: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 67: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 68: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 69: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 70: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 71: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 72: <apollo_router::layers::map_first_graphql_response::MapFirstGraphqlResponseService<InnerService,Callback> as tower_service::Service<Request>>::call::{{closure}} |  
  |   | 73: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 74: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 75: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 76: apollo_router::services::router::service::RouterService::process_supergraph_request::{{closure}} |  
  |   | 77: apollo_router::services::router::service::RouterService::call_inner::{{closure}}::{{closure}}::{{closure}} |  
  |   | 78: <futures_util::future::maybe_done::MaybeDone<Fut> as core::future::future::Future>::poll |  
  |   | 79: <apollo_router::services::router::service::RouterService as tower_service::Service<apollo_router::services::router::Request>>::call::{{closure}} |  
  |   | 80: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 81: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 82: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 83: <apollo_router::plugins::limits::layer::ResponseFuture<Inner> as core::future::future::Future>::poll |  
  |   | 84: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 85: <apollo_router::plugins::limits::LimitsPlugin as apollo_router::plugin::Plugin>::router_service::{{closure}}::{{closure}} |  
  |   | 86: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 87: <tower::util::either::Either<A,B> as core::future::future::Future>::poll |  
  |   | 88: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll |  
  |   | 89: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll |  
  |   | 90: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 91: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 92: <core::pin::Pin<P> as core::future::future::Future>::poll |  
  |   | 93: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll |  
  |   | 94: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll |  
  |   | 95: tokio::runtime::task::core::Core<T,S>::poll |  
  |   | 96: tokio::runtime::task::harness::Harness<T,S>::poll |  
  |   | 97: tokio::runtime::scheduler::multi_thread::worker::Context::run_task |  
  |   | 98: tokio::runtime::scheduler::multi_thread::worker::Context::run |  
  |   | 99: tokio::runtime::context::scoped::Scoped<T>::set |  
  |   | 100: tokio::runtime::context::runtime::enter_runtime |  
  |   | 101: tokio::runtime::scheduler::multi_thread::worker::run |  
  |   | 102: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll |  
  |   | 103: tokio::runtime::task::core::Core<T,S>::poll |  
  |   | 104: tokio::runtime::task::harness::Harness<T,S>::poll |  
  |   | 105: tokio::runtime::blocking::pool::Inner::run |  
  |   | 106: std::sys_common::backtrace::__rust_begin_short_backtrace |  
  |   | 107: core::ops::function::FnOnce::call_once{{vtable.shim}} |  
  |   | 108: std::sys::unix::thread::Thread::new::thread_start |  
  |   | 109: start_thread |  
  |   | 110: __GI___clone3

Maybe related to rhaiscript/rhai#916

To Reproduce

Steps to reproduce the behavior:

Not sure

Expected behavior

A clear and concise description of what you expected to happen.

No panic

Output

If applicable, add output to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Using router 1.53

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

No branches or pull requests

1 participant