# Error summary: IllegalArgumentException: requirement failed

**URL:** <https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474>\
**Category:** Hail Query & hailctl\
**Created:** [February 10, 2022, 8:30pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474 "2022-02-10T20:30:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yluo411](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yluo411](https://discuss.hail.is/u/yluo411)\
**Post date:** [February 10, 2022, 8:30pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/1 "2022-02-10T20:30:17Z")

</div>

Hi Hail Team,

I am running the following code:  
print(“Perform sample QC on autosomes”)  
lcr\_intervals = hl.import\_locus\_intervals(lcr)  
lcr\_filtered = vcf\_mt.filter\_rows(  
# remove filtered variants, LCR variants, and ChrX variants  
((vcf\_mt.filters.length() \> 0) | (hl.is\_defined(lcr\_intervals[vcf\_mt.locus])) | (vcf\_mt.locus.contig == ‘chrX’)),  
keep=False  
)

summary.append((‘LCRPruned’, lcr\_filtered))  
print(“Exporting Sample QC stats for LCR-pruned variants”)  
sample\_df = hl.sample\_qc(lcr\_filtered, name=‘sqc’)  
sample\_df=sample\_df.cols().to\_pandas()

However, I got an error message like this:

* * *

FatalError Traceback (most recent call last)  
/tmp/ipykernel\_80073/2129889008.py in   
3 # export sample statistics considering LCR filtered variants  
4 sample\_df = hl.sample\_qc(lcr\_filtered, name=‘sqc’)  
----\> 5 sample\_df=sample\_df.cols().to\_pandas()  
6  
7 # .cols().to\_pandas().rename(

in to\_pandas(self, flatten)

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
575 def wrapper(_original\_func, \*args, \*\*kwargs):  
576 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
 → 577 return _original\_func(\*args, \*\*kwargs_)  
578  
579 return wrapper

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/table.py in to\_pandas(self, flatten)  
3255 dtypes\_struct = table.row.dtype  
3256 collect\_dict = {key: hl.agg.collect(value) for key, value in table.row.items()}  
 → 3257 column\_struct\_array = table.aggregate(hl.struct(\*\*collect\_dict))  
3258 columns = list(column\_struct\_array.keys())  
3259 data\_dict = {}

in aggregate(self, expr, \_localize)

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(\_\_original\_func, \*args, \*\*kwargs)  
575 def wrapper(_original\_func, \*args, \*\*kwargs):  
576 args, kwargs_ = check\_all(\_\_original\_func, args, kwargs, checkers, is\_method=is\_method)  
 → 577 return _original\_func(\*args, \*\*kwargs_)  
578  
579 return wrapper

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/table.py in aggregate(self, expr, \_localize)  
1176  
1177 if \_localize:  
 → 1178 return Env.backend().execute(hl.ir.MakeTuple([agg\_ir]))[0]  
1179  
1180 return construct\_expr(ir.LiftMeOut(agg\_ir), expr.dtype)

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/backend/py4j\_backend.py in execute(self, ir, timed)  
108 raise HailUserError(message\_and\_trace) from None  
109  
 → 110 raise e

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/backend/py4j\_backend.py in execute(self, ir, timed)  
84 # print(self.\_hail\_package.expr.ir.Pretty.apply(jir, True, -1))  
85 try:  
—\> 86 result\_tuple = self.\_jhc.backend().executeEncode(jir, stream\_codec)  
87 (result, timings) = (result\_tuple.\_1(), result\_tuple.\_2())  
88 value = ir.typ.\_from\_encoding(result)

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/py4j/java\_gateway.py in **call** (self, \*args)  
1303 answer = self.gateway\_client.send\_command(command)  
1304 return\_value = get\_return\_value(  
 → 1305 answer, self.gateway\_client, self.target\_id, self.name)  
1306  
1307 for temp\_arg in temp\_args:

~/.conda/envs/myconda\_env/lib/python3.7/site-packages/hail/backend/py4j\_backend.py in deco(\*args, \*\*kwargs)  
29 raise FatalError(’%s\n\nJava stack trace:\n%s\n’  
30 ‘Hail version: %s\n’  
—\> 31 ‘Error summary: %s’ % (deepest, full, hail. **version** , deepest), error\_id) from None  
32 except pyspark.sql.utils.CapturedException as e:  
33 raise FatalError(’%s\n\nJava stack trace:\n%s\n’

FatalError: IllegalArgumentException: requirement failed

Java stack trace:  
java.lang.IllegalArgumentException: requirement failed  
at scala.Predef$.require(Predef.scala:268)  
at is.hail.rvd.RVDPartitioner.(RVDPartitioner.scala:52)  
at is.hail.rvd.RVDPartitioner.extendKeySamePartitions(RVDPartitioner.scala:141)  
at is.hail.expr.ir.LoweredTableReader$$anon$2.coerce(TableIR.scala:382)  
at is.hail.expr.ir.GenericTableValue.toTableStage(GenericTableValue.scala:162)  
at is.hail.io.vcf.MatrixVCFReader.lower(LoadVCF.scala:1790)  
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:581)  
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)  
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1308)  
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)  
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1279)  
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)  
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1035)  
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)  
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:653)  
at is.hail.expr.ir.lowering.LowerTableIR$.lower$1(LowerTableIR.scala:394)  
at is.hail.expr.ir.lowering.LowerTableIR$.apply(LowerTableIR.scala:420)  
at is.hail.expr.ir.lowering.LowerToCDA$.lower(LowerToCDA.scala:69)  
at is.hail.expr.ir.lowering.LowerToCDA$.apply(LowerToCDA.scala:18)  
at is.hail.expr.ir.lowering.LowerToDistributedArrayPass.transform(LoweringPass.scala:77)  
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.evaluate$1(LowerOrInterpretNonCompilable.scala:27)  
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.rewrite$1(LowerOrInterpretNonCompilable.scala:67)  
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.rewrite$1(LowerOrInterpretNonCompilable.scala:53)  
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.apply(LowerOrInterpretNonCompilable.scala:72)  
at is.hail.expr.ir.lowering.LowerOrInterpretNonCompilablePass$.transform(LoweringPass.scala:69)  
at is.hail.expr.ir.lowering.LoweringPass.$anonfun$apply$3(LoweringPass.scala:16)  
at is.hail.utils.ExecutionTimer.time(ExecutionTimer.scala:81)  
at is.hail.expr.ir.lowering.LoweringPass.$anonfun$apply$1(LoweringPass.scala:16)  
at is.hail.utils.ExecutionTimer.time(ExecutionTimer.scala:81)  
at is.hail.expr.ir.lowering.LoweringPass.apply(LoweringPass.scala:14)  
at is.hail.expr.ir.lowering.LoweringPass.apply$(LoweringPass.scala:13)  
at is.hail.expr.ir.lowering.LowerOrInterpretNonCompilablePass$.apply(LoweringPass.scala:64)  
at is.hail.expr.ir.lowering.LoweringPipeline.$anonfun$apply$1(LoweringPipeline.scala:15)  
at is.hail.expr.ir.lowering.LoweringPipeline.$anonfun$apply$1$adapted(LoweringPipeline.scala:13)  
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)  
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)  
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)  
at is.hail.expr.ir.lowering.LoweringPipeline.apply(LoweringPipeline.scala:13)  
at is.hail.expr.ir.CompileAndEvaluate$.\_apply(CompileAndEvaluate.scala:47)  
at is.hail.backend.spark.SparkBackend.\_execute(SparkBackend.scala:381)  
at is.hail.backend.spark.SparkBackend.$anonfun$executeEncode$2(SparkBackend.scala:417)  
at is.hail.backend.ExecuteContext$.$anonfun$scoped$3(ExecuteContext.scala:47)  
at is.hail.utils.package$.using(package.scala:638)  
at is.hail.backend.ExecuteContext$.$anonfun$scoped$2(ExecuteContext.scala:47)  
at is.hail.utils.package$.using(package.scala:638)  
at is.hail.annotations.RegionPool$.scoped(RegionPool.scala:17)  
at is.hail.backend.ExecuteContext$.scoped(ExecuteContext.scala:46)  
at is.hail.backend.spark.SparkBackend.withExecuteContext(SparkBackend.scala:275)  
at is.hail.backend.spark.SparkBackend.$anonfun$executeEncode$1(SparkBackend.scala:414)  
at is.hail.utils.ExecutionTimer$.time(ExecutionTimer.scala:52)  
at is.hail.backend.spark.SparkBackend.executeEncode(SparkBackend.scala:413)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)  
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)  
at py4j.Gateway.invoke(Gateway.java:282)  
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)  
at py4j.commands.CallCommand.execute(CallCommand.java:79)  
at py4j.GatewayConnection.run(GatewayConnection.java:238)  
at java.lang.Thread.run(Thread.java:748)

Hail version: 0.2.82-290eaf334217  
Error summary: IllegalArgumentException: requirement failed

I would like to appreciate for any helps and suggestions. Thanks!

---

<div class="post-metadata">

**Author:** ![pwc2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/pwc2/32/595_2.png) [@pwc2](https://discuss.hail.is/u/pwc2)\
**Post date:** [February 11, 2022, 3:45pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/2 "2022-02-11T15:45:09Z")

</div>

Hi @yluo411, sorry that you are running into issues with Hail. This problem is caused by a known issue ([#11335](https://github.com/hail-is/hail/issues/11335)) which we don’t have a fix for yet, but the team is working on it.

---

<div class="post-metadata">

**Author:** ![yluo411](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yluo411](https://discuss.hail.is/u/yluo411)\
**Post date:** [February 14, 2022, 7:05pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/3 "2022-02-14T19:05:09Z")

</div>

Thank you so much for your reply. May I kindly double check whether the issue has been resolved. And what should I do regarding this issue. I just rerun it and looks like my code has the same error. Do I need to reinstall and install anything? Thanks

---

<div class="post-metadata">

**Author:** ![johnc1231](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/johnc1231/32/286_2.png) [@johnc1231](https://discuss.hail.is/u/johnc1231)\
**Post date:** [February 14, 2022, 7:50pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/4 "2022-02-14T19:50:27Z")

</div>

The main hail branch on github has been updated, but we haven’t released a new version with the fix yet. You can either build hail from source or wait a day or two for hail 0.2.85 to be released.

---

<div class="post-metadata">

**Author:** ![yluo411](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yluo411](https://discuss.hail.is/u/yluo411)\
**Post date:** [February 14, 2022, 7:51pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/5 "2022-02-14T19:51:54Z")

</div>

I see. Thank you so much for your quick reply.

---

<div class="post-metadata">

**Author:** ![johnc1231](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/johnc1231/32/286_2.png) [@johnc1231](https://discuss.hail.is/u/johnc1231)\
**Post date:** [February 14, 2022, 9:57pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/6 "2022-02-14T21:57:32Z")

</div>

The PR that will cause a new version to be released is here: [Release 0.2.85 by johnc1231 · Pull Request #11363 · hail-is/hail · GitHub](https://github.com/hail-is/hail/pull/11363)

Should go in tomorrow.

---

<div class="post-metadata">

**Author:** ![johnc1231](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/johnc1231/32/286_2.png) [@johnc1231](https://discuss.hail.is/u/johnc1231)\
**Post date:** [February 15, 2022, 12:56pm UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/7 "2022-02-15T12:56:22Z")

</div>

We released hail 0.2.85. Update to latest and this error should be resolved.

---

<div class="post-metadata">

**Author:** ![yluo411](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yluo411](https://discuss.hail.is/u/yluo411)\
**Post date:** [February 19, 2022, 4:25am UTC](https://discuss.hail.is/t/error-summary-illegalargumentexception-requirement-failed/2474/8 "2022-02-19T04:25:19Z")

</div>

Thank you so much. The code can run now.
