dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
128 stars 229 forks source link

vscode for mac os sonoma silicon m1 and Avalonia UI project folder - Error Failed to download .NET 8.0: #1734

Open aspepper opened 3 months ago

aspepper commented 3 months ago

Describe the bug.

I hope everyone is okay.

When opening VSCode, with the folder of an Avalonia UI Coss Platform project, vscode tries to install net 8, although the net 8 sdk is already installed on my mac. So I always get the error message below:

AvaloniaTeam.vscode-avalonia requested to download the .NET Runtime. Downloading .NET version(s) 8.0.3~arm64 ....Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Abortion. Please ensure that you are online.

Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Abortion. Please ensure that you are online.

Error Failed to download .NET 8.0.3~arm64: Command failed: "/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

Error Failed to download .NET 8.0: .NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" - InstallDir "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

The net8 sdk is installed in the /usr/local/share/dotnet/sdk/8.0.203 folder

How do I solve this problem?

Please attach log file(s) here if you have any.

AvaloniaTeam.vscode-avalonia requested to download the .NET Runtime. Downloading .NET version(s) 8.0.3~arm64 ....Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error Failed to download .NET 8.0.3~arm64: Command failed: "/Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/alexpimenta/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

Error Failed to download .NET 8.0: .NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/alexpimenta/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

Reproduction Steps

opening vscode

Expected Behavior

try install net 8 automatically

Exceptions & Errors (if any)

AvaloniaTeam.vscode-avalonia requested to download the .NET Runtime. Downloading .NET version(s) 8.0.3~arm64 ....Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error Failed to download .NET 8.0: Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error Failed to download .NET 8.0.3~arm64: Command failed: "/Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/alexpimenta/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

Error Failed to download .NET 8.0: .NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/alexpimenta/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.3~arm64" -Version 8.0.3 -Verbose -Runtime dotnet -Architecture arm64 /bin/sh: /Users/alexpimenta/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh: Permission denied

.NET Install Tool Version

.NET version(s) 8.0.3~arm64

Your operating system? Please provide more detail, such as the version and or distro above.

OSX / Darwin / Mac

VS Code Version

Version: 1.87.2 (Universal) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:21:31.043Z (3 wks ago) 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 arm64 23.4.0

scrocquesel-ml150 commented 2 months ago
~/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts$ ls -lh
total 152K
-rw-r--r-- 1 me me  875 Mar 26 08:42 determine-linux-distro.sh
-rw-r--r-- 1 me me  70K Mar 26 08:42 dotnet-install.ps1
-rw-r--r-- 1 me me  61K Mar 26 08:42 dotnet-install.sh
-rw-r--r-- 1 me me 7.4K Mar 26 08:42 install-linux-prereqs.sh
-r--r--r-- 1 me me 1.7K Mar 26 08:42 interprocess-communicator.sh

.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh is missing execute permission. What I do is chmod +x dotnet-install.sh on it.

There is still an error but it doesn't not block the process.

ms-azuretools.vscode-bicep requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.4~x64 ......Error
Failed to download .NET 8.0:
Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error
Failed to download .NET 8.0:
Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

 Done!
.NET 8.0.4~x64 executable path: /home/me/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.4~x64/dotnet
gwiede commented 1 month ago

Howdy! First off, thanks to @scrocquesel-ml150 for their workaround, worked great here!

I was encountering the exact same problem with v2.0.5 of the .NET Install Tool for Linux (debian, gLinux specifically, rodete), and by going into the extension and chmod'ing all the scripts as +x everything started working again. Someone at DevDiv really needs to make sure this permissions issue is fully eradicated from the codebase, or at least determine how it reappeared in the Linux code when it should have been fixed everywhere in 2.0.3.

Anyway, all good here now, no more "cannot acquire, no internet connection" (terribly inaccurate msg, btw, given the actual issue in this case). Thanks all again, love vscode!

baronfel commented 1 month ago

Thanks for confirming @gwiede - glad to see you're no longer blocked.

We've been whack-a-mole-ing the permissions issue on the script for a bit now, clearly we're not 100% done yet. @nagilson IMO the struggles we've had here are good motivation to move off of the install scripts in favor of the releases.json manifests all-up for working with the stable releases.

nagilson commented 1 month ago

Thank you @gwiede ! We do try to chmod the file every time, but sometimes we dont have permission to chmod +x it, which we should probably investigate but have not been able to repro.

The n[r] split issue is linked above and I dont think it's related to chmod permissions. I believe that is a bug in Axios or the Axios Cache Interceptor (a dependency web library), which is why it says 'No Internet Connection', because that bug causes the web request to fail.

In version 2.0.5 I added some more call stack information since we couldn't repro it, and we are hoping to get that information from the next person who gets it so we can tell where that bug is coming from. If you have that, it would be quite valuable.

gwiede commented 1 month ago

Okay, so there's a decent chance I do have it, or can reproduce it easily enough, where do I look to grab that info after installing ".NET Install Tool" and opening a .ts file (what triggered it to try and install .NET prior) and the install failing with no connection?

I've figured what appears to be a 100% repro, but requires uninstalling (and deleting leftovers) for a bunch of extensions, then reinstalling, including ".NET Install Tool".

Thanks!

-John W @.***)

On Wed, May 8, 2024 at 6:31 PM Noah Gilson @.***> wrote:

Thank you @gwiede https://github.com/gwiede ! We do try to chmod the file every time, but sometimes we dont have permission to chmod +x it, which we should probably investigate but have not been able to repro.

The n[r] split issue is linked above and I dont think it's related to chmod permissions. I believe that is a bug in Axios or the Axios Cache Interceptor, which is why it says 'No Internet Connection', because that bug causes the web request to fail.

In version 2.0.5 I added some more call stack information since we couldn't repro it, and we are hoping to get that information from the next person who gets it so we can tell where that bug is coming from. If you have that, it would be quite valuable.

— Reply to this email directly, view it on GitHub https://github.com/dotnet/vscode-dotnet-runtime/issues/1734#issuecomment-2101186446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUTNUWRMBCE7CV2Z34XY2PLZBJVRJAVCNFSM6AAAAABFPZZB5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGE4DMNBUGY . You are receiving this because you were mentioned.Message ID: @.***>

nagilson commented 1 month ago

Thank you for your willingness to help! :)

image It will likely be output in the output tab for '.NET Install Tool.'

It would also be helpful to have our log, but it may not be necessary.

Logs

Our log files are located alongside VS Code logs. If you want to find them manually, navigate here: Linux: ~/.config/Code/logs Mac: ~/Library/Application Support/Code/logs/ Windows: c:\Users\USER\AppData\Roaming\Code\logs\

Then find the folder created at the time you experienced the bug in the logs folder. From there, go to window1 -> exthost -> ms-dotnettools.vscode-dotnet-runtime. The log file should be located in this folder.

Note: The window folder may change depending on how many VS Code windows you have open; if our extension is running in the 2nd window, it'd be in a folder called window2.

nagilson commented 1 month ago

Thank you! :) It was indeed helpful!

It appears my theory was right and it is a bug in one of our dependencies. We have the exact line from your log, so now it is up to us to work with them to get that resolved. I am a bit surprised you didn't have the error message 'failed to chmod +x' on the script. Ill also be looking into that, because if you didnt get that message we presumably succeeded to +x it, but it does not seem to work in this case.

Btw, the log does have your machine name in it -- you may want to remove it, or if you want me to delete the zip from your comment I can do that now that we have it.

gwiede commented 1 month ago

Went ahead and deleted the message, if you need it again let me know and I'll resend. Thanks again!

nagilson commented 1 month ago

Thank you so much :)

@gwiede I am working with the developer in the linked issue to try to figure out what's going on. If you have some time to collect this, this information would also be interesting to us.

Going to the VS Code Developer Console (Help -> Toggle Developer Tools), if you go to the console and enter String.prototype.split, what is the output? Is it ƒ split() { [native code] }?

image

image

gwiede commented 1 month ago

[image: image.png]

Thanks!

-John W @.***)

On Wed, May 8, 2024 at 10:45 PM Noah Gilson @.***> wrote:

Thank you so much :)

@gwiede https://github.com/gwiede I am working with the developer in the linked issue to try to figure out what's going on. If you have some time to collect this, this information would also be interesting to us.

Going to the VS Code Developer Console (Help -> Toggle Developer Tools), if you go to the console and enter String.prototype.split, what is the output? Is it ƒ split() { [native code] }?

image.png (view on web) https://github.com/dotnet/vscode-dotnet-runtime/assets/23152278/5ee005b6-d824-4d7c-a24a-9e80099a6d04

image.png (view on web) https://github.com/dotnet/vscode-dotnet-runtime/assets/23152278/2b761943-06ca-4b03-8b73-1d4565082142

— Reply to this email directly, view it on GitHub https://github.com/dotnet/vscode-dotnet-runtime/issues/1734#issuecomment-2101621644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUTNUWUITRGSFYAC6RQGNIDZBKTKHAVCNFSM6AAAAABFPZZB5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGYZDCNRUGQ . You are receiving this because you were mentioned.Message ID: @.***>

nagilson commented 1 month ago

Thank you, that image is not loading for me though.

Your help is very appreciated. Any other diagnosis we would need would be evaluating variables at runtime, so if this does not work Ill need to create a new linux vm to try to get in your situation 😋 this way I can stop asking you for stuff haha

gwiede commented 1 month ago

Noah,

The image just shows in Console:

String.prototype.split ƒ split() { [native code] }

In other words, it was what you expected.

Thanks!

-John W @.***)

On Wed, May 8, 2024 at 11:25 PM Noah Gilson @.***> wrote:

Thank you, that image is not loading for me though.

Your help is very appreciated. Any other diagnosis we would need would be evaluating variables at runtime, so if this does not work Ill need to create a new linux vm to try to get in your situation 😋 this way I can stop asking you for stuff haha

— Reply to this email directly, view it on GitHub https://github.com/dotnet/vscode-dotnet-runtime/issues/1734#issuecomment-2101655800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUTNUWVWXOBB2DM3WQKPVL3ZBKX7RAVCNFSM6AAAAABFPZZB5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGY2TKOBQGA . You are receiving this because you were mentioned.Message ID: @.***>

aspepper commented 4 days ago
~/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts$ ls -lh
total 152K
-rw-r--r-- 1 me me  875 Mar 26 08:42 determine-linux-distro.sh
-rw-r--r-- 1 me me  70K Mar 26 08:42 dotnet-install.ps1
-rw-r--r-- 1 me me  61K Mar 26 08:42 dotnet-install.sh
-rw-r--r-- 1 me me 7.4K Mar 26 08:42 install-linux-prereqs.sh
-r--r--r-- 1 me me 1.7K Mar 26 08:42 interprocess-communicator.sh

.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh is missing execute permission. What I do is chmod +x dotnet-install.sh on it.

There is still an error but it doesn't not block the process.

ms-azuretools.vscode-bicep requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.4~x64 ......Error
Failed to download .NET 8.0:
Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

Error
Failed to download .NET 8.0:
Web Request to https://dot.net/v1/dotnet-install.sh Failed: n[r].split is not a function. Aborting. Please ensure that you are online.

 Done!
.NET 8.0.4~x64 executable path: /home/me/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.4~x64/dotnet

Tks,

It's works for me.

Alex Pimenta