question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internal error has occurred in rule [lambda-length]

See original GitHub issue

My configuration without yml file: diktat { inputs { include("src/**/*.kts", "src/**/*.kts", "*.kts") exclude("build/**") } debug = true }

Kotlin version: 1.6.10 diktat version: 1.0.2

[ERROR] 2022-01-22 21:47:31 Internal error has occurred in rule [lambda-length]. Please make an issue on this bug at https://github.com/cqfn/diKTat/. As a workaround you can disable these inspections in yml config: <[TOO_MANY_LINES_IN_LAMBDA]>. Root cause of the problem is in […\configuration-plugin\build.gradle.kts] file. java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.openapi.util.objectTree.ThrowableInterner at org.jetbrains.kotlin.com.intellij.util.exception.FrequentErrorLogger.report(FrequentErrorLogger.java:47) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.util.exception.FrequentErrorLogger.info(FrequentErrorLogger.java:43) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.DebugUtil.handleUnspecifiedTrace(DebugUtil.java:628) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.DebugUtil.currentInvalidationTrace(DebugUtil.java:620) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.DebugUtil.calcInvalidationTrace(DebugUtil.java:614) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.DebugUtil.onInvalidated(DebugUtil.java:585) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.TreeElement.onInvalidated(TreeElement.java:226) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.TreeElement.rawRemoveUpToWithoutNotifications(TreeElement.java:388) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.TreeElement.rawRemoveUpTo(TreeElement.java:342) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.CompositeElement.removeChildrenInner(CompositeElement.java:802) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.CompositeElement.removeChildInner(CompositeElement.java:790) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.CompositeElement.removeChild(CompositeElement.java:606) ~[kotlin-compiler-embeddable-1.6.10.jar:1.6.10-release-923(1.6.10)] at org.cqfn.diktat.ruleset.rules.chapter5.LambdaLengthRule.checkLambda(LambdaLengthRule.kt:39) ~[diktat-rules-1.0.2.jar:?] at org.cqfn.diktat.ruleset.rules.chapter5.LambdaLengthRule.logic(LambdaLengthRule.kt:29) ~[diktat-rules-1.0.2.jar:?] at org.cqfn.diktat.ruleset.rules.DiktatRule.visit(DiktatRule.kt:50) ~[diktat-rules-1.0.2.jar:?] at com.pinterest.ktlint.core.KtLint$lint$1.invoke(KtLint.kt:160) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint$lint$1.invoke(KtLint.kt:153) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint$visitor$2$1.invoke(KtLint.kt:307) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint$visitor$2$1.invoke(KtLint.kt:305) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:229) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:305) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:300) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.core.KtLint.lint(KtLint.kt:153) ~[ktlint-core-0.43.2.jar:?] at com.pinterest.ktlint.internal.FileUtilsKt.lintFile(FileUtils.kt:172) ~[ktlint-0.43.2.jar:0.43.2] at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:395) ~[ktlint-0.43.2.jar:0.43.2] at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:89) ~[ktlint-0.43.2.jar:0.43.2] at com.pinterest.ktlint.KtlintCommandLine$lintFiles$3.invoke$lambda-0(Main.kt:289) ~[ktlint-0.43.2.jar:0.43.2] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] 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) [?:?] Exception in thread “main” java.util.concurrent.ExecutionException: java.lang.Error: Internal error in diktat application at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at com.pinterest.ktlint.KtlintCommandLine.parallel(Main.kt:576) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.lang.Object java.lang.Throwable.backtrace accessible: module java.base does not “opens java.lang” to unnamed module @24273305

at com.pinterest.ktlint.KtlintCommandLine.parallel$default(Main.kt:548)
at com.pinterest.ktlint.KtlintCommandLine.lintFiles(Main.kt:298)
at com.pinterest.ktlint.KtlintCommandLine.run(Main.kt:262)
at com.pinterest.ktlint.Main.main(Main.kt:70)

Caused by: java.lang.Error: Internal error in diktat application at org.cqfn.diktat.ruleset.rules.DiktatRule.visit(DiktatRule.kt:61) at com.pinterest.ktlint.core.KtLint$lint$1.invoke(KtLint.kt:160) at com.pinterest.ktlint.core.KtLint$lint$1.invoke(KtLint.kt:153) at com.pinterest.ktlint.core.KtLint$visitor$2$1.invoke(KtLint.kt:307) at com.pinterest.ktlint.core.KtLint$visitor$2$1.invoke(KtLint.kt:305) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:229) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:230) at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:305) at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:300) at com.pinterest.ktlint.core.KtLint.lint(KtLint.kt:153) at com.pinterest.ktlint.internal.FileUtilsKt.lintFile(FileUtils.kt:172) at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:395) at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:89) at com.pinterest.ktlint.KtlintCommandLine$lintFiles$3.invoke$lambda-0(Main.kt:289) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.Error: Internal error in diktat application

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
WebTiger89commented, Jan 28, 2022

@petertrr cool, thanks for your time and investigation! I guess the ticket can be closed

0reactions
petertrrcommented, Jan 27, 2022

Yep, I can reproduce the following error

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.lang.Object java.lang.Throwable.backtrace accessible: module java.base does not "opens java.lang" to unnamed module ...

on openjdk 16 and 17. Everything works fine on openjdk <15. I also found the same issue tracked in ktlint: https://github.com/pinterest/ktlint/issues/1195.

As suggested there, the issue can be worked around by manually opening required JVM modules. With this fix in build.gradle.kts

tasks.withType<org.cqfn.diktat.plugin.gradle.DiktatJavaExecTaskBase> {
    jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}

I was able to run you sample without this error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Internal error has occurred in rule [lambda-length] · Issue #1182
My configuration without yml file: diktat { inputs { include("src/**/*.kts", "src/**/*.kts", "*.kts") exclude("build/**") } debug = true }.
Read more >
Jetpack Compose: Backend Internal error when calling ...
Sort of strange one but was getting "Backend Internal error" error when using Jetpack Compose and turned out it was triggered by calling...
Read more >
smurf source: R/Lambda_select.R - Rdrr.io
Note that the last urn can have less than n.folds observations. for (i in ... error occured when determining the maximum value of...
Read more >
Announcing LAMBDA: Turn Excel formulas into custom functions
Today we are releasing to our Beta customers a new capability that will revolutionize how you build formulas in Excel.
Read more >
Troubleshoot "internal server" error status code 500 for API ...
I sent an HTTP request to my Amazon API Gateway API endpoint that integrates with AWS Lambda (for example, /lambda-resource GET).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found