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

Unable to edit DataSource using SecretsManager Auth #2403

Closed
rgustafson-ie opened this issue Feb 1, 2021 · 10 comments
Closed

Unable to edit DataSource using SecretsManager Auth #2403

rgustafson-ie opened this issue Feb 1, 2021 · 10 comments
Labels
bug We can reproduce the issue and confirmed it is a bug.

Comments

@rgustafson-ie
Copy link

Describe the bug
Unable to edit Data Source properties after creation.

To reproduce

  1. Open the Create Data Source dialog.
  2. Under Authentication select "SecretsManager Auth"
  3. Click "Apply", as the dialog does not update properly when changing Authentication to this choice.
  4. Enter the appropriate SecretsManager Secret ARN. Select appropriate Credentials and Region. Check use url and port from secret.
  5. Click Test Connection to confirm it works.
  6. Click Okay.
  7. Try various ways to Edit the newly created Data Source. All fail. Clicking "Data Source Properties" icon fails. Trying to edit by selecting in the list of existing Data Sources in the creation dialog fails, including the name blanking out and the detail pane appearing mostly empty.

Expected behavior
To be able to edit the Data Source configuration as when initially creating it.

Screenshots
N/A

Your Environment

  • OS: MacOS
  • JetBrains product: IDEA
  • JetBrains product version: 2020.3.2 (ultimate)
  • AWS Toolkit version: 1.22-204
  • SAM CLI version: N/A
  • JVM/Python version:
    IntelliJ IDEA 2020.3.2 (Ultimate Edition)
    Build #IU-203.7148.57, built on January 25, 2021
    Runtime version: 11.0.9.1+11-b1145.77 x86_64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    macOS 10.15.7
    GC: ParNew, ConcurrentMarkSweep
    Memory: 3005M
    Cores: 8

Additional context
N/A

@rgustafson-ie rgustafson-ie added the bug We can reproduce the issue and confirmed it is a bug. label Feb 1, 2021
@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

Does it work if you go through the AWS Explorer->RDS tree?

Screen Shot 2021-02-01 at 4 12 52 PM

@rgustafson-ie
Copy link
Author

I wasn't aware of that route in the UI. Unfortunately, no, as they don't even show there, the RDS tree is empty. Other subtrees populate fine. RDS does present "Connect with Secrets Manager..." upon right-click, but none of the secrets work. I see the following exception in the "IDE Fatal Errors" in the lower right corner (a red circle with exclamation point):

java.lang.NullPointerException
	at com.intellij.database.dataSource.DatabaseCredentialsAuthProvider$UserWidget.onChanged(DatabaseCredentialsAuthProvider.java:453)
	at com.intellij.database.dataSource.url.ui.DatabaseAuthPanel.applyAuthProvider(DatabaseAuthPanel.java:97)
	at com.intellij.database.dataSource.url.ui.DatabaseAuthPanel$3.itemStateChanged(DatabaseAuthPanel.java:88)
	at java.desktop/javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1227)
	at java.desktop/javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1279)
	at java.desktop/javax.swing.JComboBox.contentsChanged(JComboBox.java:1335)
	at java.desktop/javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:123)
	at com.intellij.ui.CollectionComboBoxModel.update(CollectionComboBoxModel.java:49)
	at com.intellij.ui.CollectionComboBoxModel.setSelectedItem(CollectionComboBoxModel.java:33)
	at java.desktop/javax.swing.JComboBox.setSelectedItem(JComboBox.java:579)
	at com.intellij.database.dataSource.url.ui.DatabaseAuthPanel.reset(DatabaseAuthPanel.java:130)
	at com.intellij.database.dataSource.url.ui.DynamicJdbcUrlEditor.reset(DynamicJdbcUrlEditor.java:465)
	at com.intellij.database.dataSource.DataSourceGeneralPanel.reset(DataSourceGeneralPanel.java:70)
	at com.intellij.database.dataSource.DataSourceConfigurable.reset(DataSourceConfigurable.java:549)
	at com.intellij.database.dataSource.DataSourceConfigurable.lambda$init$11(DataSourceConfigurable.java:537)
	at com.intellij.openapi.options.SettingsEditor.bulkUpdate(SettingsEditor.java:84)
	at com.intellij.database.dataSource.DataSourceConfigurable.init(DataSourceConfigurable.java:537)
	at com.intellij.database.view.ui.SidePanelItem.createConfigurable(SidePanelItem.java:127)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.createEditorIfNeeded(DatabaseConfigEditorImpl.java:707)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.setSelectedEditor(DatabaseConfigEditorImpl.java:717)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.navigateTo(DatabaseConfigEditorImpl.java:330)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.navigateTo(DatabaseConfigEditorImpl.java:1391)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.resetTreeModel(DatabaseConfigEditorImpl.java:444)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.resetEditorFrom(DatabaseConfigEditorImpl.java:389)
	at com.intellij.database.view.ui.DatabaseConfigEditorImpl.resetEditorFrom(DatabaseConfigEditorImpl.java:95)
	at com.intellij.openapi.options.SettingsEditor.lambda$resetFrom$0(SettingsEditor.java:76)
	at com.intellij.openapi.options.SettingsEditor.bulkUpdate(SettingsEditor.java:84)
	at com.intellij.openapi.options.SettingsEditor.resetFrom(SettingsEditor.java:74)
	at com.intellij.openapi.options.SettingsEditorConfigurable.reset(SettingsEditorConfigurable.java:39)
	at com.intellij.openapi.options.ex.SingleConfigurableEditor.<init>(SingleConfigurableEditor.java:56)
	at com.intellij.openapi.options.ex.SingleConfigurableEditor.<init>(SingleConfigurableEditor.java:78)
	at com.intellij.openapi.options.ex.SingleConfigurableEditor.<init>(SingleConfigurableEditor.java:93)
	at com.intellij.openapi.options.ex.SingleConfigurableEditor.<init>(SingleConfigurableEditor.java:105)
	at com.intellij.database.view.ui.DataSourceManagerDialog.<init>(DataSourceManagerDialog.java:48)
	at com.intellij.database.view.ui.DataSourceManagerDialog.showDialog(DataSourceManagerDialog.java:116)
	at com.intellij.database.autoconfig.DataSourceRegistry.showDialog(DataSourceRegistry.java:60)
	at software.aws.toolkits.jetbrains.datagrip.actions.AddSecretsManagerConnection.actionPerformed(AddSecretsManagerConnection.kt:51)
	at software.aws.toolkits.jetbrains.core.explorer.actions.SingleExplorerNodeAction.actionPerformed(AbstractActions.kt:57)
	at software.aws.toolkits.jetbrains.core.explorer.actions.ExplorerNodeAction.actionPerformed(AbstractActions.kt:82)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:281)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:310)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:286)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:299)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:110)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:110)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:514)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:544)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:911)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:840)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

Thank you for the stack trace.

Can you tell me more about what you are trying to connect to, like what is the DB engine and version?

@rgustafson-ie
Copy link
Author

It's an Aurora Postgres 10.12 Serverless v1 cluster. Access to the VPC is fine, I can run queries, browse the schema, etc. I just cannot edit the Data Source after I create it, so I've got to set it up right first shot, otherwise delete and retry. 😬

@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

Checking our RDS Engines file that should work unless they changed the engine name:

object AuroraPostgres : PostgresBase(setOf("aurora-postgresql"), additionalInfo = message("rds.aurora"))

@hunterwerlla I forget..were there issues with Serverless?

@rgustafson-ie
Copy link
Author

Serverless V1 - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.relnotes.html

How sensitive are you to the secret values? The engine attribute is postgres, and it looks like they've recently added a dbClusterIdentifier attribute.

@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

How sensitive are you to the secret values? The engine attribute is postgres, and it looks like they've recently added a dbClusterIdentifier attribute.

The JSON blob in the secret? Our logic is coded to match the following fields:

data class SecretsManagerDbSecret(
    val username: String?,
    val password: String?,
    val engine: String?,
    val host: String?,
    val port: String?
)

I'll have to spin up a db to play with it to figure out what is breaking down where. The fact that it is not showing in the explorer has me concerned.

@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

It looks like we used the wrong API 😄

DescribeDBInstances (what we use) hides serverless, we need to switch to DescribeDBClusters.

@abrooksv
Copy link
Contributor

abrooksv commented Feb 2, 2021

I am also seeing the same NullPointer, but its down in the DataGrip code, so will take longer to figure out whats wrong there.

@abrooksv
Copy link
Contributor

abrooksv commented Feb 4, 2021

Traced the NPE, it is a regression in IntelliJ 2020.3.2 (maybe .1?), working on a fix for our next release.

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

2 participants