apache / apache/grails-intellij-plugin

Can't run grails configuration on WSL2, Cannot run program "\\wsl$\... CreateProcess error=1921, The name of the file cannot be resolved by the system"

Open
#363 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

***What steps will reproduce the issue?***
1. Open a grails project located in WSL2
2. Run/Debug the main grails configuration

_⚠️ attachment `image3.png` was not included in the export_

_⚠️ attachment `image1.png` was not included in the export_

***What is the expected result?***
The app starts through `grails run-app`

***What happens instead?***
IntelliJ displays an error
_⚠️ attachment `image.png` was not included in the export_

I managed to run the app through a Gradle configuration, but the debugging experience is not as good at all.

_⚠️ attachment `image2.png` was not included in the export_
Logs:
```
2021-04-20 08:48:29,863 [1854405] INFO - xecution.runners.ExecutionUtil - Error running 'Grails: covid30':
Cannot run program "\\wsl$\Ubuntu-20.04\usr\lib\jvm\java-8-openjdk-amd64\bin\java" (in directory "\\wsl$\Ubuntu-20.04\home\\projects\covid30"): CreateProcess error=1921, The name of the file cannot be resolved by the system
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "\\wsl$\Ubuntu-20.04\usr\lib\jvm\java-8-openjdk-amd64\bin\java" (in directory "\\wsl$\Ubuntu-20.04\home\\projects\covid30"): CreateProcess error=1921, The name of the file cannot be resolved by the system
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:385)
at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:100)
at com.intellij.execution.process.OSProcessHandler.(OSProcessHandler.java:48)
at com.intellij.execution.process.KillableProcessHandler.(KillableProcessHandler.java:37)
at com.intellij.execution.process.ColoredProcessHandler.(ColoredProcessHandler.java:23)
at com.intellij.execution.process.KillableColoredProcessHandler.(KillableColoredProcessHandler.java:28)
at com.intellij.execution.process.KillableColoredProcessHandler.(KillableColoredProcessHandler.java:21)
at org.jetbrains.plugins.grails.runner.impl.BaseGrailsCommandLineState.startProcess(BaseGrailsCommandLineState.kt:17)
at org.jetbrains.plugins.grails.runner.impl.GrailsCommandLineState.startProcess(GrailsCommandLineState.java:116)
at org.jetbrains.plugins.grails.runner.impl.GrailsCommandLineState.startProcess(GrailsCommandLineState.java:27)
at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:61)
at org.jetbrains.plugins.grails.runner.impl.GrailsRunAppCommandLineState.execute(GrailsRunAppCommandLineState.kt:20)
at com.intellij.execution.runners.DefaultRunProgramRunner$execute$1.invoke(DefaultRunProgramRunner.kt:29)
at com.intellij.execution.runners.DefaultRunProgramRunner$execute$1.invoke(DefaultRunProgramRunner.kt:12)
at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:168)
at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:68)
at com.intellij.execution.impl.ExecutionManagerImpl$doStartRunProfile$startRunnable$1.run(ExecutionManagerImpl.kt:229)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:218)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:200)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:319)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
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)
Caused by: java.io.IOException: Cannot run program "\\wsl$\Ubuntu-20.04\usr\lib\jvm\java-8-openjdk-amd64\bin\java" (in directory "\\wsl$\Ubuntu-20.04\home\\projects\covid30"): CreateProcess error=1921, The name of the file cannot be resolved by the system
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:458)
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:381)
... 45 more
Caused by: java.io.IOException: CreateProcess error=1921, The name of the file cannot be resolved by the system
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:478)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
... 48 more
```

---

*4 attachment(s) referenced here (`image3.png`, `image1.png`, `image.png`, `image2.png`) are not part of the CSV export.*
*Imported from [IDEA-267463](https://youtrack.jetbrains.com/issue/IDEA-267463) · Type: Bug · Votes: 5*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Grails run/debug configuration with a project stored in WSL2, then trace the stack from org.jetbrains.plugins.grails.runner.impl.BaseGrailsCommandLineState through GrailsCommandLineState to GeneralCommandLine.createProcess. Done means the configuration starts the app like grails run-app and supports debugging without the reported CreateProcess error=1921.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.