ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
535 stars 126 forks source link

Plugin is not installing in IntelliJ 2021 #140

Closed alin-simionoiuDE closed 2 years ago

alin-simionoiuDE commented 3 years ago

This is the error i see when I'm trying to install EnvFile plugin

Screen Shot 2021-06-04 at 11 10 45 AM

any ideas how to get around this?

ashald commented 3 years ago

First time I see this. o_O Could you provide more details about IDE version? Will see if I can reproduce it. You can also try installing it from an archive from releases page.

alin-simionoiuDE commented 3 years ago

version that i'm using is 212.3724.25

this is the error at startup

File '~/Library/Application Support/JetBrains/IntelliJIdea2021.2/plugins/EnvFile/lib/envfile-3.2.1.jar' contains invalid plugin descriptor

unfortunately It doesn't provide any kind of information about "what" exactly is invalid in the plugin descriptor. since this is EAP build of Intellij, I'm not sure if this is a bug in this specific build version or an early sign of something to come

it is interesting that this is the only plugin, from the list of plugins I'm using, that shows this kind of error.

lpouget commented 3 years ago

Hi,

I have exactly the same problem with last EAP.

 IntelliJ IDEA 2021.2 EAP (Ultimate Edition)
Build #IU-212.3724.25, built on June 4, 2021
Runtime version: 11.0.11+9-b1481.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.8.0-53-generic
GC: ParNew, ConcurrentMarkSweep
Non-Bundled Plugins: com.markskelton.one-dark-theme (5.1.6), com.ultrahob.zerolength.plugin2 (0.93), ideanginx9 (0.1.9), org.toml.lang (0.2.147.3871-211), Builder Generator (1.1.8), GrepConsole (11.9.211.6086.0), VisualVMLauncher (1.20.203.4204.0), com.github.oowekyala.javacc (1.8), de.platon42.cajon (1.12), de.u-mass.idea.copyConstructor (1.2), ru.artyushov (1.2.0), MavenRunHelper (4.14.212.000.0)
Kotlin: 212-1.4.32-release-IJ3724.25
Current Desktop: ubuntu:GNOME

and logs during installation:

2021-06-07 10:51:19,547 [1529289]   INFO - Settings.impl.PluginDownloader - PluginDownloader error: Failed to load the plugin descriptor from the downloaded archive. The archive is probably not an IntelliJ plugin. 
2021-06-07 10:51:25,642 [1535384]   INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 57 ms 
2021-06-07 10:51:50,127 [1559869]   WARN - llij.ide.plugins.PluginManager - Cannot load /tmp/plugin13469198310183947550/EnvFile/lib/envfile-3.2.1.jar 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
    at java.base/java.lang.String.charAt(String.java:693)
    at com.intellij.ide.plugins.PluginXmlPathResolver$Companion.toLoadPath$intellij_platform_core_impl(PluginXmlPathResolver.kt:53)
    at com.intellij.ide.plugins.PluginXmlPathResolver.resolvePath(PluginXmlPathResolver.kt:116)
    at com.intellij.ide.plugins.IdeaPluginDescriptorImpl.processOldDependencies(IdeaPluginDescriptorImpl.kt:236)
    at com.intellij.ide.plugins.IdeaPluginDescriptorImpl.readExternal(IdeaPluginDescriptorImpl.kt:197)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromJar(PluginDescriptorLoader.kt:140)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromDirAndNormalize(PluginDescriptorLoader.kt:221)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir(PluginDescriptorLoader.kt:176)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromArtifact(PluginDescriptorLoader.kt:502)
    at com.intellij.openapi.updateSettings.impl.PluginDownloader.prepareToInstallAndLoadDescriptor(PluginDownloader.java:201)
    at com.intellij.openapi.updateSettings.impl.PluginDownloader.prepareToInstallAndLoadDescriptor(PluginDownloader.java:159)
    at com.intellij.ide.plugins.PluginInstallOperation.prepareToInstall(PluginInstallOperation.java:252)
    at com.intellij.ide.plugins.PluginInstallOperation.prepareToInstallWithCallback(PluginInstallOperation.java:224)
    at com.intellij.ide.plugins.PluginInstallOperation.prepareToInstall(PluginInstallOperation.java:196)
    at com.intellij.ide.plugins.PluginInstallOperation.run(PluginInstallOperation.java:136)
    at com.intellij.ide.plugins.newui.MyPluginModel.lambda$installPlugin$8(MyPluginModel.java:415)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:264)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
alin-simionoiuDE commented 3 years ago

yup. there's definitely something wrong here. jebrains dropped a new build 212.4037.9 and EnvFile plugin has the same problem

alin-simionoiuDE commented 3 years ago

found this bug which may be relevant: https://youtrack.jetbrains.com/issue/IDEA-270963

ashald commented 3 years ago

I don't have time for OSS activity right now so appreciate @alins digging it up. I hope it's an issue with EAP and will get fixed in the next IDE release. If plugin has to be rebuilt with newer version of IDEA SDK - will try to release a new version by the end of the month. You should be able to do a local build though if you desperately need it sooner.

doublefx commented 3 years ago

Still happening in:

IntelliJ IDEA 2021.2 Beta (Ultimate Edition) Build #IU-212.4638.7, built on July 6, 2021

alin-simionoiuDE commented 3 years ago

this is interesting...from https://youtrack.jetbrains.com/issue/IDEA-270963

Ben Gruver commented 15 hours ago Yes. For my fusionIdea plugin, I just copy the optional intellij.xml files (or whatever name you give them) to both the META-INF directory and the root in the plugin zip file. And then, in the plugin.xml, you can use, e.g. com.intellij.modules.java

On earlier versions, it will end up using the file in META-INF, and on the current buggy version, it will use the file in the root.

See, e.g. https://github.com/JesusFreke/fusionIdea/commit/31eaa7351cd39913d603fef3c725cfb85d888af6

tsalzinger commented 3 years ago

I made a build working for me locally, which now loads correctly.

After I loaded up the plugin source IDEA immediately complained about 2 of the module IDs for the optional depends:

after changing this it still didn't work though, but then I saw that the java depnedency is declared as optional but without a config-file to load, so I just deleted this entry and then it worked:

Patch updated on 2021-07-20 with fix from comment by alnis

Index: src/main/resources/META-INF/plugin.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
--- a/src/main/resources/META-INF/plugin.xml    (revision bcbce38dd71a91c6334eaacd0c4d1ce47c371474)
+++ b/src/main/resources/META-INF/plugin.xml    (date 1626769083744)
@@ -55,7 +55,6 @@
   <idea-version since-build="183"/>

   <depends>com.intellij.modules.lang</depends>
-  <depends optional="true" config-file="">com.intellij.java</depends>

   <extensionPoints>
     <extensionPoint name="envVarsProvider" beanClass="net.ashald.envfile.platform.EnvVarsProviderExtension">
@@ -74,7 +73,7 @@
   </extensions>

   <depends optional="true" config-file="envfile-idea.xml">com.intellij.modules.lang</depends>
-  <depends optional="true" config-file="envfile-gradle.xml">com.intellij.gradle</depends>
+  <depends optional="true" config-file="envfile-gradle.xml">org.jetbrains.plugins.gradle</depends>
   <depends optional="true" config-file="envfile-pycharm.xml">com.intellij.modules.python</depends>
   <depends optional="true" config-file="envfile-rubymine.xml">com.intellij.modules.ruby</depends>
   <depends optional="true" config-file="envfile-goland.xml">org.jetbrains.plugins.go</depends>

I haven't done any specific testing though and don't have more time today, but I'll try to test this tomorrow (at least for spring applications) and will try to create a PR

I'm currently using IntellIj IDEA Build #IU-212.4746.2

alin-simionoiuDE commented 3 years ago

confirmed!! nice work.

there's a slight problem in your diff. doesn't really matched what you described.

this

-  <depends optional="true" config-file="">com.intellij.java</depends>
+  <depends optional="true" config-file="">com.intellij.modules.java</depends>

should actually be

-  <depends optional="true" config-file="">com.intellij.java</depends>
tsalzinger commented 3 years ago

true, sry - seems I messed up the changes before before creating the diff and I didn't re-check it - I updated the diff

also thanks for confirming / testing the changes - I'll prepare a proper PR then

tsalzinger commented 3 years ago

I did some more digging now and found out that this optional dependency without config file was introduced via PR #107 to fix #100

the main problem I see is that the plugin is officially is still built with platform version 2018.3, but the before mentioned changes only affect builds >= 2019.2 (see https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/).

So while just removing this line seems to fix issues with 2021.2 it might break versions in between - seem I'll have to do some more tests :/

In the long run I guess it would help to update the base platfrom version / build against at least 2019.2 and not offer any updates for older versions any longer. Another approach would be to support only the latest main branch (2021.*) and only backport features / bugfixes to previous platform versions if absolutely required.

In the meantime everyone who want's can use this build of the plugin: EnvFile-3.2.2-SNAPSHOT.zip

As you have to install it locally you have to explicitly trust it as it is not signed - if you don't want to please follow the steps above to build your own version.

ashald commented 3 years ago

Have hard time finding time to get back to this. I don't see an issues with upgrading the base version of the IDE the plugin is built against. I wouldn't use the latest one, but maybe something reasonable a year old or so. The trick here is that, AFAIR, once you license expires, you can continue using your version but won't receive any future update. Don't want to lock out plugins users in such case. Would need to see if the plugin marketplace provides IDE version statistics for installations.

tsalzinger commented 3 years ago

something reasonable a year old or so

that should be fine I guess, but I'm not an expert on it either

Don't want to lock out plugins users in such case.

that won't happen any way - they would still be able to use the old versions of the plugin, it wouldn't jsut vanish for them, they just wouldn't receive any more updates

But the platform upgrade might not be necessary at all, but I didn't find the time yet to check my fixes in any other products then IDEA 2021.2

fehbari commented 3 years ago

Hi @tsalzinger @ashald. Thanks Thomas for attaching your build of the plugin, I was able to install it and get back to work. Huge kudos!

Are we opening a PR for that and updating the plugin in the marketplace?

chrisbroome commented 3 years ago

Confirmed the zip file linked in https://github.com/ashald/EnvFile/issues/140#issuecomment-883210881 fixes the issue.

fgm commented 3 years ago

FWIW the issue is also present in GoLand 2021.2 RC 212.4746.57.

andrewedstrom commented 3 years ago

My team started seeing this today after upgrading IntelliJ to 2021.2 build #IU-212.4746.92

nedmules-sked commented 3 years ago

@andrewedstrom Also confirming that the snapshot build linked above works for me on the official release of IntelliJ 2021.2 build #IU-212.4746.92.

Just install the zip file manually via Settings -> Plugins

Thanks for the fix @tsalzinger

DG007 commented 3 years ago

Confirmed the zip file linked in #140 (comment) fixes the issue.

MichalVasut commented 3 years ago

bug confirmed on

PyCharm 2021.2 (Professional Edition) Build #PY-212.4746.96, built on July 27, 2021

Provided zip (EnvFile-3.2.2-SNAPSHOT.zip) works, thanks @tsalzinger.

MCTrustPower commented 3 years ago

Same bug confirmed here on

IntelliJ IDEA 2021.2 (Ultimate Edition) Build #IU-212.4746.92, built on July 27, 2021

The zip file from @tsalzinger worked perfectly, thanks.

LoLei commented 3 years ago

I must be doing something wrong, after using the zip file mentioned above, the plugin is installed again, but it does not source anything from my .env file. I have re-enabled it in the run configuration. (Pycharm)

MCTrustPower commented 3 years ago

I must be doing something wrong, after using the zip file mentioned above, the plugin is installed again, but it does not source anything from my .env file. I have re-enabled it in the run configuration. (Pycharm)

@LoLei I had to to remove all my old configurations and re-apply them to make them start working.

dcram commented 3 years ago

I also confirm the bug appearing with IntelliJ IDEA 2021.2 Build #IU-212.4746.92, built on July 27, 2021, but after the manual install of the zip file @tsalzinger , I still have no env tab in my Run dialogs.

LoLei commented 3 years ago

@MCTrustPower That didn't fix it but thanks anyway.

dcram commented 3 years ago

That seems to be my error:

ellij.diagnostic.PluginException: Cannot create extension (class=net.ashald.envfile.products.idea.IdeaRunConfigurationExtension) [Plugin: net.ashald.envfile]
    at com.intellij.serviceContainer.ComponentManagerImpl.createError(ComponentManagerImpl.kt:932)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:88)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:458)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.access$200(ExtensionPointImpl.java:32)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl$1.next(ExtensionPointImpl.java:365)
    at com.intellij.execution.configuration.RunConfigurationExtensionsManager.readExternal(RunConfigurationExtensionsManager.kt:206)
    at com.intellij.execution.application.ApplicationConfiguration.readExternal(ApplicationConfiguration.java:335)
    at com.intellij.execution.impl.RunnerAndConfigurationSettingsImplKt.deserializeConfigurationFrom(RunnerAndConfigurationSettingsImpl.kt:610)
    at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.readExternal(RunnerAndConfigurationSettingsImpl.kt:226)
    at com.intellij.execution.impl.RunConfigurationSchemeManager.readData(RunConfigurationSchemeManager.kt:60)
    at com.intellij.execution.impl.RunConfigurationSchemeManager.createScheme(RunConfigurationSchemeManager.kt:43)
    at com.intellij.execution.impl.RunConfigurationSchemeManager.createScheme(RunConfigurationSchemeManager.kt:21)
    at com.intellij.configurationStore.LazySchemeProcessor.createScheme$default(scheme-impl.kt:64)
    at com.intellij.configurationStore.schemeManager.SchemeLoader.loadScheme(schemeLoader.kt:177)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl$loadSchemes$isLoadOnlyFromProvider$2.invoke(SchemeManagerImpl.kt:214)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl$loadSchemes$isLoadOnlyFromProvider$2.invoke(SchemeManagerImpl.kt:42)
    at com.intellij.configurationStore.SchemeManagerIprProvider.processChildren(SchemeManagerIprProvider.kt:48)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl.loadSchemes(SchemeManagerImpl.kt:212)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl.reload(SchemeManagerImpl.kt:273)
    at com.intellij.execution.impl.RunManagerImpl.loadState(RunManagerImpl.kt:792)
    at com.intellij.execution.impl.RunManagerImpl.loadState(RunManagerImpl.kt:68)
    at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:441)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:373)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:124)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:48)
    at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:525)
    at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:52)
    at com.intellij.serviceContainer.ServiceComponentAdapter.access$createAndInitialize(ServiceComponentAdapter.kt:12)
    at com.intellij.serviceContainer.ServiceComponentAdapter$doCreateInstance$1.run(ServiceComponentAdapter.kt:42)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:223)
    at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:41)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:113)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:67)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:60)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:590)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:573)
    at com.intellij.openapi.client.ClientAwareComponentManager.getFromSelfOrCurrentSession(ClientAwareComponentManager.kt:37)
    at com.intellij.openapi.client.ClientAwareComponentManager.getService(ClientAwareComponentManager.kt:22)
    at com.intellij.execution.impl.ProjectRunConfigurationInitializer.serviceCreated(ProjectRunConfigurationInitializer.kt:28)
    at com.intellij.openapi.project.impl.ProjectExImpl$init$$inlined$runOnlyCorePluginExtensions$1.accept(projectLoader.kt:93)
    at com.intellij.openapi.project.impl.ProjectExImpl$init$$inlined$runOnlyCorePluginExtensions$1.accept(projectLoader.kt)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:293)
    at com.intellij.openapi.project.impl.ProjectExImpl.init(ProjectExImpl.kt:292)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.initProject(ProjectManagerImpl.java:178)
    at com.intellij.openapi.project.impl.ProjectManagerExImpl.prepareProject(ProjectManagerExImpl.kt:270)
    at com.intellij.openapi.project.impl.ProjectManagerExImpl.access$prepareProject(ProjectManagerExImpl.kt:57)
    at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:119)
    at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:57)
    at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:94)
    at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:71)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:243)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:243)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: com.intellij.diagnostic.PluginException: Cannot load class net.ashald.envfile.products.idea.IdeaRunConfigurationExtension (
  error: com/intellij/execution/RunConfigurationExtension,
  classLoader=PluginClassLoader(plugin=PluginDescriptor(name=EnvFile, id=net.ashald.envfile, descriptorPath=plugin.xml, path=~/.local/share/JetBrains/IdeaIC2021.2/EnvFile, version=3.2.2-SNAPSHOT, package=null), packagePrefix=null, instanceId=26, state=active)
)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:441)
    at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:275)
    at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:1489)
    at com.intellij.serviceContainer.ComponentManagerImplKt.access$doLoadClass(ComponentManagerImpl.kt:1)
    at com.intellij.serviceContainer.ComponentManagerImpl.loadClass(ComponentManagerImpl.kt:821)
    at com.intellij.openapi.extensions.impl.InterfaceExtensionImplementationClassResolver.resolveImplementationClass(InterfaceExtensionImplementationClassResolver.java:25)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:65)
    ... 65 more
Caused by: java.lang.NoClassDefFoundError: com/intellij/execution/RunConfigurationExtension
    at java.base/java.lang.ClassLoader.defineClass2(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1109)
    at com.intellij.util.lang.UrlClassLoader.consumeClassData(UrlClassLoader.java:290)
    at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:121)
    at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:55)
    at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:217)
    at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:176)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:433)
    ... 71 more
Caused by: java.lang.ClassNotFoundException: com.intellij.execution.RunConfigurationExtension PluginClassLoader(plugin=PluginDescriptor(name=EnvFile, id=net.ashald.envfile, descriptorPath=plugin.xml, path=~/.local/share/JetBrains/IdeaIC2021.2/EnvFile, version=3.2.2-SNAPSHOT, package=null), packagePrefix=null, instanceId=26, state=active)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:254)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 79 more
matthewcornell commented 3 years ago

I love the plugin, and would be very grateful to get a fix :-)

KingMob commented 3 years ago

I'm seeing the same error as @dcram with the downloaded .zip version.

IntelliJ IDEA 2021.2 (Community Edition) Build #IC-212.4746.92, built on July 27, 2021 Runtime version: 11.0.11+9-b1504.13 x86_64

JSorella commented 3 years ago

Hi! Today I was having this same issue with the marketplace version (3.2.1), but I have downloaded the ZIP version (3.2.2-SNAPSHOT) and it worked fine in my system:

PyCharm 2021.2 (Professional Edition)
Build #PY-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-80-generic
antonije commented 3 years ago

Hi! Today I was having this same issue with the marketplace version (3.2.1), but I have downloaded the ZIP version (3.2.2-SNAPSHOT) and it worked fine in my system:

PyCharm 2021.2 (Professional Edition)
Build #PY-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-80-generic

@JSorella Where did you manage to find the ZIP version (3.2.2-SNAPSHOT)?

joaonc commented 3 years ago

@antonije here: https://github.com/ashald/EnvFile/issues/140#issuecomment-889065894 Click the filename to download. In the plugins section, there's an option to install from file, just use that zip.

hound672 commented 3 years ago

@antonije here: #140 (comment) Click the filename to download. In the plugins section, there's an option to install from file, just use that zip.

Thanks! It works

zzdoug commented 2 years ago

Thanks for the fix. I came looking for help after the PyCharm update caused the configuration menu to stop showing the EnvFile option. The zip worked for me on PyCharm 2021.2 (Professional Edition) Build #PY-212.4746.96 after installing from the plugins menu. I did get this alert in the event log but there was no need to take any action. Screenshot from 2021-07-31 15-18-16

tonal commented 2 years ago

bug confirmed on

PyCharm 2021.2 (Professional Edition) Build #PY-212.4746.96, built on July 27, 2021

Provided zip (EnvFile-3.2.2-SNAPSHOT.zip) works, thanks @tsalzinger.

PyCharm 2021.2 (Professional Edition) Build #PY-212.4746.96, built on July 27, 2021 EnvFile-3.2.2-SNAPSHOT.zip work!

mauricio-repetto commented 2 years ago

The snapshot version in the zip provided did the magic for me. Thanks!

sajjadtalebi commented 2 years ago

This is the error i see when I'm trying to install EnvFile plugin

Screen Shot 2021-06-04 at 11 10 45 AM

any ideas how to get around this?

I had a similar problem with this plugin. Until this issue is resolved in the new version, you can copy the contents of your env file instead of using this plugin and paste it through the Edit Configuration in the Environment Variables section. I did this and my problem was solved.

sebastianrothe commented 2 years ago

The snapshot version in the zip provided did the magic for me. Thanks!

Even with this version, the plugin does nothing. The .env variables are not applied.

nenad-lambdas commented 2 years ago

Can confirm that https://github.com/ashald/EnvFile/files/6846706/EnvFile-3.2.2-SNAPSHOT.zip worked with GoLand 2021.2

dooferlad commented 2 years ago

While the snapshot has worked for me, there is an exception being reported:


java.lang.Throwable: Assertion failed: dataContext has no component for new ListPopupStep
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:218)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.createStep(PopupFactoryImpl.java:272)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.<init>(PopupFactoryImpl.java:215)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.<init>(PopupFactoryImpl.java:182)
    at com.intellij.ui.popup.PopupFactoryImpl.createActionGroupPopup(PopupFactoryImpl.java:373)
    at com.jetbrains.rdserver.ui.popup.bePopups.impl.BackendBePopupFactory.createActionGroupPopup(BackendBePopupFactory.kt:67)
    at net.ashald.envfile.platform.ui.EnvFileConfigurationPanel.doAddAction(EnvFileConfigurationPanel.java:244)
    at net.ashald.envfile.platform.ui.EnvFileConfigurationPanel.access$600(EnvFileConfigurationPanel.java:38)
    at net.ashald.envfile.platform.ui.EnvFileConfigurationPanel$4.run(EnvFileConfigurationPanel.java:109)
    at net.ashald.envfile.platform.ui.EnvFileConfigurationPanel$4.run(EnvFileConfigurationPanel.java:106)
    at com.intellij.ui.ToolbarDecorator$3.doAdd(ToolbarDecorator.java:528)
    at com.intellij.ui.CommonActionsPanel$AddButton.actionPerformed(CommonActionsPanel.java:315)
    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:6384)
    at java.desktop/java.awt.Container.processEvent(Container.java:2267)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4995)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2325)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4946)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2311)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2775)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    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:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:886)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:815)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:752)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:442)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:441)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
    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.pumpEventsForFilter(EventDispatchThread.java:117)
    at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:699)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:435)
    at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1726)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1685)
    at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:30)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:240)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:240)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:272)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:236)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:67)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:264)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:98)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:98)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:515)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:545)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6619)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6384)
    at java.desktop/java.awt.Container.processEvent(Container.java:2267)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4995)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2325)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4946)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2311)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2775)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4827)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    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:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:886)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:815)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:752)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:442)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:441)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
    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)```
tptech commented 2 years ago

The snapshot version in the zip provided did the magic for me. Thanks!

Even with this version, the plugin does nothing. The .env variables are not applied.

What format are you using within your .env file?

My standard .env file contains the following format, used by autoenv

export APP_URL=http://localhost:3000
export DATABASE_HOST=192.168.1.23
export DATABASE_PORT=5432

The plugin appears to expect the referenced environment file to be in the following format:

APP_URL=http://localhost:3000
DATABASE_HOST=192.168.1.23
DATABASE_PORT=5432

I have a script that converts my .env file to this other format, and it works for me.

I hope this helps.

Cheers, S t u a r t .

dooferlad commented 2 years ago

I am using a YAML format file, which validates correctly. I hadn't noticed any problems with older versions of the plugin.

eltonsandre commented 2 years ago

Hi guys, I had the same problem with the Intellij update, trying to fix the problem, I forked the project and tweaked it as needed. Here is a version I compiled, compatible with the latest version 212. *. manual installation, hope it helps provisionally.

EnvFile-v3.2.2

lucianolev commented 2 years ago

Hi guys, I had the same problem with the Intellij update, trying to fix the problem, I forked the project and tweaked it as needed. Here is a version I compiled, compatible with the latest version 212. *. manual installation, hope it helps provisionally.

EnvFile-v3.2.2

Version "snapshot" above does work for me on Pycharm 2021.2, but this one does not. It says "com.intellij.java" is not installed, upon installation.

fkrauthan commented 2 years ago

Snapshot version worked for me on Intellij Ultimate 2021.2

Tradunsky commented 2 years ago

The plugin works in regular application run configurations, but does not seem to work in test configurations (tried to create new one as well): image

IntelliJ IDEA 2021.2 (Community Edition)
Build #IC-212.4746.92, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 x86_64
matthewcornell commented 2 years ago

A question: Is this plugin still supported? I see the generous work to create manually-installable versions... Just curious, thanks.

aldenjenkins commented 2 years ago

@matthewcornell I am curious as well

fehbari commented 2 years ago

A question: Is this plugin still supported? I see the generous work to create manually-installable versions... Just curious, thanks.

The author doesn't seem to have time to maintain it anymore. Sadly, he's not around lately for approving PRs, so we're stuck with unmerged fixes. 😞

Please upvote my request to add new maintainers so the community can carry on the work when the author isn't available.

ashald commented 2 years ago

Thanks everyone for investigation and thanks to @tosmun for contributing the fix. I just merged the PR, built a new version and submitted it into JetBrains Marketplace - it should become available within 2 business days.