Closed Aculeo closed 1 year ago
Aha, found a resolution: I decided to ditch the SDK bundled with Ubuntu, and installed it through the MS package feed. And now it correctly installs. I would suggest documenting this somewhere perhaps? I think the issue can be closed though.
For anyone wanting to switch to Microsoft feed as well:
1) Follow instructions here: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository 2) Ensure the new package repo is pinned, or you'll get some funny errors: https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist
Installing a workload with the a bundled SDK should work by leaving out sudo
:
dotnet workload install wasm-tools
MS builds require sudo
to be able to add files to locations which are only meant for package installs.
I tried it without sudo
as well, didn't work either
This is what I get when using the distro packages on Fedora:
$ dotnet --version
6.0.115
$ dotnet workload list
Installed Workload Ids
----------------------
Use `dotnet workload search` to find additional workloads to install.
$ dotnet workload install wasm-tools
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing workload manifest microsoft.net.workload.emscripten version 6.0.16…
Installing workload manifest microsoft.net.workload.mono.toolchain version 6.0.16…
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.15...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.15...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.15...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.15...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.15...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.15...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.15...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.15...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.15...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.15...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.15...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.15...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.15...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.15...
Garbage collecting for SDK feature band(s) 6.0.100...
Successfully installed workload(s) wasm-tools.
Can you share the output of:
find $(dirname $(readlink $(command -v dotnet))) -name userlocal
This should find a file at <DOTNET_ROOT>/metadata/workloads/6.0.100/userlocal
.
Hi, as I've already switched to the MS package feed I can't test this, but perhaps I can try this on another device
cc @mirespace
Taking a look... thanks @tmds!
Hi,
I could reproduce the issue (same results using sudo
as well) in an Ubuntu laptop:
❯ env | grep -i DOTNET_
DOTNET_BUNDLE_EXTRACT_BASE_DIR=/home/miriam/.cache/dotnet_bundle_extract
DOTNET_ROOT=/usr/lib/dotnet
❯ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.116
Commit: b605cc131f
Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/6.0.116/
global.json file:
Not found
Host:
Version: 6.0.16
Architecture: x64
Commit: 1e620a42e7
.NET SDKs installed:
6.0.116 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.16 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
❯ dotnet workload install wasm-tools
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Garbage collecting for SDK feature band(s) 6.0.100...
Successfully installed workload(s) wasm-tools.
❯ dotnet workload list
Installed Workload Ids
----------------------
wasm-tools
Use `dotnet workload search` to find additional workloads to install.
The command for checking the userlocal file fails if I don't use the -f to follow symlinks:
❯ find $(dirname $(readlink $(command -v dotnet))) -name userlocal
find: ‘../lib/dotnet’: No such file or directory
❯ find $(dirname $(readlink -f $(command -v dotnet))) -name userlocal
/usr/lib/dotnet/metadata/workloads/6.0.100/userlocal
In a VM (using Multipass), I couldn't execute the workload command without sudo
due to Access to the path '/home/ubuntu/.dotnet/6.0.116.toolpath.sentinel' is denied
:
ubuntu@dotnetJ:~$ dotnet workload install wasm-tools
System.UnauthorizedAccessException: Access to the path '/home/ubuntu/.dotnet/6.0.116.toolpath.sentinel' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.File.Create(String path)
at Microsoft.Extensions.EnvironmentAbstractions.FileWrapper.CreateEmptyFile(String path)
at Microsoft.DotNet.Configurer.FileSystemExtensions.<>c__DisplayClass0_0.<CreateIfNotExists>b__0()
at Microsoft.DotNet.Cli.Utils.FileAccessRetrier.RetryOnIOException(Action action)
at Microsoft.DotNet.Configurer.FileSystemExtensions.CreateIfNotExists(IFileSystem fileSystem, String filePath)
at Microsoft.DotNet.Configurer.FileSentinel.Create()
at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean isDotnetBeingInvokedFromNativeInstaller, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider, Dictionary`2 performanceMeasurements)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
ubuntu@dotnetJ:~$ sudo dotnet workload install wasm-tools
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
[....]
Garbage collecting for SDK feature band(s) 6.0.100...
Successfully installed workload(s) wasm-tools.
but the same result is obtained:
ubuntu@dotnetJ:~$ sudo dotnet workload list
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
----------------
[...]
--------------------------------------------------------------------------------------
Installed Workload Ids
----------------------
Use `dotnet workload search` to find additional workloads to install.
❯ find $(dirname $(readlink -f $(command -v dotnet))) -name userlocal /usr/lib/dotnet/metadata/workloads/6.0.100/userlocal
Good. This makes install work without sudo
.
I couldn't execute the workload command without sudo due to Access to the path '/home/ubuntu/.dotnet/6.0.116.toolpath.sentinel' is denied:
I imagine this happens because you ran the command with sudo
previously.
Try this:
sudo rm -rf ~/.dotnet
dotnet workload install wasm-tools
Thanks, it worked! And now it lists the installed workloads:
ubuntu@dotnetJ:~$ sudo rm -rf ~/.dotnet
ubuntu@dotnetJ:~$ dotnet workload install wasm-tools
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Garbage collecting for SDK feature band(s) 6.0.100...
Successfully installed workload(s) wasm-tools.
ubuntu@dotnetJ:~$ dotnet workload list
Installed Workload Ids
----------------------
wasm-tools
Use `dotnet workload search` to find additional workloads to install.
Thanks, it worked! And now it lists the installed workloads:
Great!
For some extra context: when the installable workload feature got added to the sdk, we wanted to avoid the sudo
install in source-built .NET because it adds files to the system dotnet location.
A source-build sdk includes a userlocal
file which causes the workload to be installed in a user folder instead.
See https://github.com/dotnet/sdk/issues/18104 and https://github.com/dotnet/sdk/pull/18823.
Hi @tmds,
I was checking different installations to see if this is something we must consider from the debian packaging/installation point of view, and I reproduced the issue in a LXC container (Ubuntu Jammy) with our lastest ubuntu debs from ubuntu.archive : installed successfully, but the listing doesn't.
ubuntu@Jdotnet:~$ dotnet workload install wasm-tools
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Garbage collecting for SDK feature band(s) 6.0.100...
Successfully installed workload(s) wasm-tools.
ubuntu@Jdotnet:~$ dotnet workload list
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Installed Workload Ids
----------------------
Use `dotnet workload search` to find additional workloads to install.
So I check for the .dotnet folder under the user home folder, and it is not there: it is under /tmp (is this OK?):
ubuntu@Jdotnet:~$ sudo find / -iname ".dotnet"
/tmp/.dotnet
/tmp/0afb88c6-43aa-4fec-936c-8e5010bbae67/.dotnet
/tmp/da1e7d0b-4505-4b32-8dac-646916962b8a/.dotnet
/tmp/8758bbc8-6e19-4471-9987-ed7d78651050/.dotnet
/tmp/3cfc5edb-5cc5-4e3b-a794-a4dce530a1f3/.dotnet
/tmp/51ef335b-7e1f-4add-9a85-fae99526c377/.dotnet
/tmp/da593632-e3ee-42c3-afc2-6b81f346486b/.dotnet
/tmp/5496815a-f42e-4557-adf0-c22b81680063/.dotnet
and a file for wasm-tools as a installed workload can be found at:
ubuntu@Jdotnet:~$ ls -lah /tmp/da1e7d0b-4505-4b32-8dac-646916962b8a/.dotnet/metadata/workloads/6.0.100/InstalledWorkloads
total 8.0K
drwxrwxr-x 2 ubuntu ubuntu 4.0K Apr 21 10:20 .
drwxrwxr-x 3 ubuntu ubuntu 4.0K Apr 21 10:20 ..
-rw-rw-r-- 1 ubuntu ubuntu 0 Apr 21 10:20 wasm-tools
I'd appreciate any thoughts/suggestions on this... thank you in advance.
So I check for the .dotnet folder under the user home folder, and it is not there: it is under /tmp (is this OK?):
This is unexpected. The SDK should anyhow create a ~/.dotnet
folder and add some files to it on first use.
Is $HOME
set in your environment?
Not to interrupt your conversation, but should I reopen this issue, since it's confirmed? Or is this the wrong place since it seems Ubuntu-specific?
should I reopen this issue, since it's confirmed?
There's some other issue going on as it seems the .NET SDK in @mirespace's LCX container environment has trouble finding the HOME directory.
So I check for the .dotnet folder under the user home folder, and it is not there: it is under /tmp (is this OK?):
This is unexpected. The SDK should anyhow create a
~/.dotnet
folder and add some files to it on first use. Is$HOME
set in your environment?
Yes, it is:
ubuntu@Jdotnet:~$ env | grep HOME
HOME=/home/ubuntu
@mirespace how do I reproduce your environment?
@tmds, the following are the steps to install LXD and creating the Jammy VM/Container (and reproduce the initial issue here). I use Ubuntu also like host, but you can do it on Fedora or Windows among others as well :
# Install lxd (https://linuxcontainers.org/lxd/getting-started-cli/)
In Ubuntu: sudo snap install lxd
In Fedora: dnf copr enable ganto/lxc4
dnf install lxd
Windows: choco install lxc (previously installing Chocolatey)
# Configuring LXD (https://linuxcontainers.org/lxd/docs/latest/howto/initialize/)
lxd init #(interactive)
or
lxd init --minimal #(for a quick test)
# Creating the container
lxc launch --vm ubuntu-daily:jammy Jdotnet #(you can choose another name instead of Jdotnet)
# Login
lxc exec Jdotnet -- sudo --login --user ubuntu
# checking HOME (it should be /home/ubuntu)
env | grep HOME
# Installing dotnet6
sudo apt update
sudo apt install -y dotnet6
# The specific issue in #31685
dotnet workload install wasm-tools
dotnet workload list
If you have any problems, please let me Know
@mirespace this is messing up HOME
in your environment:
If you unset SUDO_UID
it will work.
Thanks @tmds!
I run
sudo dotnet workload install wasm-tools
, it says that installation was successful. When I then rundotnet workload list
it shows no workloads.Output of installation:
Output of
workload list
:Further technical details
dotnet info:
Note: The OS
tuxedo
is basically Ubuntu.