bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Launching server using command dotnet failed.

Open lr90 opened this issue 6 years ago • 18 comments

Does this occur consistently? Yes Repro steps:

  1. Removed older extension
  2. Added 0.1.226 using Install from VSIX option
  3. reloaded
  4. Opened .bicep file and getting errors below

Action: bicep.activate Error type: string Error Message: Launching server using command dotnet failed.

Version: 0.1.226-alpha OS: linux OS Release: 4.19.128-microsoft-standard Product: Visual Studio Code Product Version: 1.50.1 Language: en

lr90 avatar Nov 04 '20 18:11 lr90

Does an empty bicep file produce the same error? If not, can you share the file?

Also, can you share the output from the "Output" tab: image

alex-frankel avatar Nov 05 '20 01:11 alex-frankel

Yes, created an empty emtpy.bicep file. Closed and relaunched VSCode (code .) and then opened the empty file:

image

Bicep output log

[Error - 8:38:30 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.
2020-11-05T08:38:29.978Z info: Current log level: debug.
2020-11-05T08:38:29.980Z info: Launching Bicep language service...
2020-11-05T08:38:29.991Z debug: Found dotnet command at '/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.9/dotnet'.
2020-11-05T08:38:29.991Z debug: Found language server at '/home/trevor/.vscode-server/extensions/azure.vscode-bicep-0.1.226-alpha/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-05T08:38:29.999Z info: Bicep language service started.

Log (Window)

[2020-11-05 08:38:25.752] [renderer1] [error] spawn dotnet ENOENT: Error: spawn dotnet ENOENT
	at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
	at onErrorNT (internal/child_process.js:456:16)
	at processTicksAndRejections (internal/process/task_queues.js:81:21)

I've since been back and tried earlier releases. I'm seeing the same issue with 1.223 but 1.37 still works for me.

Steps:

  • Uninstall 1.226
  • Reload
  • Install 1.223
  • Reload
  • Open empty bicep file – fails
  • Uninstall 1.223
  • Reload
  • Install 1.37
  • Reload
  • Open empty bicep file – works!

lr90 avatar Nov 05 '20 08:11 lr90

@lr90 Are you launching code . from within a WSL cmd prompt? If so, do you happen to know which version of WSL you are running?

Does this extension work if launched via VSCode in Windows not through WSL?

anthony-c-martin avatar Nov 05 '20 09:11 anthony-c-martin

I'm on WSL2

    N A M E                                       S T A T E                       V E R S I O N 
 
 *   U b u n t u                                   R u n n i n g                   2 
 
     d o c k e r - d e s k t o p                   S t o p p e d                   2 
 
     d o c k e r - d e s k t o p - d a t a         S t o p p e d                   2 
 

If I launch VSCode from within a command prompt several extensions I use are only enabled for WSL:Ubuntu. I have however tried this and added the Bicep 1.226 extension (which then shows as globally enabled) but once I start editing a Bicep file it throws errors about failure to install .Net runtime 3.1 (!!) and installing .NET: Dotnet Core Acquisition

The 1.37 extension is working for me when VSCode is launched from both CMD and WSL

lr90 avatar Nov 05 '20 10:11 lr90

OK, not sure what I did different but I now have 1.226 running when launched in cmd and editing 'local' files (C:\users...)

Switching (or launching using code . ) to Remote-WSL image to edit files in /source/trevor/... is still failing

lr90 avatar Nov 05 '20 11:11 lr90

I was able to repro this locally by installing WSL2 and WSL remoting. At least for me, this was caused by the issue that this PR fixes: https://github.com/dotnet/vscode-dotnet-runtime/pull/130.

If I click on "Report an issue", and view the log file that is linked in the issue text, I see "/home/ant/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.1.2/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected". Is this the same problem you're seeing?

anthony-c-martin avatar Nov 05 '20 18:11 anthony-c-martin

That seems very familiar but though I can repeat the failure that text (it never persisted) no longer seems to pop up and raising an issue just repeats the report at the beginning of this thread. I don't appear to have any links to log files?

lr90 avatar Nov 05 '20 19:11 lr90

This has been fixed with vscode-dotnet-runtime 0.2.0, which should now be pulled down by default with the extension

anthony-c-martin avatar Nov 10 '20 16:11 anthony-c-martin

OK, attempted to reinstall the extension today to see if this is now fixed. It failed but I did capture the error:

"An error occurred while installing .NET (3.1): .NET Acquisition Failed: Command failed: "/home/trevor/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.2.0/dist/install scripts/dotnet-install.sh" -InstallDir "/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10" -Runtime dotnet -Version 3.1.10 /home/trevor/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.2.0/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected"

I not it is referring to dotnet-runtime-0.2.0 though

OK, seems like a reload of VSCode is required before the 3.1 acquisition works under both Windows and WSL. However with dotnet-runtime-0.2.0 and 3.1 runtime downloaded I still get an error launching the Bicep extension under WSL:

2020-11-11T11:29:00.973Z info: Current log level: debug.
2020-11-11T11:29:00.977Z info: Launching Bicep language service...
2020-11-11T11:29:00.993Z debug: Found dotnet command at '/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-11T11:29:00.994Z debug: Found language server at '/home/trevor/.vscode-server/extensions/azure.vscode-bicep-0.1.226-alpha/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-11T11:29:01.006Z info: Bicep language service started.
[Error - 11:29:01 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.

Might hang fire on WSL until Bicep 0.2 comes out

lr90 avatar Nov 11 '20 10:11 lr90

@anthony-c-martin congrats for getting 0.2.3 out!

I've updated my bicep install and the code extension but the issue loading the extension under WSL is still there

2020-11-12T10:43:46.386Z info: Current log level: debug.
2020-11-12T10:43:46.390Z info: Launching Bicep language service...
2020-11-12T10:43:46.404Z debug: Found dotnet command at '/home/username/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-12T10:43:46.405Z debug: Found language server at '/home/username/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.3/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-12T10:43:46.414Z info: Bicep language service started.
[Error - 10:43:46 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.

lr90 avatar Nov 12 '20 10:11 lr90

Thanks for pointing this out - reopening this issue to investigate.

anthony-c-martin avatar Nov 12 '20 17:11 anthony-c-martin

I have same problem in dev container.

2020-11-16T01:15:31.823Z info: Current log level: debug.
2020-11-16T01:15:31.824Z info: Launching Bicep language service...
2020-11-16T01:15:35.423Z debug: Found dotnet command at '/home/vscode/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-16T01:15:35.423Z debug: Found language server at '/home/vscode/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.3/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-16T01:15:35.430Z info: Bicep language service started.
[Error - 1:15:35 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.

takekazuomi avatar Nov 16 '20 02:11 takekazuomi

@lr90, @takekazuomi Please could you try this with v0.2.14? To test you'll need to fetch it manually from https://github.com/Azure/bicep/releases/ and use the "install from VSIX" option in VSCode, as it hasn't yet been published to the VSCode marketplace.

I'm able to repro this behavior with v0.2.3, but not with v.0.2.14, I believe because of the fix in #910

anthony-c-martin avatar Nov 16 '20 03:11 anthony-c-martin

@anthony-c-martin I have confirmed that it works fine with v0.2.14.

2020-11-16T04:33:30.192Z info: Current log level: debug.
2020-11-16T04:33:30.193Z info: Launching Bicep language service...
2020-11-16T04:33:34.236Z debug: Found dotnet command at '/home/vscode/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-16T04:33:34.236Z debug: Found language server at '/home/vscode/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.14/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-16T04:33:34.244Z info: Bicep language service started.
2020-11-16T04:33:35.376Z info: Bicep language service ready.

I appreciate your help.

takekazuomi avatar Nov 16 '20 04:11 takekazuomi

Yep, all good here too and feels much better to be back in WSL :-) Many thanks for fixing.

lr90 avatar Nov 16 '20 09:11 lr90

Anyone coming here after manually installing dotnet 5.0 runtime on macOS with M1: The path for dotnet was different from what the dotnet installer said.

Here is my settings.json part that works for me:

   "dotnetAcquisitionExtension.existingDotnetPath": [

        {
            "extensionId": "ms-azuretools.vscode-bicep",
            "path": "/usr/local/share/dotnet/x64/dotnet"
        }
    ]

cloudchristoph avatar Nov 28 '21 17:11 cloudchristoph

I am a bit confused how to setup VS Code and bicep extension to work with dotnet 6. Why do we need dotnet 5?

mildsar avatar Dec 13 '21 14:12 mildsar

I am a bit confused how to setup VS Code and bicep extension to work with dotnet 6. Why do we need dotnet 5?

Bicep (v0.4.1008 and lower) is currently built against dotnet 5, so you need to use dotnet 5 to run it. Next release (ETA this week), we will switch to dotnet 6. This means that the workaround suggested by @cloudchristoph will no longer be necessary.

anthony-c-martin avatar Dec 13 '21 15:12 anthony-c-martin