Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon Q / AWS Core throw exception on startup: Java 8 date/time type java.time.Instant not supported by default #5214

Closed
zekeoptimo opened this issue Dec 19, 2024 · 5 comments
Labels
bug We can reproduce the issue and confirmed it is a bug.

Comments

@zekeoptimo
Copy link

zekeoptimo commented Dec 19, 2024

Describe the bug
Plugin crashes at startup with the following stack trace:

com.intellij.diagnostic.PluginException: Cannot init toolwindow software.aws.toolkits.jetbrains.services.amazonq.toolwindow.AmazonQToolWindowFactory@3a19af48 [Plugin: amazon.q]
	at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:234)
	at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1)
	at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invokeSuspend(ToolWindowSetInitializer.kt:141)
	at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt)
	at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.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.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:53)
	at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:48)
	at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:138)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:221)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
	at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
	at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.Instant` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.Collections$SingletonList[0]->software.aws.toolkits.jetbrains.core.credentials.ProfileSsoManagedBearerSsoConnection["connectionSettings"]->software.aws.toolkits.core.TokenConnectionSettings["tokenProvider"]->software.aws.toolkits.core.credentials.ToolkitBearerTokenProvider["delegate"]->software.aws.toolkits.jetbrains.core.credentials.sso.bearer.InteractiveBearerTokenProvider["lastToken$jetbrains_community"]->software.aws.toolkits.jetbrains.core.credentials.sso.PKCEAuthorizationGrantToken["expiresAt"])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1330)
	at com.fasterxml.jackson.databind.ser.impl.UnsupportedTypeSerializer.serialize(UnsupportedTypeSerializer.java:35)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeWithType(BeanSerializerBase.java:653)
	at com.fasterxml.jackson.databind.ser.std.ReferenceTypeSerializer.serialize(ReferenceTypeSerializer.java:387)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4799)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:4040)
	at software.aws.toolkits.jetbrains.core.webview.LoginBrowser.writeValueAsString(LoginBrowser.kt:152)
	at software.aws.toolkits.jetbrains.services.amazonq.QWebviewBrowser.prepareBrowser(QLoginWebview.kt:264)
	at software.aws.toolkits.jetbrains.services.amazonq.toolwindow.AmazonQToolWindowFactory.prepareChatContent(AmazonQToolWindowFactory.kt:113)
	at software.aws.toolkits.jetbrains.services.amazonq.toolwindow.AmazonQToolWindowFactory.createToolWindowContent(AmazonQToolWindowFactory.kt:96)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded(ToolWindowImpl.kt:689)
	at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:669)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:1058)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:992)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl$default(ToolWindowManagerImpl.kt:973)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$lambda$34(ToolWindowManagerImpl.kt:1193)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1206)
	at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:224)
	... 45 more

To reproduce

  1. Start IntelliJ
  2. Open a project
  3. Plugin crashes immediately

Expected behavior
Plugin does not crash

Your Environment

IntelliJ IDEA 2024.3.1.1 (Ultimate Edition)
Build #IU-243.22562.218, built on December 17, 2024
Runtime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.5
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
aws.toolkit.core (3.46-243)
org.intellij.scala (2024.3.23)
amazon.q (3.46-243)
Kotlin: 243.22562.218-IJ

@zekeoptimo zekeoptimo added the bug We can reproduce the issue and confirmed it is a bug. label Dec 19, 2024
@zixlin7
Copy link
Contributor

zixlin7 commented Dec 20, 2024

Could you pls try clean your cache by running rm -rf ~/.aws/sso/cache and restart the IDE see if it fixes your issue?

@rli
Copy link
Contributor

rli commented Dec 20, 2024

Repro steps from logged out state:

~/.aws/config contains at least one:

[sso-session ...]
sso_start_url=https://[...].awsapps.com/start
sso_region=[...]
sso_registration_scopes=codewhisperer:[...]

and ~/.aws/sso/cache contains corresponding tokens for the given session.

Confirmed that clearing ~/.aws/sso/cache will workaround underlying issue

@zekeoptimo
Copy link
Author

Repro steps from logged out state:

~/.aws/config contains at least one:

[sso-session ...]
sso_start_url=https://[...].awsapps.com/start
sso_region=[...]
sso_registration_scopes=codewhisperer:[...]

and ~/.aws/sso/cache contains corresponding tokens for the given session.

Confirmed that clearing ~/.aws/sso/cache will workaround underlying issue

This fixed the issue, thank you!

@rli rli pinned this issue Dec 23, 2024
@cronik
Copy link

cronik commented Jan 2, 2025

When using multiple Jetbrains IDE's (i.e. WebStorm and GoLand) with Amazon Q plugin it appears to only work with one at a time.

  1. Open WebStorm, login to Amazon Q
  2. Open GoLand, Amazon Q plugin fails with error reported above (java 8 date not supported)
  3. Close WebStorm and GoLand
  4. Clear ~/.aws/sso/cache
  5. Open GoLand, plugin starts, login to Amazon Q

@rli
Copy link
Contributor

rli commented Jan 10, 2025

Fixed in v3.47

@rli rli closed this as completed Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants