Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: Unable to launch Azure Cloud Shell #719

Closed
Tracked by #952
sayeedmaster opened this issue Feb 11, 2023 · 38 comments
Closed
Tracked by #952

Bug report: Unable to launch Azure Cloud Shell #719

sayeedmaster opened this issue Feb 11, 2023 · 38 comments
Assignees

Comments

@sayeedmaster
Copy link

VSCode:
Version: 1.75.0
Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164
Date: 2023-02-01T15:29:17.766Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Linux x64 5.15.0-58-generic
Sandboxed: No

System:
Kernel: 5.15.0-58-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.7
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy

Extension:
[0.11.3] - 2023-01-18

Error:
Unable to launch Azure Cloud Shell

Error Message:

The terminal process "/home/user/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh '/proc/self/exe', '-e', 'require('/home/user/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher').main()', '--ms-enable-electron-run-as-node'" terminated with exit code: 1.

Steps to Reproduce:

  1. Try to launch Azure Cloud Shell (either PowerShell or Bash) within vscode terminal
@TwoOneSix
Copy link

TwoOneSix commented Mar 22, 2023

Same issue here.
Version: 1.76.2
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:57:21.103Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 6.2.7-200.fc37.x86_64
Sandboxed: Yes

Extension:
[0.11.3] - 2023-01-18

Error:
/proc/self/exe: require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher').main(): No such file or directory

This has worked in the past but not for the past month or two.

@alexweininger
Copy link
Member

There was a change related to Cloud Shell in the latest release (v0.11.3). Could you try reverting to v0.11.2 and seeing if it works?

@TwoOneSix
Copy link

Same result going back 2 versions. Restarted the system between both instances.

@alexweininger
Copy link
Member

Same result going back 2 versions. Restarted the system between both instances.

Ok, thanks for that info.

@TwoOneSix
Copy link

Updated to March 2023 (version 1.77). Same error on both 0.11.3 and 0.11.2

Version: 1.77.0
Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63
Date: 2023-03-29T10:05:35.165Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 6.2.8-200.fc37.x86_64
Sandboxed: Yes

@dokuboyejo
Copy link

Issue still persist

@alexweininger
Copy link
Member

Can you verify that the files in the error message exist?

  1. /home/user/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh
  2. /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher

Thanks.

@alexweininger
Copy link
Member

Also this seems to be Linux specific.

@TwoOneSix
Copy link

Also this seems to be Linux specific.

Yes, I have the same setup on my Windows PC and it works without issue.

@dokuboyejo
Copy link

Can you verify that the files in the error message exist?

  1. /home/user/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh
  2. /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher

Thanks.

Yes, affirmative, the file does exist

  • /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh
  • /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher.js

@TwoOneSix
Copy link

TwoOneSix commented Apr 4, 2023

Can you verify that the files in the error message exist?

  1. /home/user/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh
  2. /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher

Thanks.

Yes, those files exist.

$ ls /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh
/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh

$ ls /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher
ls: cannot access '/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher': No such file or directory

$ ls /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher.js
/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher.js

In the past I tried removing that .js file extension and it gave the same error. I just tried again and it, also, gave the same error.

image
image

@alexweininger
Copy link
Member

Could it be an issue with the permissions on the cloudConsoleLauncher file?

@TwoOneSix
Copy link

The file is currently
-rw-r--r--. 1

What permissions would you like me to set and test?

@alexweininger
Copy link
Member

alexweininger commented Apr 4, 2023

I just checked and my file also has -rw-r--r-- 1 (Darwin). So I'm not sure permissions is the issue.

@alexweininger
Copy link
Member

Might be a long shot, but we are using a small bash helper script to start the shell.

It has a shebang of #!/bin/bash. Is it possible that the shebang is wrong for your system?

Try running that script and see if there are any errors.

@TwoOneSix
Copy link

$ sudo ausearch -m AVC,USER_AVC -ts recent
<no matches>
$ ps -p $$
    PID TTY          TIME CMD
   7274 pts/0    00:00:00 bash
[user@machine bin]$ ./node.sh
[user@machine bin]$

@alexweininger
Copy link
Member

alexweininger commented Apr 4, 2023

Can you try running the following command? Make sure to substitute {user} with your username. You also might need to change the path to the node executable. Find that with which node or which nodejs.

/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh /usr/bin/node -e "console.log(require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher'))"

On my machine, I get the following output:

{
  Errors: { DeploymentOsTypeConflict: 'DeploymentOsTypeConflict' },
  getUserSettings: [Function: getUserSettings],
  provisionConsole: [Function: provisionConsole],
  resetConsole: [Function: resetConsole],
  connectTerminal: [Function: connectTerminal],
  main: [Function: main]
}

I'm trying to emulate the command that's failing as much as possible to see if we can reproduce the error outside of VS Code.

@TwoOneSix
Copy link

TwoOneSix commented Apr 4, 2023

Initially, I did not have nodejs installed, so the command returned this:

$ /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh /usr/bin/node -e "console.log(require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher'))"
/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh: line 2: /usr/bin/node: No such file or directory

I installed nodejs from the fedora repo and now I get this:

$ /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/bin/node.sh /usr/bin/node -e "console.log(require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.3/dist/cloudConsoleLauncher'))"
{
  Errors: { DeploymentOsTypeConflict: 'DeploymentOsTypeConflict' },
  getUserSettings: [Function: getUserSettings],
  provisionConsole: [Function: provisionConsole],
  resetConsole: [Function: resetConsole],
  connectTerminal: [Function: connectTerminal],
  main: [Function: main]
}

I should add that it still doesn't work from with-in vscode

@TwoOneSix
Copy link

Updated to 1.77.1. Same error on both 0.11.3 and 0.11.2

Version: 1.77.1
Commit: b7886d7461186a5eac768481578c1d7ca80e2d21
Date: 2023-04-04T23:20:37.202Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 6.2.9-200.fc37.x86_64
Sandboxed: Yes

@TwoOneSix
Copy link

Updated to v0.11.4. Same error other than the path reference to 0.11.4. Also, I'm now working on a clean Fedora 38 workstation.

Version: 1.77.3
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:16:52.732Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 6.2.14-300.fc38.x86_64
Sandboxed: Yes

@TwoOneSix
Copy link

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.13-200.fc38.x86_64

Azure Account: v0.11.5
Azure CLI Tools: v0.5.0

The terminal process "/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.5/bin/node.sh '/proc/self/exe', '-e', 'require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.5/dist/cloudConsoleLauncher').main()', '--ms-enable-electron-run-as-node'" failed to launch (exit code: 1).

cmd:
$ /home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.5/bin/node.sh /usr/bin/node -e "console.log(require('/home/{user}/.vscode/extensions/ms-vscode.azure-account-0.11.5/dist/cloudConsoleLauncher'))"
result:
{ main: [Function: main] }

@AlanGRutter
Copy link

Has this issue been resolved yet - I am having exactly the same issue with Azure Account v0.11.6 on Ubuntu?

@TwoOneSix
Copy link

I did a dnf system-upgrade to Fedora 36 recent, but otherwise, the issue still exists.

Version: 1.85.2
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:19.222Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.6.12-200.fc39.x86_64

Azure Account: v0.11.6
Azure CLI Tools: v0.6.0

@boblarson-ka
Copy link

Did a full reinstall/ wiped out all the hidden folders for VS code.

Reinstalled the Azure Tools and Azure CLI Tools Extensions.

Same as reported by others:

Version: 1.87.1 (Universal)
Commit: 1e790d77f81672c49be070e04474901747115651
Date: 2024-03-06T00:23:16.418Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin x64 23.2.0

Azure Account: v0.11.6
Azure CLI Tools: v0.6.0

@salgiza
Copy link

salgiza commented Mar 12, 2024

I'll just add that the same error happens in macOS as well, so... I'm guessing that, currently, the Azure Cloud Shell only works in Windows? Or has anyone been able to launch it in Linux or macOS?

@barracoder
Copy link

barracoder commented Mar 24, 2024

I'll just add that the same error happens in macOS as well, so... I'm guessing that, currently, the Azure Cloud Shell only works in Windows? Or has anyone been able to launch it in Linux or macOS?

Failing for me with the error below in MacOS with latest versions of everything

The terminal process "/Users/barracoder/.vscode/extensions/ms-vscode.azure-account-0.11.6/bin/node.sh '/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)', '-e', 'require('/Users/barracoder/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist/cloudConsoleLauncher').main()', '--ms-enable-electron-run-as-node'" failed to launch (exit code: 9).

@mrumpf
Copy link

mrumpf commented Apr 10, 2024

Still the same issue:

The terminal process "/Users/mrumpf/.vscode/extensions/ms-vscode.azure-account-0.11.6/bin/node.sh '/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)', '-e', 'require('/Users/mrumpf/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist/cloudConsoleLauncher').main()', '--ms-enable-electron-run-as-node'" failed to launch (exit code: 9).

When you run the command in the shell you can see that the option "--ms-enable-electron-run-as-node" is causing the return code 9:

/Users/mrumpf/.vscode/extensions/ms-vscode.azure-account-0.11.6/bin/node.sh "/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)" -e "require('/Users/mrumpf/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist/cloudConsoleLauncher').main()" --ms-enable-electron-run-as-node
/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin): 
bad option: --ms-enable-electron-run-as-node

When you run the command without the option you get:

/Users/mrumpf/.vscode/extensions/ms-vscode.azure-account-0.11.6/bin/node.sh "/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)" -e "require('/Users/mrump/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist/cloudConsoleLauncher').main()"

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: connect ECONNREFUSED ::1:80
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '::1',
  port: 80
}

Node.js v18.18.2

@mrumpf
Copy link

mrumpf commented Apr 11, 2024

The issue is caused by the following if block at cloudConsole.ts#L291
The change was introduced here: #136987

A workaround is to modify the JavaScript file and change the version number 1.62.1 in the if statement to a value that will never be reached, avoiding that the flag will be passed to the cloudConsoleLauncher.js file:

cd ~/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist
vi extension.bundle.js
// search for "1.62.1"
// change the version to 10.62.1
// save the file :x
// restart vscode

After that change I was able to login to Azure cloud shell with the Azure Account extension:
Screenshot 2024-04-12 at 00 10 24

@alexweininger
Copy link
Member

alexweininger commented Apr 15, 2024

Hi all, I have an updated extension VSIX that contains a fix for this issue. If some of you could try it out and confirm the fix for me, that'd be a huge help. Please provide system information in your replies.

azure-account-0.11.6-preview.vsix.zip

Steps to install extension development build:

  1. Download and unzip the VSIX
  2. From the command palette (F1 or Command/Ctrl + Shift + P), run the "Extensions: Install from VSIX..." command.
  3. Select the downloaded .VSIX file, then reload VS Code as prompted.

@mrumpf
Copy link

mrumpf commented Apr 17, 2024

I tested the version from above and it worked after reloading VSCode. Thank you, looking forward to see a 0.11.7 release soon!

@TwoOneSix
Copy link

Hi all, I have an updated extension VSIX that contains a fix for this issue. If some of you could try it out and confirm the fix for me, that'd be a huge help.

azure-account-0.11.6-preview.vsix.zip

Steps to install extension development build:

  1. Download and unzip the VSIX
  2. From the command palette (F1 or Command/Ctrl + Shift + P), run the "Extensions: Install from VSIX..." command.
  3. Select the downloaded .VSIX file, then reload VS Code as prompted.

This is not working for me... the "new" error is:

The terminal process "/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/bin/node.sh '/proc/self/exe', '-e', 'require('/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/dist/cloudConsoleLauncher').main()'" failed to launch (exit code: 1).

Version: 1.88.1
Commit: e170252f762678dec6ca2cc69aba1570769a5d39
Date: 2024-04-10T17:34:12.840Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.8.6-200.fc39.x86_64

I nuked my .vscode directory and removed all extensions so I would start from scratch.

@ajlimler
Copy link

The issue is caused by the following if block at cloudConsole.ts#L291 The change was introduced here: #136987

A workaround is to modify the JavaScript file and change the version number 1.62.1 in the if statement to a value that will never be reached, avoiding that the flag will be passed to the cloudConsoleLauncher.js file:

cd ~/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist
vi extension.bundle.js
// search for "1.62.1"
// change the version to 10.62.1
// save the file :x
// restart vscode

This worked for me. Thank you so much for this solution!


This is not working for me... the "new" error is:

The terminal process "/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/bin/node.sh '/proc/self/exe', '-e', 'require('/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/dist/cloudConsoleLauncher').main()'" failed to launch (exit code: 1).

Version: 1.88.1 Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:34:12.840Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.8.6-200.fc39.x86_64

I nuked my .vscode directory and removed all extensions so I would start from scratch.

@TwoOneSix
I looked around for a solution related to Exit Code 1 on Linux (specifically the issue I'm linking references using VSCode in WSL/WSL Ubuntu and Arch Linux) and found this issue: #682 (comment)

It looks like reverting the Azure Account extension to version 0.11.2 and preventing it from auto-updating is a temporary workaround for this.

Direct download to the 0.11.2 Azure Account extension.
Instead of downloading the extension, you could also go to the Extensions tab in VS Code, click on the settings icon for Azure Account, and then click on Install Another Version.

To disable auto updating in VS Code, go to Settings and type in extensions.autoUpdate and then change the setting from "All Extensions" to "Only Enabled Extensions". Unfortunately you'll have to go to your extensions tab and click the settings icon and click the "Auto Update" option for each one you want to update automatically, but you'll only have to do that once.

I hope this helps!

@alexweininger
Copy link
Member

alexweininger commented Apr 17, 2024

I tested the version from above and it worked after reloading VSCode. Thank you, looking forward to see a 0.11.7 release soon!

@mrumpf & @ajlimler could you provide your system information please? On macOS you can do so like this. On Windows/Linux it should be very similar.
image
image

@mrumpf
Copy link

mrumpf commented Apr 17, 2024

Screenshot 2024-04-18 at 01 01 31

@TwoOneSix
Copy link

The issue is caused by the following if block at cloudConsole.ts#L291 The change was introduced here: #136987
A workaround is to modify the JavaScript file and change the version number 1.62.1 in the if statement to a value that will never be reached, avoiding that the flag will be passed to the cloudConsoleLauncher.js file:

cd ~/.vscode/extensions/ms-vscode.azure-account-0.11.6/dist
vi extension.bundle.js
// search for "1.62.1"
// change the version to 10.62.1
// save the file :x
// restart vscode

This worked for me. Thank you so much for this solution!

This is not working for me... the "new" error is:

The terminal process "/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/bin/node.sh '/proc/self/exe', '-e', 'require('/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.6-preview/dist/cloudConsoleLauncher').main()'" failed to launch (exit code: 1).

Version: 1.88.1 Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:34:12.840Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.8.6-200.fc39.x86_64
I nuked my .vscode directory and removed all extensions so I would start from scratch.

@TwoOneSix I looked around for a solution related to Exit Code 1 on Linux (specifically the issue I'm linking references using VSCode in WSL/WSL Ubuntu and Arch Linux) and found this issue: #682 (comment)

It looks like reverting the Azure Account extension to version 0.11.2 and preventing it from auto-updating is a temporary workaround for this.

Direct download to the 0.11.2 Azure Account extension. Instead of downloading the extension, you could also go to the Extensions tab in VS Code, click on the settings icon for Azure Account, and then click on Install Another Version.

To disable auto updating in VS Code, go to Settings and type in extensions.autoUpdate and then change the setting from "All Extensions" to "Only Enabled Extensions". Unfortunately you'll have to go to your extensions tab and click the settings icon and click the "Auto Update" option for each one you want to update automatically, but you'll only have to do that once.

I hope this helps!

Hello, I was hoping that reverting to 0.11.2 would help, but it did not. In the past I rolled back quite far with no success.

The terminal process "/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.2/bin/node.sh '/proc/self/exe', '-e', 'require('/home/{USER}/.vscode/extensions/ms-vscode.azure-account-0.11.2/dist/cloudConsoleLauncher').main()', '--ms-enable-electron-run-as-node'" failed to launch (exit code: 1).

@alexweininger
Copy link
Member

I've filed a new issue to represent failing to launch cloud shell on macOS #959. Please reserve this issue for the Linux bug. I'm logging the bugs formally to document them properly before the fixes are merged and released. I have fixes for both incoming soon. Thank you all for your patience with these bugs.

@alexweininger
Copy link
Member

This issue has been fixed in the latest version of the Azure Resources extension 🎉 which now contains the Cloud Shell feature. See the v0.9.0 release notes for more info.

Launching Cloud Shell should now work on Linux. 🤞

@TwoOneSix
Copy link

I switched to 'Azure Resources' v0.9.0 [Preview] and in-fact, it works! Thanks!

Version: 1.89.1
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:16:23.416Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.8.9-200.fc39.x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants