Log4jHotPatchFat.jar IllegalAccessError

Hi,

We recently updated our Amazon AMI to pickup a newer version and after recycling our nodes to re-deploy Elasticsearch 7.16.3 we started seeing the following exception. Is this a known issue and something with a recommended fix?

Caused by: org.elasticsearch.script.ScriptException: compile error
	at org.elasticsearch.painless.PainlessScriptEngine.convertToScriptException(PainlessScriptEngine.java:495) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine.compile(PainlessScriptEngine.java:406) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine.compile(PainlessScriptEngine.java:129) ~[?:?]
	at org.elasticsearch.script.ScriptCache.lambda$compile$0(ScriptCache.java:101) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.cache.Cache.computeIfAbsent(Cache.java:419) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.script.ScriptCache.compile(ScriptCache.java:83) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.script.ScriptService.compile(ScriptService.java:612) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.index.query.SearchExecutionContext.compile(SearchExecutionContext.java:569) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.ScriptSortBuilder.fieldComparatorSource(ScriptSortBuilder.java:397) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.ScriptSortBuilder.build(ScriptSortBuilder.java:314) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.parseSource(SearchService.java:1188) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.createContext(SearchService.java:982) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:618) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:483) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777) [elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.16.3.jar:7.16.3]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalAccessError: failed to access class org.objectweb.asm.Edge from class org.objectweb.asm.MethodWriter (org.objectweb.asm.Edge is in unnamed module of loader 'app'; org.objectweb.asm.MethodWriter is in unnamed module of loader java.net.FactoryURLClassLoader @2c0f7678)
	at org.objectweb.asm.MethodWriter.addSuccessorToCurrentBasicBlock(MethodWriter.java:1782) ~[Log4jHotPatchFat.jar:?]
	at org.objectweb.asm.MethodWriter.visitLabel(MethodWriter.java:1224) ~[Log4jHotPatchFat.jar:?]
	at org.objectweb.asm.commons.GeneratorAdapter.mark(GeneratorAdapter.java:904) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitTry(DefaultIRTreeToASMBytesPhase.java:670) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitTry(DefaultIRTreeToASMBytesPhase.java:178) ~[?:?]
	at org.elasticsearch.painless.ir.TryNode.visit(TryNode.java:44) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visit(DefaultIRTreeToASMBytesPhase.java:181) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitBlock(DefaultIRTreeToASMBytesPhase.java:337) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitBlock(DefaultIRTreeToASMBytesPhase.java:178) ~[?:?]
	at org.elasticsearch.painless.ir.BlockNode.visit(BlockNode.java:35) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visit(DefaultIRTreeToASMBytesPhase.java:181) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitFunction(DefaultIRTreeToASMBytesPhase.java:319) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitFunction(DefaultIRTreeToASMBytesPhase.java:178) ~[?:?]
	at org.elasticsearch.painless.ir.FunctionNode.visit(FunctionNode.java:32) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visit(DefaultIRTreeToASMBytesPhase.java:181) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitClass(DefaultIRTreeToASMBytesPhase.java:259) ~[?:?]
	at org.elasticsearch.painless.phase.DefaultIRTreeToASMBytesPhase.visitScript(DefaultIRTreeToASMBytesPhase.java:186) ~[?:?]
	at org.elasticsearch.painless.Compiler.compile(Compiler.java:221) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine$2.run(PainlessScriptEngine.java:401) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine$2.run(PainlessScriptEngine.java:397) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine.compile(PainlessScriptEngine.java:397) ~[?:?]
	at org.elasticsearch.painless.PainlessScriptEngine.compile(PainlessScriptEngine.java:129) ~[?:?]
	at org.elasticsearch.script.ScriptCache.lambda$compile$0(ScriptCache.java:101) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.cache.Cache.computeIfAbsent(Cache.java:419) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.script.ScriptCache.compile(ScriptCache.java:83) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.script.ScriptService.compile(ScriptService.java:612) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.index.query.SearchExecutionContext.compile(SearchExecutionContext.java:569) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.ScriptSortBuilder.fieldComparatorSource(ScriptSortBuilder.java:397) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.ScriptSortBuilder.build(ScriptSortBuilder.java:314) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.parseSource(SearchService.java:1188) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.createContext(SearchService.java:982) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:618) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:483) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777) ~[elasticsearch-7.16.3.jar:7.16.3]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-7.16.3.jar:7.16.3]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]