Skip to content

Exception in Amazon Q plugin at IntelliJ startup #5188

Open
@psantus

Description

Describe the bug

Stack trace

com.intellij.diagnostic.PluginException: Cannot init component state (componentName=codewhispererSettings, componentClass=CodeWhispererSettings) [Plugin: amazon.q]
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:170)
	at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:46)
	at com.intellij.serviceContainer.ComponentManagerImpl.initializeService$intellij_platform_serviceContainer(ComponentManagerImpl.kt:657)
	at com.intellij.serviceContainer.LightServiceInstanceSupport$LightServiceInstanceInitializer.createInstance(LightServiceInstanceSupport.kt:56)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:163)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:161)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:27)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:90)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.initialize(LazyInstanceHolder.kt:146)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.access$initialize(LazyInstanceHolder.kt:14)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.tryInitialize(LazyInstanceHolder.kt:136)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstance(LazyInstanceHolder.kt:96)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext$suspendImpl(LazyInstanceHolder.kt:88)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext(LazyInstanceHolder.kt)
	at com.intellij.serviceContainer.ComponentManagerImplKt$doGetOrCreateInstanceBlocking$1.invokeSuspend(ComponentManagerImpl.kt:1566)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:111)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$BuildersKt__BuildersKt(Builders.kt:84)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:52)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization$lambda$10(ComponentManagerImpl.kt:1684)
	at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:85)
	at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:1675)
	at com.intellij.serviceContainer.ComponentManagerImplKt.doGetOrCreateInstanceBlocking(ComponentManagerImpl.kt:1565)
	at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1560)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:751)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:695)
	at software.aws.toolkits.jetbrains.settings.CodeWhispererSettings$Companion.getInstance(CodeWhispererSettings.kt:148)
	at software.aws.toolkits.jetbrains.services.codewhisperer.util.CodeWhispererEndpointCustomizer$customize$1.modifyHttpRequest(CodeWhispererEndpointCustomizer.kt:58)
	at software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.modifyHttpRequestAndHttpContent(ExecutionInterceptorChain.java:89)
	at software.amazon.awssdk.core.internal.handler.BaseClientHandler.runModifyHttpRequestAndHttpContentInterceptors(BaseClientHandler.java:157)
	at software.amazon.awssdk.core.internal.handler.BaseClientHandler.finalizeSdkHttpFullRequest(BaseClientHandler.java:83)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:151)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
	at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
	at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
	at software.amazon.awssdk.services.codewhispererruntime.DefaultCodeWhispererRuntimeClient.listAvailableCustomizations(DefaultCodeWhispererRuntimeClient.java:798)
	at software.amazon.awssdk.services.codewhispererruntime.paginators.ListAvailableCustomizationsIterable$ListAvailableCustomizationsResponseFetcher.nextPage(ListAvailableCustomizationsIterable.java:137)
	at software.amazon.awssdk.services.codewhispererruntime.paginators.ListAvailableCustomizationsIterable$ListAvailableCustomizationsResponseFetcher.nextPage(ListAvailableCustomizationsIterable.java:128)
	at software.amazon.awssdk.core.pagination.sync.PaginatedResponsesIterator.next(PaginatedResponsesIterator.java:58)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at software.aws.toolkits.jetbrains.services.codewhisperer.credentials.CodeWhispererClientAdaptorImpl.listAvailableCustomizations(CodeWhispererClientAdaptor.kt:354)
	at software.aws.toolkits.jetbrains.services.codewhisperer.customization.DefaultCodeWhispererModelConfigurator.listCustomizations$lambda$12(CodeWhispererModelConfigurator.kt:93)
	at software.aws.toolkits.jetbrains.services.amazonq.QUtilsKt.calculateIfIamIdentityCenterConnection(QUtils.kt:26)
	at software.aws.toolkits.jetbrains.services.amazonq.QUtilsKt.calculateIfIamIdentityCenterConnection(QUtils.kt:19)
	at software.aws.toolkits.jetbrains.services.codewhisperer.customization.DefaultCodeWhispererModelConfigurator.listCustomizations(CodeWhispererModelConfigurator.kt:90)
	at software.aws.toolkits.jetbrains.services.codewhisperer.startup.CodeWhispererProjectStartupActivity.runActivity$lambda$1$lambda$0(CodeWhispererProjectStartupActivity.kt:65)
	at software.aws.toolkits.jetbrains.utils.ThreadingUtilsKt.pluginAwareExecuteOnPooledThread$lambda$4$lambda$3(ThreadingUtils.kt:88)
	at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
	at software.aws.toolkits.jetbrains.utils.ThreadingUtilsKt.pluginAwareExecuteOnPooledThread$lambda$4(ThreadingUtils.kt:88)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:195)
	at com.intellij.util.concurrency.ContextCallable.lambda$call$1(ContextCallable.java:74)
	at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:83)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.intellij.util.xmlb.XmlSerializationException: Cannot deserialize class software.aws.toolkits.jetbrains.settings.CodeWhispererConfiguration
	at com.intellij.configurationStore.StateStorageBaseKt.deserializeStateWithController(StateStorageBase.kt:375)
	at com.intellij.configurationStore.StateStorageBase.getState(StateStorageBase.kt:55)
	at com.intellij.configurationStore.ComponentStoreImpl$doCreateStateGetter$1.getState(ComponentStoreImpl.kt:560)
	at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:492)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:430)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:145)
	... 87 more
Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method com.intellij.serialization.stateProperties.MyMap.put, parameter key
	at com.intellij.serialization.stateProperties.MyMap.put(MapStoredProperty.kt)
	at com.intellij.util.xmlb.MapBinding.deserializeMap(MapBinding.kt:247)
	at com.intellij.util.xmlb.MapBinding.deserializeList(MapBinding.kt:198)
	at com.intellij.util.xmlb.TagBinding.deserialize(TagBinding.kt:224)
	at com.intellij.util.xmlb.BeanBindingKt.deserializeNestedBindingInto(BeanBinding.kt:484)
	at com.intellij.configurationStore.StateStorageBaseKt.getXmlSerializedState(StateStorageBase.kt:452)
	at com.intellij.configurationStore.StateStorageBaseKt.deserializeStateWithController(StateStorageBase.kt:327)
	... 92 more

To reproduce
Just start IntelliJ

Expected behavior
No exception

Your Environment

  • OS: MacOS Sequoia 15.1.1 (24B91)
  • JetBrains product: IntelliJ
  • JetBrains product version: Ultimate edition, Build #IU-243.22562.145, built on December 9, 2024 (occurred in previous versions too)
  • AWS Toolkit version: 3.45-243
  • SAM CLI version: none? I have SAM CLI, version 1.100.0 but how would it be related?
  • JVM/Python version:
    java --version
    openjdk 21 2023-09-19 LTS
    OpenJDK Runtime Environment Corretto-21.0.0.35.1 (build 21+35-LTS)
    OpenJDK 64-Bit Server VM Corretto-21.0.0.35.1 (build 21+35-LTS, mixed mode, sharing)

Runtime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Additional context
Q seems otherwise functional

Metadata

Assignees

No one assigned

    Labels

    amazon-qbugWe can reproduce the issue and confirmed it is a bug.codewhisperer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions