I am running hail 0.2 from conda, on HPC (centos, slurm, 1 node 20 CPU 16GB per CPU).
Whenever I try to run SKAT (and not on any other function), the java server breaks and I need to initialize hail again.
ERROR:py4j.java_gateway:An error occurred while trying to connect to the Java server (127.0.0.1:35675)
My code:
skat_table = hl.skat(key_expr=chr21f.genes2, weight_expr=(hl.dbeta(hl.min(chr21f.variant_qc.AF), 1.0, 25.0) ** 2), y=chr21f.sys_bool, x=chr21f.GT.n_alt_alleles(), covariates=[1])
Error:
ERROR:py4j.java_gateway:An error occurred while trying to connect to the Java server (127.0.0.1:35675)
Traceback (most recent call last):
File "/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py", line 929, in _get_connection
connection = self.deque.pop()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py", line 1067, in start
self.socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _get_connection(self)
928 try:
--> 929 connection = self.deque.pop()
930 except IndexError:
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
ConnectionRefusedError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in start(self)
1066 try:
-> 1067 self.socket.connect((self.address, self.port))
1068 self.stream = self.socket.makefile("rb")
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Py4JNetworkError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
700 type_pprinters=self.type_printers,
701 deferred_pprinters=self.deferred_printers)
--> 702 printer.pretty(obj)
703 printer.flush()
704 return stream.getvalue()
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/IPython/lib/pretty.py in pretty(self, obj)
398 if cls is not object \
399 and callable(cls.__dict__.get('__repr__')):
--> 400 return _repr_pprint(obj, self, cycle)
401
402 return _default_pprint(obj, self, cycle)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
693 """A pprint that just redirects to the normal repr function."""
694 # Find newlines and replace them with p.break_()
--> 695 output = repr(obj)
696 for idx,output_line in enumerate(output.splitlines()):
697 if idx:
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in __repr__(self)
1242
1243 def __repr__(self):
-> 1244 return self.__str__()
1245
1246 def data(self):
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in __str__(self)
1239
1240 def __str__(self):
-> 1241 return self._ascii_str()
1242
1243 def __repr__(self):
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in _ascii_str(self)
1266 return s
1267
-> 1268 rows, has_more, dtype = self.data()
1269 fields = list(dtype)
1270 trunc_fields = [trunc(f) for f in fields]
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in data(self)
1249 row_dtype = t.row.dtype
1250 t = t.select(**{k: Table._hl_format(v, self.truncate) for (k, v) in t.row.items()})
-> 1251 rows, has_more = t._take_n(self.n)
1252 self._data = (rows, has_more, row_dtype)
1253 return self._data
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in _take_n(self, n)
1370 has_more = False
1371 else:
-> 1372 rows = self.take(n + 1)
1373 has_more = len(rows) > n
1374 rows = rows[:n]
<decorator-gen-1054> in take(self, n, _localize)
/gpfs/share/apps/anaconda3/cpu/5.2.0/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
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in take(self, n, _localize)
2062 """
2063
-> 2064 return self.head(n).collect(_localize)
2065
2066 @typecheck_method(n=int)
<decorator-gen-1048> in collect(self, _localize)
/gpfs/share/apps/anaconda3/cpu/5.2.0/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
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in collect(self, _localize)
1861 e = construct_expr(ir, hl.tarray(t.row.dtype))
1862 if _localize:
-> 1863 return Env.backend().execute(e._ir)
1864 else:
1865 return e
/gpfs/share/apps/anaconda3/cpu/5.2.0/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']
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in __call__(self, *args)
1253 proto.END_COMMAND_PART
1254
-> 1255 answer = self.gateway_client.send_command(command)
1256 return_value = get_return_value(
1257 answer, self.gateway_client, self.target_id, self.name)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in send_command(self, command, retry, binary)
981 if `binary` is `True`.
982 """
--> 983 connection = self._get_connection()
984 try:
985 response = connection.send_command(command)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _get_connection(self)
929 connection = self.deque.pop()
930 except IndexError:
--> 931 connection = self._create_connection()
932 return connection
933
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _create_connection(self)
935 connection = GatewayConnection(
936 self.gateway_parameters, self.gateway_property)
--> 937 connection.start()
938 return connection
939
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in start(self)
1077 "server ({0}:{1})".format(self.address, self.port)
1078 logger.exception(msg)
-> 1079 raise Py4JNetworkError(msg, e)
1080
1081 def _authenticate_connection(self):
Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:35675)
ERROR:py4j.java_gateway:An error occurred while trying to connect to the Java server (127.0.0.1:35675)
Traceback (most recent call last):
File "/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py", line 929, in _get_connection
connection = self.deque.pop()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py", line 1067, in start
self.socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _get_connection(self)
928 try:
--> 929 connection = self.deque.pop()
930 except IndexError:
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
ConnectionRefusedError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in start(self)
1066 try:
-> 1067 self.socket.connect((self.address, self.port))
1068 self.stream = self.socket.makefile("rb")
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Py4JNetworkError Traceback (most recent call last)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in _repr_html_(self)
1254
1255 def _repr_html_(self):
-> 1256 return self._html_str()
1257
1258 def _ascii_str(self):
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in _html_str(self)
1340 types = self.types
1341
-> 1342 rows, has_more, dtype = self.data()
1343 fields = list(dtype)
1344
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in data(self)
1249 row_dtype = t.row.dtype
1250 t = t.select(**{k: Table._hl_format(v, self.truncate) for (k, v) in t.row.items()})
-> 1251 rows, has_more = t._take_n(self.n)
1252 self._data = (rows, has_more, row_dtype)
1253 return self._data
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in _take_n(self, n)
1370 has_more = False
1371 else:
-> 1372 rows = self.take(n + 1)
1373 has_more = len(rows) > n
1374 rows = rows[:n]
<decorator-gen-1054> in take(self, n, _localize)
/gpfs/share/apps/anaconda3/cpu/5.2.0/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
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in take(self, n, _localize)
2062 """
2063
-> 2064 return self.head(n).collect(_localize)
2065
2066 @typecheck_method(n=int)
<decorator-gen-1048> in collect(self, _localize)
/gpfs/share/apps/anaconda3/cpu/5.2.0/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
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/hail/table.py in collect(self, _localize)
1861 e = construct_expr(ir, hl.tarray(t.row.dtype))
1862 if _localize:
-> 1863 return Env.backend().execute(e._ir)
1864 else:
1865 return e
/gpfs/share/apps/anaconda3/cpu/5.2.0/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']
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in __call__(self, *args)
1253 proto.END_COMMAND_PART
1254
-> 1255 answer = self.gateway_client.send_command(command)
1256 return_value = get_return_value(
1257 answer, self.gateway_client, self.target_id, self.name)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in send_command(self, command, retry, binary)
981 if `binary` is `True`.
982 """
--> 983 connection = self._get_connection()
984 try:
985 response = connection.send_command(command)
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _get_connection(self)
929 connection = self.deque.pop()
930 except IndexError:
--> 931 connection = self._create_connection()
932 return connection
933
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in _create_connection(self)
935 connection = GatewayConnection(
936 self.gateway_parameters, self.gateway_property)
--> 937 connection.start()
938 return connection
939
/gpfs/share/apps/anaconda3/cpu/5.2.0/lib/python3.6/site-packages/py4j/java_gateway.py in start(self)
1077 "server ({0}:{1})".format(self.address, self.port)
1078 logger.exception(msg)
-> 1079 raise Py4JNetworkError(msg, e)
1080
1081 def _authenticate_connection(self):
Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:35675)