When the spark was writing a large file to HDFS using saveAsTextFile, I got an error: java.lang.IllegalArgumentException: Self-suppression not permitted at java.lang.Throwable.addSuppressed(Throwable.java:1043)
Caused by: java.io.IOException: All datanodes DatanodeInfoWithStorage
I've searched for a solution to this, but I've not found the right solution and I don't know why.
What is causing these errors, and how can I fix them?
The error self-suppression not permitted is not the actual error here.
This error is thrown by JVM when runtime tries to throw multiple THROWABLE instance from code.
To do so, JDK-7 introduces the "suppressedExceptions" to Throwable to suppress previous exception and retain very recent exception.
So Java tries - throwable.addSuppressed(throwable) - which is invalid and Throwable instance itself throws the IllegalArgumentException and the real exception is lost this way.
From this in log: Caused by: java.io.IOException: All datanodes DatanodeInfoWithStorag, It seems like there is some issue with datanode.
If you look into the running services in the cluster, and check if all datanodes and daemons are running fine; things may go in track.
Issues could be:
If you look at the documentation of Throwable you'll find some useful information about the addSuppressed method. Specifically, if you have an exception e, and you do e.addSuppressed(e), then a new IllegalArgumentException exception would be generated. This exception would show as
java.lang.IllegalArgumentException: Self-suppression not permitted
And of course, nothing about the original exception e would be shown.
Here are the errors that can be thrown when calling addSuppressed:
Throws: IllegalArgumentException - if exception is this throwable; a throwable cannot suppress itself. NullPointerException - if exception is null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With