AssertionError: assertion failed

I am trying to generate hail indexes for the imputed bgen files in RAP (dnanexus platform) for UK Biobank data processing. The command bellow has worked fine for all the chromosomes except chromosome 4, for which I am getting the error below. What might be the issue?

Thank you very much in advance!

file_url = f"file://{bgen_path}/ukb22828_c4_b0_v3.bgen"
contig_recoding={“04”: “4”},

Traceback (most recent call last): (0 + 1) / 1]
File “”, line 1, in
File “”, line 2, in index_bgen
File “/opt/conda/lib/python3.9/site-packages/hail/typecheck/”, line 584, in wrapper
return original_func(*args, **kwargs)
File “/opt/conda/lib/python3.9/site-packages/hail/methods/”, line 3014, in index_bgen
for r in ht.collect():
File “”, line 2, in collect
File “/opt/conda/lib/python3.9/site-packages/hail/typecheck/”, line 584, in wrapper
return original_func(*args, **kwargs)
File “/opt/conda/lib/python3.9/site-packages/hail/”, line 2178, in collect
return Env.backend().execute(e._ir, timed=_timed)
File “/opt/conda/lib/python3.9/site-packages/hail/backend/”, line 82, in execute
raise e.maybe_user_error(ir) from None
File “/opt/conda/lib/python3.9/site-packages/hail/backend/”, line 76, in execute
result_tuple = self._jbackend.executeEncode(jir, stream_codec, timed)
File “/cluster/spark/python/lib/”, line 1321, in call
File “/opt/conda/lib/python3.9/site-packages/hail/backend/”, line 35, in deco
raise fatal_error_from_java_error_triplet(deepest, full, error_id) from None AssertionError: assertion failed

Java stack trace:
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 13.0 failed 4 times, most recent failure: Lost task 0.3 in stage 13.0 (TID 52) ( executor 0): java.lang.AssertionError: assertion failed

Hi @irun, I’m sorry Hail is failing for you. I expect this to work fine.

We nee the full and complete stack trace to diagnose. We need everything after the line “Java stack trace:”. Can you share all of that?

We will probably also need the Hail log file. You can find that in the working directory of your Python process or Jupyter Notebook.

We also need to know which version of Hail you are using. That should be included in the full and complete stack trace. If it is not, please add it!

One common cause of this error is trying to use an old version of Hail with BGEN v1.3 files. Support for BGEN v1.3 was added in Hail 0.2.108 which was released ten months ago. Due to the small size of our team and large number of users, we cannot support old versions of Hail. We’ll need you to update to the latest version, 0.2.126, if you’re not already on the latest version.