Hi hail team,
I’m running into this error relatively frequently in my notebooks today:
ERROR (root 1003): Exception while sending command.
Traceback (most recent call last):
File "/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1159, in send_command
raise Py4JNetworkError("Answer from Java side is empty")
py4j.protocol.Py4JNetworkError: Answer from Java side is empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 985, in send_command
response = connection.send_command(command)
File "/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1164, in send_command
"Error while receiving", e, proto.ERROR_ON_RECEIVE)
py4j.protocol.Py4JNetworkError: Error while receiving
and the rest of the error:
---------------------------------------------------------------------------
Py4JError Traceback (most recent call last)
<ipython-input-15-4533291abd08> in <module>
2 plots = []
3 for b in batches:
----> 4 p = hl.plot.histogram(chr20_agg[f'n_not_called_{b}'], title=f'n_not_called {b}')
5 plots.append(Panel(child=p, title=f'{b}'))
6 show(Tabs(tabs=plots))
</opt/conda/default/lib/python3.6/site-packages/decorator.py:decorator-gen-1543> in histogram(data, range, bins, legend, title, log, interactive)
/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
583 def wrapper(__original_func, *args, **kwargs):
584 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 585 return __original_func(*args_, **kwargs_)
586
587 return wrapper
/opt/conda/default/lib/python3.6/site-packages/hail/plot/plots.py in histogram(data, range, bins, legend, title, log, interactive)
390 finite_data = hail.bind(lambda x: hail.case().when(hail.is_finite(x), x).or_missing(), data)
391 start, end = agg_f((aggregators.min(finite_data),
--> 392 aggregators.max(finite_data)))
393 if start is None and end is None:
394 raise ValueError(f"'data' contains no values that are defined and finite")
</opt/conda/default/lib/python3.6/site-packages/decorator.py:decorator-gen-1155> in aggregate_rows(self, expr, _localize)
/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
583 def wrapper(__original_func, *args, **kwargs):
584 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 585 return __original_func(*args_, **kwargs_)
586
587 return wrapper
/opt/conda/default/lib/python3.6/site-packages/hail/matrixtable.py in aggregate_rows(self, expr, _localize)
1987 agg_ir = TableAggregate(MatrixRowsTable(base._mir), subst_query)
1988 if _localize:
-> 1989 return Env.backend().execute(agg_ir)
1990 else:
1991 return construct_expr(agg_ir, expr.dtype)
/opt/conda/default/lib/python3.6/site-packages/hail/backend/backend.py in execute(self, ir, timed)
107
108 def execute(self, ir, timed=False):
--> 109 result = json.loads(Env.hc()._jhc.backend().executeJSON(self._to_java_ir(ir)))
110 value = ir.typ._from_json(result['value'])
111 timings = result['timings']
/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py in __call__(self, *args)
1255 answer = self.gateway_client.send_command(command)
1256 return_value = get_return_value(
-> 1257 answer, self.gateway_client, self.target_id, self.name)
1258
1259 for temp_arg in temp_args:
/opt/conda/default/lib/python3.6/site-packages/hail/utils/java.py in deco(*args, **kwargs)
211 import pyspark
212 try:
--> 213 return f(*args, **kwargs)
214 except py4j.protocol.Py4JJavaError as e:
215 s = e.java_exception.toString()
/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
334 raise Py4JError(
335 "An error occurred while calling {0}{1}{2}".
--> 336 format(target_id, ".", name))
337 else:
338 type = answer[1]
Py4JError: An error occurred while calling o141.executeJSON
Most recently, I ran into this error trying to create some plots (hl.plot.histogram
). Any ideas what’s going on, or how I can fix this?