# Py4JError: An error occurred while calling o201.pyPersist

**URL:** <https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231>\
**Category:** Hail Query & hailctl\
**Created:** [December 27, 2019, 12:49am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231 "2019-12-27T00:49:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cliveno1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cliveno1/32/1115_2.png) [@cliveno1](https://discuss.hail.is/u/cliveno1)\
**Post date:** [December 27, 2019, 12:49am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/1 "2019-12-27T00:49:00Z")

</div>

Hi I’m running the tutorial. All well until the actual gwas analysis call:

`gwas = hl.linear_regression_rows(y=mt.pheno.CaffeineConsumption, x=mt.GT.n_alt_alleles(), covariates=[1.0])`

When I get a stream of error output - I think it may be a memory issue but Im on a HPC and I am very surprised its happening on a small tutorial dataset. Output:

`  
2019-12-26 16:20:57 Hail: INFO: linear\_regression\_rows: running on 250 samples for 1 response variable y,  
with input variable x, and 1 additional covariate…  
ERROR:root:Exception while sending command.  
Traceback (most recent call last):  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/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 “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/py4j/java\_gateway.py”, line 985, in send\_command  
response = connection.send\_command(command)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/py4j/java\_gateway.py”, line 1164, in send\_command  
“Error while receiving”, e, proto.ERROR\_ON\_RECEIVE)  
py4j.protocol.Py4JNetworkError: Error while receiving  
ERROR:py4j.java\_gateway:An error occurred while trying to connect to the Java server (127.0.0.1:42828)  
Traceback (most recent call last):  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/IPython/core/interactiveshell.py”, line 3319, in run\_code  
exec(code\_obj, self.user\_global\_ns, self.user\_ns)  
File “”, line 3, in   
covariates=[1.0])  
File “\</fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1497\>”, line 2, in linear\_regression\_rows  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py”, line 585, in wrapper  
return _original\_func(\*args, \*\*kwargs_)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/methods/statgen.py”, line 447, in linear\_regression\_rows  
return ht\_result.persist()  
File “\</fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1057\>”, line 2, in persist  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py”, line 585, in wrapper  
return _original\_func(\*args, \*\*kwargs_)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/table.py”, line 1788, in persist  
return Env.backend().persist\_table(self, storage\_level)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/backend/backend.py”, line 128, in persist\_table  
return Table.\_from\_java(self.\_to\_java\_ir(t.\_tir).pyPersist(storage\_level))  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/py4j/java\_gateway.py”, line 1257, in **call**  
answer, self.gateway\_client, self.target\_id, self.name)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/hail/utils/java.py”, line 213, in deco  
return f(\*args, \*\*kwargs)  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/py4j/protocol.py”, line 336, in get\_return\_value  
format(target\_id, “.”, name))  
py4j.protocol.Py4JError: An error occurred while calling o201.pyPersist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/IPython/core/interactiveshell.py”, line 2034, in showtraceback  
stb = value._render\_traceback_()  
AttributeError: ‘Py4JError’ object has no attribute ‘_render\_traceback_’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/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 “/fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/py4j/java\_gateway.py”, line 1067, in start  
self.socket.connect((self.address, self.port))  
ConnectionRefusedError: [Errno 111] Connection refused

* * *

Py4JError Traceback (most recent call last)  
 in   
1 gwas = hl.linear\_regression\_rows(y=mt.pheno.CaffeineConsumption,  
2 x=mt.GT.n\_alt\_alleles(),  
----\> 3 covariates=[1.0])  
4 gwas.row.describe()

\</fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1497\> in linear\_regression\_rows(y, x, covariates, block\_size, pass\_through)

~/.conda/envs/hail/lib/python3.7/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

~/.conda/envs/hail/lib/python3.7/site-packages/hail/methods/statgen.py in linear\_regression\_rows(y, x, covariates, block\_size, pass\_through)  
445 ht\_result = ht\_result.annotate(\*\*{f: ht\_result[f][0] for f in fields})  
446  
–\> 447 return ht\_result.persist()  
448  
449

\</fs/home/cliveterence.dar/.conda/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1057\> in persist(self, storage\_level)

~/.conda/envs/hail/lib/python3.7/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

~/.conda/envs/hail/lib/python3.7/site-packages/hail/table.py in persist(self, storage\_level)  
1786 Persisted table.  
1787 “”"  
-\> 1788 return Env.backend().persist\_table(self, storage\_level)  
1789  
1790 def unpersist(self) -\> ‘Table’:

~/.conda/envs/hail/lib/python3.7/site-packages/hail/backend/backend.py in persist\_table(self, t, storage\_level)  
126  
127 def persist\_table(self, t, storage\_level):  
–\> 128 return Table.\_from\_java(self.\_to\_java\_ir(t.\_tir).pyPersist(storage\_level))  
129  
130 def unpersist\_table(self, t):

~/.conda/envs/hail/lib/python3.7/site-packages/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:

~/.conda/envs/hail/lib/python3.7/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()

~/.conda/envs/hail/lib/python3.7/site-packages/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 o201.pyPersist  
`

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [January 2, 2020, 11:44am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/2 "2020-01-02T11:44:24Z")

</div>

What system are you running on? This could potentially be a native library mismatch.

---

<div class="post-metadata">

**Author:** ![cliveno1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cliveno1/32/1115_2.png) [@cliveno1](https://discuss.hail.is/u/cliveno1)\
**Post date:** [January 6, 2020, 4:49am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/3 "2020-01-06T04:49:10Z")

</div>

Hi sorry for late response

I’m on GNU/Linux:

Linux 3.10.0-1062.4.1.el7.x86\_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86\_64 x86\_64 x86\_64 GNU/Linux

Thanks

C

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [January 6, 2020, 2:54pm UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/4 "2020-01-06T14:54:17Z")

</div>

@cliveno1 Hail requires GCC 5.0 (or LLVM 3.4) or later, which will install a compatible libstdc++. We also require a recent version of glibc, at least 2.14. I suspect your glibc is sufficient because you have a relatively recent version of the kernel. You probably just need to install gcc or llvm on the leader node and every worker node.

---

<div class="post-metadata">

**Author:** ![cliveno1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cliveno1/32/1115_2.png) [@cliveno1](https://discuss.hail.is/u/cliveno1)\
**Post date:** [January 7, 2020, 8:59am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/6 "2020-01-07T08:59:09Z")

</div>

Hi there

So, when I type: _ **gcc --version** _, I get: _**gcc (GCC) 7.3.0**_

So, I assume my gcc is compatible. However, when I type: _ **glibc --version** _, I get: _ **command not found** _

So, I’m guessing _ **glibc** _ is the issue. Can you give any advice to install this, I’m struggling to find anything I can understand on the web

Thanks

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [January 7, 2020, 1:48pm UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/7 "2020-01-07T13:48:44Z")

</div>

`glibc` is not a tool like gcc, it’s a shared library file on your system. `glibc` is distributed with `ldd`, a tool for inspecting compiled files, as such, they share a version. You can check `glibc`'s version with `ldd --version`. Anyway, I suspect this is not the issue.

My next guess is a BLAS/LAPACK issue. Can you attach the log from a session where `linear_regression_rows` fails? The log location should be printed when Hail initializes. Within this log is hopefully the true error message.

---

<div class="post-metadata">

**Author:** ![cliveno1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cliveno1/32/1115_2.png) [@cliveno1](https://discuss.hail.is/u/cliveno1)\
**Post date:** [January 7, 2020, 2:57pm UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/8 "2020-01-07T14:57:57Z")

</div>

Hi I’ll email attach this log due to internet issues (even for a 1Mb doc) using the forum pages here in Thailand

Thanks

[hail-20200107-2145-0.2.30-2ae07d872f43.log](https://discuss.hail.is/uploads/short-url/aiqac6suWT8MQ3aIEket2jXp14L.log) (1.03 MB)

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [January 7, 2020, 6:41pm UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/9 "2020-01-07T18:41:57Z")

</div>

It appears there is an issue with BLAS/LAPACK. My guess is that the implementations of BLAS or LAPACK provided by your distribution of GNU/Linux is binary-incompatible with the normal BLAS and LAPACK interfaces. A similar problem is described [at the netlib forum](https://github.com/fommil/netlib-java/issues/87). hntd187 ultimately fixed their issue by installing/compiling OpenBLAS and ensuring that `libblas.so` on their machine was a symlink to OpenBLAS ([see hntd187’s comment on fommil/netlib-java#87](https://github.com/hntd187)). If you’re on an HPC cluster, it’s possible you can fix this by `use`ing an appropriate version of OpenBLAS or MKL.

---

<div class="post-metadata">

**Author:** ![cliveno1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cliveno1/32/1115_2.png) [@cliveno1](https://discuss.hail.is/u/cliveno1)\
**Post date:** [January 8, 2020, 2:46am UTC](https://discuss.hail.is/t/py4jerror-an-error-occurred-while-calling-o201-pypersist/1231/10 "2020-01-08T02:46:32Z")

</div>

Thanks for your input
