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

Plugin throws exception on IDE startup #293

Closed
daviddenton opened this issue Sep 17, 2024 · 5 comments
Closed

Plugin throws exception on IDE startup #293

daviddenton opened this issue Sep 17, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@daviddenton
Copy link

Have tried uninstall/reinstall to no avail.

Exception

com.intellij.diagnostic.PluginException: Cannot init component state (componentName=com.devoxx.genie.ui.SettingsState, componentClass=DevoxxGenieStateService) [Plugin: com.devoxx.genie]
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:185)
	at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:46)
	at com.intellij.serviceContainer.ComponentManagerImpl.initializeService$intellij_platform_serviceContainer(ComponentManagerImpl.kt:651)
	at com.intellij.serviceContainer.ServiceInstanceInitializer.createInstance$suspendImpl(ServiceInstanceInitializer.kt:70)
	at com.intellij.serviceContainer.ServiceInstanceInitializer.createInstance(ServiceInstanceInitializer.kt)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:162)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.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.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:160)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:27)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:90)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.initialize(LazyInstanceHolder.kt:145)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.access$initialize(LazyInstanceHolder.kt:13)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.tryInitialize(LazyInstanceHolder.kt:135)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstance(LazyInstanceHolder.kt:95)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext$suspendImpl(LazyInstanceHolder.kt:87)
	at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext(LazyInstanceHolder.kt)
	at com.intellij.serviceContainer.ComponentManagerImplKt$doGetOrCreateInstanceBlocking$1.invokeSuspend(ComponentManagerImpl.kt:1568)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:111)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$BuildersKt__BuildersKt(Builders.kt:84)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:52)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1686)
	at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1677)
	at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:85)
	at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:1677)
	at com.intellij.serviceContainer.ComponentManagerImplKt.doGetOrCreateInstanceBlocking(ComponentManagerImpl.kt:1567)
	at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1562)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:746)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)
	at com.devoxx.genie.ui.settings.DevoxxGenieStateServiceProvider.getDevoxxGenieSettingsService(DevoxxGenieStateServiceProvider.java:11)
	at com.devoxx.genie.service.DevoxxGenieSettingsServiceProvider.getInstance(DevoxxGenieSettingsServiceProvider.java:15)
	at com.devoxx.genie.service.ChatMemoryService.init(ChatMemoryService.java:34)
	at com.devoxx.genie.service.PostStartupActivity.execute(PostStartupActivity.java:15)
	at com.intellij.ide.startup.impl.StartupManagerImplKt$launchActivity$1.invokeSuspend(StartupManagerImpl.kt:496)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Caused by: java.util.NoSuchElementException: No value present
	at java.base/java.util.Optional.orElseThrow(Optional.java:377)
	at com.devoxx.genie.service.DevoxxGenieSettingsServiceProvider.getInstance(DevoxxGenieSettingsServiceProvider.java:22)
	at com.devoxx.genie.chatmodel.openrouter.OpenRouterChatModelFactory.getApiKey(OpenRouterChatModelFactory.java:60)
	at com.devoxx.genie.service.LLMModelRegistryService.addOpenRouterModels(LLMModelRegistryService.java:549)
	at com.devoxx.genie.service.LLMModelRegistryService.getModels(LLMModelRegistryService.java:543)
	at com.devoxx.genie.util.DefaultLLMSettingsUtil.initializeDefaultCosts(DefaultLLMSettingsUtil.java:18)
	at com.devoxx.genie.ui.settings.DevoxxGenieStateService.initializeDefaultCostsIfEmpty(DevoxxGenieStateService.java:175)
	at com.devoxx.genie.ui.settings.DevoxxGenieStateService.loadState(DevoxxGenieStateService.java:130)
	at com.devoxx.genie.ui.settings.DevoxxGenieStateService.loadState(DevoxxGenieStateService.java:23)
	at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:593)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:493)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:160)
	... 51 more

Plugin: 0.2.20

IDE:

Build #IU-242.20224.300, built on August 6, 2024
Licensed to *****
Subscription is active until May 17, 2025.
For non-commercial open source development only.
Runtime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 8192M
Cores: 12
Metal Rendering is ON
Registry:
  ide.balloon.shadow.size=0
  debugger.new.tool.window.layout=true
  documentation.show.toolbar=true
  ide.new.editor.tabs.vertical.borders=true
  ide.animate.toolwindows=true
  ide.experimental.ui=true
  ide.editor.tab.selection.animation=true
Non-Bundled Plugins:
  org.intellij.plugins.hcl (242.20224.159)
  PythonCore (242.20224.300)
  com.jetbrains.darkPurpleTheme (1.3)
  org.jetbrains.settingsRepository (242.20224.155)
  PlantUML integration (7.11.2-IJ2023.2)
  org.jetbrains.plugins.go-template (242.20224.155)
  com.markskelton.one-dark-theme (5.11.0)
  DevKit (242.20224.419)
  org.jetbrains.plugins.workspace (242.20224.159)
  org.plugin.dot.id (1.5.4)
  com.arcticicestudio.nord.jetbrains (0.13.0)
  com.devoxx.genie (0.2.20)
  hu.hawser.co-author-plugin (2.3)
  org.mvnsearch.plugins.justPlugin (0.5.1)
  Pythonid (242.20224.419)
  net.ashald.envfile (3.4.2)
  com.intellij.mermaid (0.0.22+IJ.232)
  org.asciidoctor.intellij.asciidoc (0.43.1)
  com.github.s4nchez.okeydoke.idea (0.6.2)
  com.dmarcotte.handlebars (242.20224.159)
  com.chrisrm.idea.MaterialThemeUI (9.4.1)
  com.github.copilot (1.5.22.6765)
  com.mallowigi (97.0.0)
  mobi.hsz.idea.gitignore (4.5.3)
  http4k.project.wizard (1.5.0)
  com.github.hugohomesquita.htmxjetbrains (0.0.10)
Kotlin: 242.20224.300-IJ
@stephanj stephanj self-assigned this Sep 19, 2024
@stephanj stephanj added the bug Something isn't working label Sep 19, 2024
@stephanj
Copy link
Contributor

Hey, can you install this version of the plugin : Settings | Plugins | Install Plugin from Disk...

DevoxxGenie-0.2.21.zip

@daviddenton
Copy link
Author

Still an error I'm afraid...

image

@stephanj
Copy link
Contributor

For the moment I'm unable to replicate the issue, can you try a few things?

  1. Are you using OpenRouter as the "default" LLM? If not, can you add a dummy API Key for that one?

  2. Maybe the DevoxxGenieSettingsPlugin.xml is corrupt?

Can you quit IDEA and rename the DevoxxGenieSettingsPlugin.xml

mv ~/Library/Application Support/JetBrains/IntelliJIdea2024.2/options/DevoxxGenieSettingsPlugin.xml DevoxxGenieSettingsPlugin.xml.bak

Now restart IDEA, all your API KEYS will be removed but you'll get a fresh new settings xml file.

Thanks for reporting and helping find the issue/solution :)

@daviddenton
Copy link
Author

Moving that file seems to have worked. The contents were only:

<application>
  <component name="com.devoxx.genie.ui.SettingsState">
    <option name="selectedProvider" value="Ollama" />
  </component>
</application>

@stephanj
Copy link
Contributor

stephanj commented Sep 20, 2024

Great, probably a corrupt settings.xml file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants