aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
749 stars 216 forks source link

Amazon Q plugin 3.9-241 prevents DataGrip from connecting to any database #4557

Closed ospinad closed 3 months ago

ospinad commented 3 months ago

Describe the bug While the Amazon Q plugin is enabled, I cannot connect to a database.

To reproduce Steps to reproduce the behavior:

  1. Go to Plugin Settings
  2. Enable Amazon Q plugin
  3. Select Database under Data Sources
  4. No Error message, it just doesn't connect.

Expected behavior When I select a database from a scratch file it is supposed to connect to the database and give me the option to select schema. When I select a MySQL data source, it should connect automatically to the specified database and only give me the option to select a schema.

Screenshots Selecting a database from a scratch file image

When plugin is disabled, connection works and gives me the option to choose a schema. image

When plugin is enabled, nothing happens. image

Selecting a MySQL data source gives the schema option when the plugin is disabled image

Selecting a MySQL data source when the plugin is enabled gives no schema option image

Your Environment

Additional context The problem only occurs when the Amazon Q plugin is enabled. AWS Core and AWS Toolkit remaining enabled doesn't cause the problem. The problem started occurring when I updated the AWS plugins to the 3.9-241 version today. image

rli commented 3 months ago

Related https://github.com/aws/aws-toolkit-jetbrains/issues/4554

rli commented 3 months ago
java.lang.RuntimeException: Cannot invoke (class=, method=fileOpened, topic=FileEditorManagerListener)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:677)
    at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:423)
    at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:402)
    at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
    at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:461)
    at jdk.proxy2/jdk.proxy2.$Proxy90.fileOpened(Unknown Source)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$openFileInEdt$3.invokeSuspend(FileEditorManagerImpl.kt:2220)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:43)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
    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:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:395)
    at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:153)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:131)
    at com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:12)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:131)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:47)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:119)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:115)
    at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:83)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:115)
    at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:178)
    at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:103)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.doOpenFile(FileEditorManagerImpl.kt:818)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFile(FileEditorManagerImpl.kt:804)
    at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.kt:149)
    at com.intellij.database.editor.DatabaseEditorHelper.openConsoleForFile(DatabaseEditorHelper.java:691)
    at com.intellij.database.editor.DatabaseEditorHelper.openConsoleFile(DatabaseEditorHelper.java:684)
    at com.intellij.database.editor.DatabaseEditorHelper.openConsoleFile(DatabaseEditorHelper.java:676)
    at com.intellij.database.actions.OpenConsoleAction$CreateNew.actionPerformedInner(OpenConsoleAction.java:153)
    at com.intellij.database.actions.OpenConsoleAction.actionPerformed(OpenConsoleAction.java:77)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:304)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks$lambda$4(ActionUtil.kt:275)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1161)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.kt:274)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction$lambda$5(ActionMenuItem.kt:269)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:227)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.kt:260)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem._init_$lambda$0(ActionMenuItem.kt:71)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed$lambda$4(ActionMenuItem.kt:102)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.kt:101)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:525)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:558)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
    at java.desktop/java.awt.Component.processEvent(Component.java:6422)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4969)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4583)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4524)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:699)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:638)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:584)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:584)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    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: java.lang.NullPointerException: getVirtualFile(...) must not be null
    at software.aws.toolkits.jetbrains.services.codewhisperer.codescan.listeners.CodeWhispererCodeScanFileListener.editorCreated(CodeWhispererCodeScanFileListener.kt:18)
    at jdk.internal.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:119)
    at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:84)
    at jdk.proxy2/jdk.proxy2.$Proxy142.editorCreated(Unknown Source)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.doCreateEditor(EditorFactoryImpl.java:228)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:203)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:158)
    at com.intellij.execution.console.ConsoleExecutionEditor.<init>(ConsoleExecutionEditor.java:46)
    at com.intellij.execution.console.LanguageConsoleImpl.<init>(LanguageConsoleImpl.java:100)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl$MyLanguageConsoleImpl.<init>(DatabaseSessionViewServiceImpl.kt:82)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl$MyLanguageConsoleImpl.<init>(DatabaseSessionViewServiceImpl.kt:91)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl$getView$1.invoke(DatabaseSessionViewServiceImpl.kt:33)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl$getView$1.invoke(DatabaseSessionViewServiceImpl.kt:30)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl.getView$lambda$0(DatabaseSessionViewServiceImpl.kt:30)
    at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1220)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl.getView(DatabaseSessionViewServiceImpl.kt:30)
    at com.intellij.database.console.session.DatabaseSessionViewServiceImpl.initView(DatabaseSessionViewServiceImpl.kt:41)
    at com.intellij.database.console.session.MessageBusSession.attach$lambda$0(MessageBusSession.kt:165)
    at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33)
    at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:1983)
    at com.intellij.database.console.session.MessageBusSession.attach(MessageBusSession.kt:165)
    at com.intellij.database.console.JdbcConsole.<init>(JdbcConsole.java:260)
    at com.intellij.database.console.JdbcConsole$ScriptingDatabaseSessionClientHolder.createClientInner(JdbcConsole.java:726)
    at com.intellij.database.console.JdbcConsole$ScriptingDatabaseSessionClientHolder.createClientInner(JdbcConsole.java:713)
    at com.intellij.database.console.client.SessionClientHolder.createClient(SessionClientHolder.java:62)
    at com.intellij.database.console.JdbcConsole$Builder.build(JdbcConsole.java:223)
    at com.intellij.database.console.JdbcConsoleProvider.createConsole(JdbcConsoleProvider.java:497)
    at com.intellij.database.console.JdbcConsoleProvider.attachConsole(JdbcConsoleProvider.java:466)
    at com.intellij.database.editor.DatabaseEditorHelper.restoreAttachedConsole(DatabaseEditorHelper.java:331)
    at com.intellij.database.editor.DatabaseEditorHelper$1.fileOpened(DatabaseEditorHelper.java:126)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:700)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:660)
    ... 130 more
ospinad commented 3 months ago

Version 3.10-241 was just released and it fixed the problem.