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
552 stars 128 forks source link

Error when run a configuration in Goland 2022.3 #205

Open guilhermedalmarco opened 1 year ago

guilhermedalmarco commented 1 year ago

I've upgraded my Goland using ToolBox and after that when I try to run any configuration that is using EnvFile I got this error and I need to restart the IDE:

java.lang.RuntimeException: Failed to patch command line
    at com.goide.execution.extension.GoRunConfigurationExtensionsManager.lambda$patchCommandLine$1(GoRunConfigurationExtensionsManager.java:60)
    at com.intellij.execution.configuration.RunConfigurationExtensionsManager.processEnabledExtensions(RunConfigurationExtensionsManager.kt:228)
    at com.goide.execution.extension.GoRunConfigurationExtensionsManager.patchCommandLine(GoRunConfigurationExtensionsManager.java:55)
    at com.goide.execution.GoRunningState.lambda$patchCommandLine$5(GoRunningState.java:350)
    at com.goide.util.GoLocalEnvironmentRequest$GoLocalRemoteEnvironment.createGeneralCommandLine(GoLocalEnvironmentRequest.java:143)
    at com.intellij.execution.target.local.LocalTargetEnvironment.createProcess(LocalTargetEnvironment.java:129)
    at com.goide.util.GoExecutor$3.getProcessHandler(GoExecutor.java:579)
    at com.goide.util.GoExecutor$3.run(GoExecutor.java:531)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:425)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:476)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:190)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:666)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:622)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:590)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:177)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    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)
Caused by: com.intellij.execution.ExecutionException: java.io.IOException: Cannot run program "/Users/guilhermedalmarco/Development/Repositories/traive-finance/financial-business-and-commerce/pricing-api-service/.env-example": error=13, Permission denied
    at net.ashald.envfile.platform.EnvFileEnvironmentVariables.render(EnvFileEnvironmentVariables.java:76)
    at net.ashald.envfile.products.goland.GolandRunConfigurationExtension.patchCommandLine(GolandRunConfigurationExtension.java:37)
    at com.goide.execution.extension.GoRunConfigurationExtensionsManager.lambda$patchCommandLine$1(GoRunConfigurationExtensionsManager.java:57)
    ... 27 more
Caused by: net.ashald.envfile.exceptions.InvalidEnvFileException: java.io.IOException: Cannot run program "/Users/guilhermedalmarco/Development/Repositories/traive-finance/financial-business-and-commerce/pricing-api-service/.env-example": error=13, Permission denied
    at net.ashald.envfile.providers.EnvFileExecutor$ReadStdoutAsUtf8.execute(EnvFileExecutor.java:56)
    at net.ashald.envfile.providers.SingleFileEnvVarsProvider.execute(SingleFileEnvVarsProvider.java:45)
    at net.ashald.envfile.providers.SingleFileEnvVarsProvider.getEnvVars(SingleFileEnvVarsProvider.java:38)
    at net.ashald.envfile.platform.EnvFileEnvironmentVariables.render(EnvFileEnvironmentVariables.java:67)
    ... 29 more
Caused by: java.io.IOException: Cannot run program "/Users/guilhermedalmarco/Development/Repositories/traive-finance/financial-business-and-commerce/pricing-api-service/.env-example": error=13, Permission denied
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
    at net.ashald.envfile.providers.EnvFileExecutor$ReadStdoutAsUtf8.execute(EnvFileExecutor.java:44)
    ... 32 more
Caused by: java.io.IOException: error=13, Permission denied
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
    ... 34 more
xmeehan commented 1 year ago

In the list of envfiles there is a column of checkboxes for "Executable" next to each file. Is that checked next to your file? If so, try unchecking it.

cmmoran commented 1 year ago

Shot in the dark, but can you take a look at the .env-example file and see if the execution bit is set?