Open LuisReyes98 opened 5 years ago
name = 'torchbear'
operating_system = 'unix:Ubuntu'
crate_version = '0.11.2'
explanation = '''
Panic occurred in file '/home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-0.11.20/src/renderer/processor.rs' at line 774
'''
method = 'Panic'
backtrace = '''
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized::h82ffbb043fdb3a9b (0xe96b86)
1: backtrace::capture::Backtrace::create::h55f75705b5325feb (0xe95b47)
2: backtrace::capture::Backtrace::new::h9064988ae880e202 (0xe95a6d)
3: human_panic::report::Report::new::h68f5dc73b9d84d7f (0xdfc772)
4: human_panic::handle_dump::h6bbbedd2aa51f4dd (0xdfbca7)
5: torchbear_lib::ApplicationBuilder::start::{{closure}}::h3f59368e3b3afaf0 (0x46944b)
6: std::panicking::rust_panic_with_hook::h781594332e68f14e (0xf1f046)
at libstd/panicking.rs:480
7: std::panicking::continue_panic_fmt::h986a35a447ed28cf (0xf1eb91)
at libstd/panicking.rs:390
8: std::panicking::begin_panic_fmt::h788685a06248af37 (0xf1eade)
at libstd/panicking.rs:345
9: tera::renderer::processor::Processor::render_node::h41d643a66743d1c0 (0xa678ef)
10: tera::renderer::processor::Processor::render_body::h1421c7a3882600ca (0xa5b77e)
11: tera::renderer::processor::Processor::render_node::h41d643a66743d1c0 (0xa6617f)
12: tera::renderer::processor::Processor::render_body::h1421c7a3882600ca (0xa5b77e)
13: tera::renderer::processor::Processor::render_node::h41d643a66743d1c0 (0xa65d6b)
14: tera::renderer::processor::Processor::render::h2d65b2d8f0a71243 (0xa687e2)
15: tera::renderer::Renderer::render::hce94de10ca52b359 (0x9fc2ac)
16: tera::tera::Tera::render::h7d51d7d850873143 (0x5eb4f2)
17: <rlua::lua::StaticUserDataMethods<'lua, T>>::box_method::{{closure}}::h374ff864a8025f05 (0x5b200d)
18: <std::panic::AssertUnwindSafe
I was just about to run the code to see if it would produce an error. Looking at the trace it does look like it goes back to tera renderer with an unexpected node (looked related to https://github.com/Keats/tera/issues/370). You probably didnt get a direct error because of it panicking than returning a proper error. When I get a minute I will look at the template to get a better understanding of it.
progress made via #222 for #128
needs retesting to see if we'll get a better error message now. Luis, please try this after upgrading
With the new version the https://github.com/LuisReyes98/found-patterns-theme/tree/crashing_error_in_templeate_searching , still doesn't work but now gives a proper error message:
ERROR: lighttouch-base/loaders/themes/resolve_template.lua:22: attempt to index a nil value (local 'parent_theme')
stack traceback:
lighttouch-base/loaders/themes/resolve_template.lua:22: in function 'loaders.themes.resolve_template'
lighttouch-base/loaders/themes/extends_rewriter.lua:10: in function <lighttouch-base/loaders/themes/extends_rewriter.lua:8>
[C]: in function 'string.gsub'
lighttouch-base/loaders/themes/extends_rewriter.lua:8: in local 'fn'
lighttouch-base/loaders/themes/load_themes.lua:7: in function 'loaders.themes.load_themes'
lighttouch-base/base.lua:28: in main chunk
[C]: in function '_require'
[string "?"]:8: in function 'require'
lighttouch-base/init.lua:10: in local 'init_f'
[string "?"]:15: in function <[string "?"]:11>
[C]: in function 'xpcall'
[string "?"]:11: in main chunk
where the error is that the value of the parent theme is nil
this issue now can be resolved by changing lighttouch theme loader
Our updated plan:
Include
FrameType
a condensed clone of the including template's frame stackOrigin
Frame and an Include frame on top itThis makes include
more powerful than the current one, more secure and less bug-prone than sharing the frame stack, but with a linear performance cost, so developer's will need to use it carefully.
this potentially has value https://github.com/Keats/tera/pull/321
Issue
Torchbear crashes without giving a proper error message when it extends from a template that doesn't exist. example in the linked repository
https://github.com/LuisReyes98/found-patterns-theme/tree/crashing_error_in_templeate_searching