aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

IllegalStateException with AWS Toolkit 1.3

Open anshuma-amazon opened this issue 4 years ago • 6 comments

Plugin exception AWS Toolkit 1.30 Everytime I try to run the lambda function locally, keep getting IllegalStateException

Screenshots Screen Shot 2021-08-10 at 11 03 59 AM

Your Environment OS: MacOS Catalina JetBrains' Product: IntelliJ IDEA JetBrains' Product Version: 2020.3.3 Toolkit Version: 1.3 SAM CLI Version: 1.27.2 JVM/Python Version: 1.8.0_292

Stack Trace

java.lang.IllegalStateException: Module '...' is not managed by Maven or Gradle
	at software.aws.toolkits.jetbrains.services.lambda.java.JavaLambdaBuilder.handlerBaseDirectory(JavaLambdaBuilder.kt:28)
	at software.aws.toolkits.jetbrains.services.lambda.LambdaBuilder.buildFromHandler(LambdaBuilder.kt:54)
	at software.aws.toolkits.jetbrains.services.lambda.execution.sam.SamRunningState$Companion.buildBuildLambdaRequest$jetbrains_core(SamRunningState.kt:200)
	at software.aws.toolkits.jetbrains.services.lambda.execution.sam.SamRunningState.execute(SamRunningState.kt:86)
	at software.aws.toolkits.jetbrains.services.lambda.execution.sam.SamInvokeRunner$execute$1.call(SamInvokeRunner.kt:76)
	at software.aws.toolkits.jetbrains.services.lambda.execution.sam.SamInvokeRunner$execute$1.call(SamInvokeRunner.kt:31)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:521)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:468)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:76)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:152)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:113)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:59)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:110)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:76)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:486)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)

anshuma-amazon avatar Aug 10 '21 18:08 anshuma-amazon

Any update please

anshuma-amazon avatar Aug 11 '21 21:08 anshuma-amazon

The uncaught error is something that we need to fix

The root cause of the error is that the toolkit offloads building of Lambda code off to SAM CLI, and SAM CLI can only build code that uses either Gradle or Maven as its build system for Java.

abrooksv avatar Aug 11 '21 21:08 abrooksv

~~But this a Maven package~~. Is there any workaround?

It uses amazon internal build system. Sorry for confusion.

anshuma-amazon avatar Aug 11 '21 21:08 anshuma-amazon

If that is the case then the IDE's Maven system does not know about the package or it cant find the pom.xml We would need a minimum reproduction test case to triage it

abrooksv avatar Aug 11 '21 22:08 abrooksv

same on 5.10.0-0.bpo.8-amd64 #1 SMP Debian 5.10.46-2~bpo10+1 (2021-07-22) x86_64 GNU/Linux plugin 1.30-211 with intellij idea

IntelliJ IDEA 2021.1.3 (Community Edition)
Build #IC-211.7628.21, built on June 30, 2021
Runtime version: 11.0.11+9-b1341.60 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.10.0-0.bpo.8-amd64
GC: ParNew, ConcurrentMarkSweep
Memory: 1863M
Cores: 12
Registry: ide.balloon.shadow.size=0
Non-Bundled Plugins: net.seesharpsoft.intellij.plugins.csv (2.17.1), org.toml.lang (0.2.152.4026-211), Docker (211.7442.9), String Manipulation (8.15.203.000.3), org.jetbrains.kotlin (211-1.5.21-release-317-IJ7442.40), com.perl5 (2021.1.3), PythonCore (211.7628.24), aws.toolkit (1.30-211), idea.plugin.protoeditor (2.3.1), org.asciidoctor.intellij.asciidoc (0.33.14)
Kotlin: 211-1.5.21-release-317-IJ7442.40
Current Desktop: XFCE

i use Gradle with KTS

nikitasius avatar Aug 12 '21 15:08 nikitasius

we are using Amazon internal build system(HappierTrail), do we plan to support it? or any workaround? thanks :)

alex1993 avatar Jun 01 '22 14:06 alex1993

Closing as this is specific to an internal build system which is out of scope for the toolkit. There are other internal discussions on this topic.

rli avatar Aug 17 '22 01:08 rli