zzehring / intellij-jsonnet

An Intellij Plugin for grafana/jsonnet-language-server
Apache License 2.0
14 stars 12 forks source link

Crashes Goland 2022.3 #39

Open aaahrens opened 1 year ago

aaahrens commented 1 year ago

Close to a vanilla install of goland, crashed on installation on M1 Macbook (16 inch 2022)

Here is the plugin log after fresh install.

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

com.intellij.diagnostic.PluginException: Key org.wso2.lsp4intellij.IntellijLanguageClient duplicated; existingAdapter: ServiceAdapter(descriptor=ServiceDescriptor(interface='null', serviceImplementation='org.wso2.lsp4intellij.IntellijLanguageClient', testServiceImplementation='null', headlessImplementation='null', overrides=false, configurationSchemaKey='null', preload=FALSE, client=null), pluginDescriptor=PluginDescriptor(name=Cadence, id=cadence-language.cadence-for-intellij-platform, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/Toolbox/apps/Goland/ch-0/223.8617.58/GoLand.app.plugins/cadence-for-intellij-platform, version=0.4.4, package=null, isBundled=false)); descriptor: org.wso2.lsp4intellij.IntellijLanguageClient; app: Application  (containerState PRE_INIT) ; current plugin: com.github.zzehring.intellijjsonnet
    at com.intellij.serviceContainer.ComponentManagerImpl.registerServices(ComponentManagerImpl.kt:547)
    at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:259)
    at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:46)
    at com.intellij.idea.ApplicationLoader.doInitApplication(ApplicationLoader.kt:78)
    at com.intellij.idea.ApplicationLoader.access$doInitApplication(ApplicationLoader.kt:1)
    at com.intellij.idea.ApplicationLoader$initApplication$1.invokeSuspend(ApplicationLoader.kt:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at com.intellij.idea.ApplicationLoader.initApplication(ApplicationLoader.kt:61)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    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.idea.C.v(C.java:69)
    at com.intellij.ide.v.r.C6.v(C6.java:135)
    at com.intellij.ide.v.r.CM.C(CM.java:191)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    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.idea.MainImpl.start(MainImpl.kt:60)
    at com.intellij.idea.StartupUtil$startApplication$7.invokeSuspend(StartupUtil.kt:298)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at com.intellij.idea.Main.main(Main.kt:36)

-----
Your JRE: 17.0.5+1-b653.25 aarch64 (JetBrains s.r.o.)
/Users/drunkengranite/Library/Application Support/JetBrains/Toolbox/apps/Goland/ch-0/223.8617.58/GoLand.app/Contents/jbr/Contents/Home

edit: looks like a conflict somehow with another plugin: is weird and would like guidance edit2: gah completely reset plugins and now I'm getting this

java.lang.NullPointerException: Cannot invoke "org.wso2.lsp4intellij.editor.EditorEventManager.getRequestManager()" because "em" is null
    at com.github.zzehring.intellijjsonnet.JsonnetExternalFormatter$JsonnetFormattingTask.run(JsonnetExternalFormatter.kt:40)
    at com.intellij.formatting.service.AsyncDocumentFormattingService$FormattingRequestImpl.runTask(AsyncDocumentFormattingService.java:256)
    at com.intellij.formatting.service.AsyncDocumentFormattingService.runAsyncFormat(AsyncDocumentFormattingService.java:106)
    at com.intellij.formatting.service.AsyncDocumentFormattingService.lambda$formatDocument$0(AsyncDocumentFormattingService.java:91)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:246)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
kg-ops commented 1 year ago
Version: 2022.3.2
Build: 223.8617.48
25 January 2023

On Pycharm

image

zzehring commented 1 year ago

@kg-ops it looks like you have a conflict between this plugin and databricks one (both registering Jsonnet language). I'd recommend removing the databricks plugin and trying again.

@aaahrens Haven't seen this kind of conflict between plugins (aside from databricks one). I'll take a look at that.

I've seen your second error before. Not entirely sure what causes it, but have you tried restarting the language server? That usually puts things right. You can restart it via the green/red/yellow circle at the bottom of IDE. See: image

If you're still getting issues, let me know and I'll dig into it more.

andrein commented 1 year ago

Had the same issue, it was indeed a compatibility issue with the Databricks plugin.

aaahrens commented 1 year ago

@zzehring I'm returning to his plugin after the new release, it's still broken for me

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

java.lang.ExceptionInInitializerError
    at com.github.zzehring.intellijjsonnet.JsonnetFileType.<init>(JsonnetFileType.kt:6)
    at com.github.zzehring.intellijjsonnet.JsonnetFileType.<clinit>(JsonnetFileType.kt:24)
    at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
    at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
    at java.base/jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:42)
    at java.base/jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:185)
    at java.base/java.lang.reflect.Field.acquireFieldAccessor(Field.java:1132)
    at java.base/java.lang.reflect.Field.getFieldAccessor(Field.java:1113)
    at java.base/java.lang.reflect.Field.get(Field.java:425)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.instantiateFileTypeBean(FileTypeManagerImpl.java:494)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.mergeOrInstantiateFileTypeBean(FileTypeManagerImpl.java:463)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.instantiatePendingFileTypes(FileTypeManagerImpl.java:456)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initializeComponent(FileTypeManagerImpl.java:587)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:131)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:46)
    at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:622)
    at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:47)
    at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:39)
    at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154)
    at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
    at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132)
    at com.intellij.serviceContainer.BaseComponentAdapter.access$createInstance(BaseComponentAdapter.kt:19)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invokeSuspend(BaseComponentAdapter.kt:181)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceAsync(BaseComponentAdapter.kt:176)
    at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsyncIfDefined(ComponentManagerImpl.kt:686)
    at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsync(ComponentManagerImpl.kt:677)
    at com.intellij.idea.ApplicationLoader$preloadCriticalServices$2.invokeSuspend(ApplicationLoader.kt:224)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: com.intellij.diagnostic.ImplementationConflictException: Language with ID 'Jsonnet' is already registered: class today.movatech.plugins.jsonnet.h. Conflicting plugins: [com.github.zzehring.intellijjsonnet, today.movatech.plugins.jsonnet]
    at com.intellij.lang.Language.<init>(Language.java:91)
    at com.intellij.lang.Language.<init>(Language.java:67)
    at com.intellij.lang.Language.<init>(Language.java:63)
    at com.github.zzehring.intellijjsonnet.JsonnetLanguage.<init>(JsonnetLanguage.kt:5)
    at com.github.zzehring.intellijjsonnet.JsonnetLanguage.<clinit>(JsonnetLanguage.kt:7)
    ... 39 more

-----
zzehring commented 1 year ago

Looks like this is the issue:

...
Caused by: com.intellij.diagnostic.ImplementationConflictException: Language with ID 'Jsonnet' is already registered: class today.movatech.plugins.jsonnet.h. Conflicting plugins: [com.github.zzehring.intellijjsonnet, today.movatech.plugins.jsonnet]
...

it looks like you have a conflict between this plugin and today.movatech.plugins.jsonnet one (both registering Jsonnet language). I'd recommend removing the other plugin and trying again.

Dinamokid commented 1 year ago

to disable installed plugins on mac use command: open /Applications/Rider.app --args disableNonBundledPlugins

phoebelilius commented 11 months ago

I was unable to find the plugins directory to remove this plugin, thank you @Dinamokid for the above suggestion, only then was I able to remove the plugin from the UI. šŸ‘

to disable installed plugins on mac use command: open /Applications/Rider.app --args disableNonBundledPlugins