unoplatform / uno.check

CLI tool to setup your environment to build Uno Platform apps
https://platform.uno
30 stars 17 forks source link

Uno-check does not download new SDK version #88

Open stevenlafl opened 2 years ago

stevenlafl commented 2 years ago

I am unable to update to the latest SDK or finish running uno-check. I tried also saying "No" to the "attempt to fix" dialog, and it also shows the deduplication workflow message.

πŸš‘ Uno Platform Check v1.5.3.0 πŸ’‰
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This tool will check your Uno Platform development environment.
If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏳ Synchronizing configuration... ok
⏳ Scheduling appointments... ok

πŸ”Ž .NET SDK Checkup...
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK
Fix applied.  Checking again...

πŸ”Ž .NET SDK Checkup...
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y

❌ Skipped: .NET SDK - Workload Deduplication

πŸ”Ž GTK3+ Checkup...

❌ Skipped: .NET SDK - Workloads (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” There were one or more problems detected.
Please review the errors and correct them and run uno-check again.

Press Enter to finish...

Checking the dotnet library folder:

$ ls -la /usr/lib/dotnet
total 12
drwxr-xr-x   3 root root 4096 Aug 22 13:35 .
drwxr-xr-x 125 root root 4096 Aug 12 13:39 ..
lrwxrwxrwx   1 root root   25 Aug 22 13:35 dotnet6 -> /etc/alternatives/dotnet6
drwxr-xr-x  10 root root 4096 Aug 22 13:35 dotnet6-6.0.108

Running it as root (sudo) it bizarrely shows that it requires superuser permission and should be run with sudo:

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK
πŸ”” Super User Permissions Required.  Try running this tool again with 'sudo'.
❌ Skipped: .NET SDK - Workload Deduplication

πŸ”Ž GTK3+ Checkup...

❌ Skipped: .NET SDK - Workloads (6.0.400-rtm.22364.21)

Here's my platform and dotnet information (Installed by Ubuntu's package manager, not using the microsoft repository):

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.108
 Commit:    4e3a463d2b

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108/

global.json file:
  Not found

Host:
  Version:      6.0.8
  Architecture: x64
  Commit:       55fb7ef977

.NET SDKs installed:
  6.0.108 [/usr/lib/dotnet/dotnet6-6.0.108/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info
jeromelaban commented 2 years ago

Thanks for the report. Are you using Ubuntu? It looks like you installed .NET using apt install dotnet6, is that the case?

stevenlafl commented 2 years ago

Yes, 22.04. Using apt install dotnet-sdk-6.0. I had originally installed it with microsoft's repository, however there was an advisory. I performed the steps under "Mixed state scenario 1" as instructed here https://github.com/dotnet/core/issues/7699 . According to that, I shouldn't have the dotnet6 package unless it were a dependency of one of these:

$ sudo apt list | grep dotnet

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

dotnet-apphost-pack-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-host/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-hostfxr-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-runtime-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-sdk-6.0-source-built-artifacts/jammy-updates 6.0.108-0ubuntu1~22.04.1 amd64
dotnet-sdk-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed]
dotnet-targeting-pack-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet-templates-6.0/jammy-updates,now 6.0.108-0ubuntu1~22.04.1 amd64 [installed,automatic]
dotnet6/jammy-updates 6.0.108-0ubuntu1~22.04.1 amd64
libgtk-dotnet3.0-cil-dev/jammy 2.99.3-4build1 amd64
libgtk-dotnet3.0-cil/jammy 2.99.3-4build1 amd64

Something look off?

jeromelaban commented 2 years ago

Nothing does look off, no, thanks. This particular (and very new) installation method seems to be interfering with the "command line" installer that uno-check uses. Can you also provide the output from uno-check --verbose?

Now, it may not be a problem for now, particularly as you're running dotnet on Linux. You should still be able to build and run uno apps with the apt install dotnet6 install.

stevenlafl commented 2 years ago
πŸš‘ Uno Platform Check v1.5.3.0 πŸ’‰
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This tool will check your Uno Platform development environment.
If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏳ Synchronizing configuration...Loading Manifest from: https://raw.githubusercontent.com/unoplatform/uno.check/d1aae2371cf6f6f241fc6f664ce16d042f6cdf0b/manifests/uno.ui.manifest.json
Required Version: 1.5.0
Current Version: 1.5.3.0
 ok
⏳ Scheduling appointments...SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
 ok

πŸ”Ž .NET SDK Checkup...
SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
SHELL: /bin/bash /tmp/tmpS2KIVA.tmp
6.0.108 [/usr/lib/dotnet/dotnet6-6.0.108/sdk]
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK=/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK_VERSION=6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK
Downloading dotnet-install script: https://dot.net/v1/dotnet-install.sh
Executing dotnet-install script...
        bash "/tmp/dotnet-install.sh" --install-dir "/usr/lib/dotnet/dotnet6-6.0.108" --version "6.0.400-rtm.22364.21"
SHELL: /bin/bash /tmp/tmpvk6HLo.tmp
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.400-rtm.22364.21/dotnet-sdk-6.0.400-rtm.22364.21-linux-x64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.400-rtm.22364.21/dotnet-sdk-6.0.400-rtm.22364.21-linux-x64.tar.gz' is not available.
dotnet-install: Attempting to download using primary link https://dotnetbuilds.azureedge.net/public/Sdk/6.0.400-rtm.22364.21/dotnet-sdk-6.0.400-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetbuilds.azureedge.net/public/Sdk/6.0.400-rtm.22364.21/dotnet-sdk-6.0.400-linux-x64.tar.gz
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/host/fxr/6.0.7/': Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/packs/Microsoft.AspNetCore.App.Ref/6.0.7/': Permission denied
mkdir: cannot create directory β€˜/usr/lib/dotnet/dotnet6-6.0.108/packs/Microsoft.NETCore.App.Host.linux-x64’: Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/packs/Microsoft.NETCore.App.Host.linux-x64/6.0.7/': No such file or directory
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/packs/Microsoft.NETCore.App.Ref/6.0.7/': Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400/': Permission denied
mkdir: cannot create directory β€˜/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400’: Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400/DotnetTools/dotnet-dev-certs/6.0.7-servicing.22322.5/': No such file or directory
mkdir: cannot create directory β€˜/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400’: Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400/DotnetTools/dotnet-user-secrets/6.0.7-servicing.22322.5/': No such file or directory
mkdir: cannot create directory β€˜/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400’: Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400/DotnetTools/dotnet-watch/6.0.400-preview.22364.3/': No such file or directory
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/sdk-manifests/6.0.300/': Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App/6.0.7/': Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App/6.0.7/': Permission denied
cp: cannot create directory '/usr/lib/dotnet/dotnet6-6.0.108/templates/6.0.7/': Permission denied
cp: cannot create regular file '/usr/lib/dotnet/dotnet6-6.0.108/dotnet': Permission denied
cp: cannot create regular file '/usr/lib/dotnet/dotnet6-6.0.108/ThirdPartyNotices.txt': Permission denied
cp: cannot create regular file '/usr/lib/dotnet/dotnet6-6.0.108/LICENSE.txt': Permission denied
dotnet_install: Error: Failed to verify the version of installed `.NET Core SDK`.
Installation source: https://dotnetbuilds.azureedge.net/public/Sdk/6.0.400-rtm.22364.21/dotnet-sdk-6.0.400-linux-x64.tar.gz.
Installation location: /usr/lib/dotnet/dotnet6-6.0.108.
Report the bug at https://github.com/dotnet/install-scripts/issues.
dotnet_install: Error: `.NET Core SDK` with version = 6.0.400 failed to install with an error.
Fix applied.  Checking again...

πŸ”Ž .NET SDK Checkup...
SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
SHELL: /bin/bash /tmp/tmpvBj9vD.tmp
6.0.108 [/usr/lib/dotnet/dotnet6-6.0.108/sdk]
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK=/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK_VERSION=6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y

❌ Skipped: .NET SDK - Workload Deduplication

πŸ”Ž GTK3+ Checkup...
SHELL: /bin/bash /tmp/tmpheDDlE.tmp
libgdk-3.so.0: /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

❌ Skipped: .NET SDK - Workloads (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Checkup had Error status: dotnet

dotnet: .NET SDK (6.0.400-rtm.22364.21) not installed.
πŸ”” There were one or more problems detected.
Please review the errors and correct them and run uno-check again.

Press Enter to finish...

Has Errors? True

Interesting. It almost seems like the check for superuser is inverted given what I get when I run it with sudo (asks for superuser permission)

With sudo:

πŸš‘ Uno Platform Check v1.5.3.0 πŸ’‰
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This tool will check your Uno Platform development environment.
If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏳ Synchronizing configuration...Loading Manifest from: https://raw.githubusercontent.com/unoplatform/uno.check/d1aae2371cf6f6f241fc6f664ce16d042f6cdf0b/manifests/uno.ui.manifest.json
Required Version: 1.5.0
Current Version: 1.5.3.0
 ok
⏳ Scheduling appointments...SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
 ok

πŸ”Ž .NET SDK Checkup...
SetEnvironmentVariable: DOTNET_ROOT=/usr/lib/dotnet/dotnet6-6.0.108
SHELL: /bin/bash /tmp/tmps1GA0i.tmp
6.0.108 [/usr/lib/dotnet/dotnet6-6.0.108/sdk]
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK=/usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
SetEnvironmentVariable: DOTNET_SDK_VERSION=6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK
Downloading dotnet-install script: https://dot.net/v1/dotnet-install.sh
System.UnauthorizedAccessException: Access to the path '/tmp/dotnet-install.sh' is denied.
     System.IO.IOException: Permission denied                                                                          
     …                                                                                                                 
  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.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)  
  at System.IO.File.WriteAllText(String path, String contents)                                                         
  at DotNetCheck.Solutions.DotNetSdkScriptInstallSolution.Implement(SharedState sharedState, CancellationToken         
     cancellationToken) in /_/UnoCheck/Solutions/DotNetSdkScriptInstallSolution.cs:49                                  
  at DotNetCheck.Cli.CheckCommand.ExecuteAsync(CommandContext context, CheckSettings settings) in /_/UnoCheck/         
     CheckCommand.cs:228                                                                                               
πŸ”” Super User Permissions Required.  Try running this tool again with 'sudo'.
❌ Skipped: .NET SDK - Workload Deduplication

πŸ”Ž GTK3+ Checkup...
SHELL: /bin/bash /tmp/tmp2XmoX6.tmp
libgdk-3.so.0: /usr/lib/x86_64-linux-gnu/libgdk-3.so.0

❌ Skipped: .NET SDK - Workloads (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Checkup had Error status: dotnet

dotnet: .NET SDK (6.0.400-rtm.22364.21) not installed.
πŸ”” There were one or more problems detected.
Please review the errors and correct them and run uno-check again.

Press Enter to finish...

So I wonder why root would not be able to write to /tmp

No special partition structure.

nvme0n1     259:5    0   1.8T  0 disk 
β”œβ”€nvme0n1p1 259:6    0   512M  0 part /boot/efi
└─nvme0n1p2 259:7    0   1.8T  0 part /
jeromelaban commented 2 years ago

Access denied may be caused by the emulation of the file sharing features of windows, or maybe because the file exists with non-root compatible set of permissions. There's should be an automatic sudo, though, for the first log. We'll look into it.

Are you still able to continue further to run an uno app ?

stevenlafl commented 2 years ago

So, I fixed it. I didn't know about --verbose, thank you for that tip.

It looks like I only got prompted for sudo permissions if the /tmp/dotnet-install.sh access check fails, so perhaps some additional permissions error handling and ownership/rewrite rules would be good there.

I removed the dotnet install script it was failing on:

$ ls -la /tmp | grep dotnet
-rw-rw-r--  1 stevenlafl stevenlafl  56297 Aug 22 14:30 dotnet-install.sh

$ rm -rf /tmp/dotnet-install.sh

Then ran uno-check as root:

$ sudo ~/.dotnet/tools/uno-check

πŸš‘ Uno Platform Check v1.5.3.0 πŸ’‰
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This tool will check your Uno Platform development environment.
If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏳ Synchronizing configuration... ok
⏳ Scheduling appointments... ok

πŸ”Ž .NET SDK Checkup...
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
πŸ’‰ Recommendation: Download .NET SDK (6.0.400-rtm.22364.21)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK
Fix applied.  Checking again...

πŸ”Ž .NET SDK Checkup...
  – 6.0.108 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108
  – 6.0.400 - /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.400

πŸ”Ž .NET SDK - Workload Deduplication Checkup...

πŸ”Ž GTK3+ Checkup...

πŸ”Ž .NET SDK - Workloads (6.0.400-rtm.22364.21) Checkup...
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

βœ” Congratulations, everything looks great!

And now /tmp/dotnet-install.sh looks like:

$ ls -la /tmp | grep dotnet
-rw-r--r--  1 root       root        56297 Aug 22 14:55 dotnet-install.sh

Are you still able to continue further to run an uno app ?

This is my first time with Uno, so I am not sure yet. If I experience issues that aren't already in the issue queue, I'll add another one.

jeromelaban commented 2 years ago

Thanks for taking the time to troubleshoot!