cube-js/cube · error · minijinja::Error
Error while calling method: {}
Error message
Error while calling method: {} What it means
A Python object exposed to a Jinja template raised when one of its methods was invoked: python_obj_method_call_sync returned an Err (Python exception, bad arguments, or missing method), which is wrapped here into a minijinja InvalidOperation error. The original Python error text follows the colon and is the key diagnostic.
Source
Thrown at packages/cubejs-backend-native/src/template/mj_value/python.rs:141
}
fn call_method(
&self,
_state: &mj::State,
name: &str,
args: &[Value],
) -> Result<Value, mj::Error> {
let obj_ref = &self.inner;
let mut arguments = Vec::with_capacity(args.len());
for arg in args {
arguments.push(from_minijinja_value(arg)?);
}
match python_obj_method_call_sync(obj_ref, name, arguments) {
Ok(r) => Ok(to_minijinja_value(r)),
Err(err) => Err(mj::Error::new(
minijinja::ErrorKind::InvalidOperation,
format!("Error while calling method: {}", format_python_error(err)),
)),
}
}
fn call(&self, _state: &mj::State, args: &[Value]) -> Result<Value, mj::Error> {
let obj_ref = &self.inner;
let mut arguments = Vec::with_capacity(args.len());
for arg in args {
arguments.push(from_minijinja_value(arg)?);
}
match python_obj_call_sync(obj_ref, arguments) {
Ok(r) => Ok(to_minijinja_value(r)),
Err(err) => Err(mj::Error::new(View on GitHub (pinned to 7d981676b3)
Solutions
- Read the wrapped Python exception message to find the real cause
- Verify the method exists on the Python object and the arguments the template passes match its signature
- Wrap risky Python methods in try/except and raise a clearer error for template authors
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/cubejs-backend-native/src/template/mj_value/python.rs:141 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/cc44db05bfb37a0b.
Report an issue: GitHub.