AntonShuvaev / elasticsearch4idea

Elasticsearch Plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/14512-elasticsearch
59 stars 8 forks source link

Export result of wildcard search error #52

Closed SosthenG closed 2 years ago

SosthenG commented 2 years ago

Hi,

I tried to export the results of a search on a wild card index (GET offers_*/_search) and I had an exception when I clicked the export button (the export window didn't even show up).

See the stacktrace below:

java.nio.file.InvalidPathException: Illegal char <*> at index 22: C:\Users\sosth\offers_*
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
    at java.base/java.nio.file.Path.of(Path.java:147)
    at org.elasticsearch4idea.kH.a(ExportDataDialog.kt:5229)
    at org.elasticsearch4idea.kH$i.invoke(ExportDataDialog.kt:1198)
    at com.intellij.ui.layout.RowBuilder$DefaultImpls.row(Row.kt:46)
    at com.intellij.ui.layout.Row.row(Row.kt:112)
    at com.intellij.ui.layout.migLayout.MigLayoutRow.row(MigLayoutRow.kt:539)
    at com.intellij.ui.layout.LayoutBuilder.row(LayoutBuilder.kt)
    at com.intellij.ui.layout.RowBuilder$DefaultImpls.row$default(Row.kt:45)
    at org.elasticsearch4idea.kH.<init>(ExportDataDialog.kt:1196)
    at org.elasticsearch4idea.kq.actionPerformed(ExportDataAction.kt:34)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:171)
    at com.intellij.openapi.actionSystem.impl.ActionButton.lambda$performAction$0(ActionButton.java:150)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:150)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:427)
    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:2784)
    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:887)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:816)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:443)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:442)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:494)
    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)

Thanks!

AntonShuvaev commented 2 years ago

Hi, I think removing * from the file name should help. I will fix this to not use * in the generated file name in wildcard requests.

SosthenG commented 2 years ago

Problem is I can't change the file name because the export window does not open, the error happens before I can even change the name of the file. Thanks, I'll be waiting for the fix!

AntonShuvaev commented 2 years ago

Fixed