Skip to content

java.lang.NullPointerException: Cannot invoke "org.elasticsearch4idea.em.a()" because "this.a" is null #163

@sdokara

Description

@sdokara

Description
The plugin is no longer able to execute REST API requests nor show data in table view. The IDE shows an unhandled exception dialog with the following stack trace:

java.lang.NullPointerException: Cannot invoke "org.elasticsearch4idea.em.a()" because "this.a" is null
	at org.elasticsearch4idea.en.getFindModel(SourceFile:84)
	at com.intellij.find.editorHeaderActions.PrevNextOccurrenceAction.getShortcut(PrevNextOccurrenceAction.java:38)
	at com.intellij.find.SearchReplaceComponent.updateBindings(SearchReplaceComponent.java:737)
	at com.intellij.find.SearchReplaceComponent.updateBindings(SearchReplaceComponent.java:725)
	at com.intellij.find.SearchReplaceComponent.updateBindings(SearchReplaceComponent.java:717)
	at com.intellij.find.SearchReplaceComponent.updateBindingsActionsAndFocus(SearchReplaceComponent.java:546)
	at com.intellij.find.SearchReplaceComponent.updateInner(SearchReplaceComponent.java:542)
	at com.intellij.find.SearchReplaceComponent.<init>(SearchReplaceComponent.java:332)
	at com.intellij.find.SearchReplaceComponent$Builder.build(SearchReplaceComponent.java:876)
	at org.elasticsearch4idea.en.a(SourceFile:67)
	at org.elasticsearch4idea.en.<init>(SourceFile:22)
	at org.elasticsearch4idea.et.<init>(SourceFile:195)
	at org.elasticsearch4idea.eu.<init>(SourceFile:116)
	at org.elasticsearch4idea.ew.a(SourceFile:64)
	at org.elasticsearch4idea.ew.b(SourceFile:92)
	at org.elasticsearch4idea.ew.b(SourceFile:85)
	at org.elasticsearch4idea.aZ.a(SourceFile:461)
	at com.intellij.openapi.application.ActionsKt.invokeLater$lambda$5(actions.kt:57)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:26)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:202)
	at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)
	at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:666)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:640)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:633)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1022)
	at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:574)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
	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:595)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)
	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)

Can't remember if I updated the plugin or IDE before experiencing this. If your versioning scheme's 242 refers to the Platform Plugin SDK version, then I probably have a mismatch there. Should I try downgrading PyCharm?

Tried reinstalling and invalidating caches, didn't help.

Steps to reproduce
Trying to query any index via REST console or Table view produces this.

Expected behavior
It should work, I guess.

Environment information:

  • OS: Windows 10 22H2
  • IDE version: PyCharm 2025.2.4, Build #PY-252.27397.106
  • plugin version: 2025.1.1-242
  • Elasticsearch or OpenSearch version: Elasticsearch 8.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions