dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Maui: Workload installation failed: The transaction has aborted #19739

Closed salimhali closed 3 years ago

salimhali commented 3 years ago

hello I have problem with workload install maui I've tried to fix it but all my attempts were failed same problem appears with maui-check command or dotnet workload install maui command I need your help

Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 6.0.0-preview.7.21377.19... Workload installation failed: The transaction has aborted.

this what appears exactly

! Attempt to fix? [y/n] (y): y » Attempting to fix: .NET SDK - Workloads (6.0.100-preview.7.21379.14) SHELL: C:\Program Files\dotnet\dotnet.exe workload repair --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json"

Repairing workload installation for workloads: Garbage collecting for SDK feature bands ...

Successfully repaired worklods:

SHELL: C:\Program Files\dotnet\dotnet.exe workload update --sdk-version 6.0.100-preview.7.21379.14 --no-cache --disable-parallel --from-rollback-file "C:\Users\halis\AppData\Local\Temp\maui-check-dotnet-work-dir\workload.json" --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json"

No workloads installed for this feature band. To update from the previous SDK, include the --from-previous-sdk option. Updated advertising manifest microsoft.net.sdk.android. Updated advertising manifest microsoft.net.sdk.ios. Updated advertising manifest microsoft.net.sdk.maccatalyst. Updated advertising manifest microsoft.net.sdk.macos. Updated advertising manifest microsoft.net.sdk.maui. Updated advertising manifest microsoft.net.sdk.tvos. Updated advertising manifest microsoft.net.workload.emscripten. Updated advertising manifest microsoft.net.workload.mono.toolchain. Installing workload manifest microsoft.net.sdk.android version 30.0.100-preview.7.110. Installing workload manifest microsoft.net.sdk.ios version 15.0.100-preview.7.230. Installing workload manifest microsoft.net.sdk.maccatalyst version 15.0.100-preview.7.230. Installing workload manifest microsoft.net.sdk.tvos version 15.0.100-preview.7.230. Installing workload manifest microsoft.net.sdk.macos version 12.0.100-preview.7.230. Installing workload manifest microsoft.net.sdk.maui version 6.0.100-preview.7.1345. Installing workload manifest microsoft.net.workload.mono.toolchain version 6.0.0-preview.7.21377.19. Installing workload manifest microsoft.net.workload.emscripten version 6.0.0-preview.7.21377.2. No workloads installed for this feature band. To update from the previous SDK, include the --from-previous-sdk option. Garbage collecting for SDK feature bands ...

Successfully updated workload(s): .

SHELL: C:\Program Files\dotnet\dotnet.exe workload install --sdk-version 6.0.100-preview.7.21379.14 --no-cache --disable-parallel android-aot ios maccatalyst tvos macos maui wasm-tools --skip-manifest-update --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json"

Installing pack Microsoft.Android.Sdk version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Sdk version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Sdk.BundleTool version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Sdk.BundleTool version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Ref version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Ref version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Runtime.android-arm version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Runtime.android-arm version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Runtime.android-arm64 version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Runtime.android-arm64 version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Runtime.android-x86 version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Runtime.android-x86 version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Runtime.android-x64 version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Runtime.android-x64 version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Templates version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Templates version 30.0.100-preview.7.110... Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 6.0.0-preview.7.21377.19... Workload installation failed, rolling back installed packs... Uninstalling workload pack Microsoft.Android.Sdk version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Sdk.BundleTool version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Ref version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Runtime.android-arm version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Runtime.android-arm64 version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Runtime.android-x86 version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Runtime.android-x64 version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.Android.Templates version 30.0.100-preview.7.110. Uninstalling workload pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 6.0.0-preview.7.21377.19. Rolling back pack Microsoft.Android.Sdk installation... Rolling back pack Microsoft.Android.Sdk.BundleTool installation... Rolling back pack Microsoft.Android.Ref installation... Rolling back pack Microsoft.Android.Runtime.android-arm installation... Rolling back pack Microsoft.Android.Runtime.android-arm64 installation... Rolling back pack Microsoft.Android.Runtime.android-x86 installation... Rolling back pack Microsoft.Android.Runtime.android-x64 installation... Rolling back pack Microsoft.Android.Templates installation... Rolling back pack Microsoft.NETCore.App.Runtime.Mono.android-arm installation... Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm version 6.0.0-preview.7.21377.19... Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 6.0.0-preview.7.21377.19... Workload installation failed: The transaction has aborted. install Install a workload.

Usage: dotnet [options] workload install [...]

Arguments:

The NuGet Package Id of the workload to install. Options: --sdk-version The version of the SDK. --configfile The NuGet configuration file to use. -s, --source The NuGet package source to use during the restore. --skip-manifest-update Skip updating the workload manifests. --from-cache Complete the operation from cache (offline). --download-to-cache Download packages needed to install a workload to a folder which can be used for offline installation. --include-previews Allow prerelease workload manifests. --temp-dir Configure the temporary directory used for this command (must be secure). --disable-parallel Prevent restoring multiple projects in parallel. --ignore-failed-sources Treat package source failures as warnings. --no-cache Do not cache packages and http requests. --interactive Allows the command to stop and wait for user input or action (for example to complete authentication). -v, --verbosity Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. -?, -h, --help Show help and usage information Fix failed - Workload Install failed: `dotnet workload install --sdk-version 6.0.100-preview.7.21379.14 --no-cache --disable-parallel android-aot ios maccatalyst tvos macos maui wasm-tools --skip-manifest-update --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json"` ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ! There were one or more problems detected. Please review the errors and correct them and run maui-check again. Press enter to exit...
sfoslund commented 3 years ago

@salimhali is it possible that you killed a dotnet process halfway through the install? Based on the error message, that's what seems to have happened. Is this error occurring consistently?

salimhali commented 3 years ago

@salimhali is it possible that you killed a dotnet process halfway through the install? Based on the error message, that's what seems to have happened. Is this error occurring consistently?

Thanks sfoslund this error is occurring constantly I have tried to solve it multiple time and i tried to install workload in other pc the same error appears even in macOS system This photo from my mac Screen Shot 2021-08-19 at 6 23 32 AM

mattleibow commented 3 years ago

I also get this every time on both on windows and mac.

I found I could pass this by manually installing ios, android, tvos, macos, macactalyst manually first. One at a time. Then maui just installs fine.

I also tried with --disable-parallel but that does not seem to help.

Redth commented 3 years ago

It also seems that running the command multiple times can eventually lead to success. Some intermittent failure happening here.

sfoslund commented 3 years ago

I found I could pass this by manually installing ios, android, tvos, macos, macactalyst manually first. One at a time. Then maui just installs fine.

Hmm interesting, @mattleibow so were you seeing this error when you installed any combination of workloads? Or only maui and and of these other workloads?

salimhali commented 3 years ago

I also get this every time on both on windows and mac.

I found I could pass this by manually installing ios, android, tvos, macos, macactalyst manually first. One at a time. Then maui just installs fine.

I also tried with --disable-parallel but that does not seem to help.

I 've tried to install every combination of maui manually but the installation has been failed in 3 combination maui-Android and maui-Mobile and maui-ios and has been succeeded with maui-windows and maui-desktop also maui-maccatalyst I didn't see this error with non-maui workloads only with maui

salimhali commented 3 years ago

I also get this every time on both on windows and mac. I found I could pass this by manually installing ios, android, tvos, macos, macactalyst manually first. One at a time. Then maui just installs fine. I also tried with --disable-parallel but that does not seem to help.

I 've tried to install every combination of maui manually but the installation has been failed in 3 combination maui-Android and maui-Mobile and maui-ios and has been succeeded with maui-windows and maui-desktop also maui-maccatalyst I didn't see this error with non-maui workloads only with maui

It also seems that running the command multiple times can eventually lead to success. Some intermittent failure happening here.

many much attempts same error ???

mattleibow commented 3 years ago

I got it for any combination. You must install one by one. Maui must be last as it depends on them all.

salimhali commented 3 years ago

screenshot with command 'dotnet workload install maui-android' Screenshot 2021-08-20 064244

screenshot with command 'dotnet workload install maui-windows' Screenshot win

salimhali commented 3 years ago

I got it for any combination. You must install one by one. Maui must be last as it depends on them all.

Same problem I think there is problem with Android SDK package Screenshot

salimhali commented 3 years ago

Hello Thanks for all, finally i have solved my problem and get maui installed successfully . I have installed every combination of workload alone one by one that led to success of maui install operation special thanks to mattleiboweibow

Screenshot

sfoslund commented 3 years ago

I haven't been able to repro this, can you please provide the SDK version you're using and any notes on your configuration- for example, did you have any workloads installed before this? Did you previously have any other preview SDKs installed?

mattleibow commented 3 years ago

I was on one of the later rc.1 versions. But... Talking to people on my team, it seems the ones further away from the use have this more often. Canada gets it every so often, but me in South Africa gets it every time. It seels to happen after a few minutes. I have a 100mb connection and very reliable.

@Redth might have more info, but I think he also got this while using the nuget api directly. Might be devops causing issues rather than dotnet.

StevenTCramer commented 3 years ago

I just got this error.
SDK version 6.0.0-preview.7.21377.19

https://gist.github.com/StevenTCramer/8ed291ee9f09398a238430e918411a20

  █C:\git\temp\Maui█ dotnet --list-sdks
2.1.816 [C:\Program Files\dotnet\sdk]
3.1.202 [C:\Program Files\dotnet\sdk]
3.1.300-preview-015115 [C:\Program Files\dotnet\sdk]
3.1.300 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
3.1.402 [C:\Program Files\dotnet\sdk]
3.1.403 [C:\Program Files\dotnet\sdk]
3.1.404 [C:\Program Files\dotnet\sdk]
3.1.408 [C:\Program Files\dotnet\sdk]
3.1.409 [C:\Program Files\dotnet\sdk]
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.101 [C:\Program Files\dotnet\sdk]
5.0.103 [C:\Program Files\dotnet\sdk]
5.0.203 [C:\Program Files\dotnet\sdk]
5.0.205 [C:\Program Files\dotnet\sdk]
5.0.301 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
5.0.400-preview.21277.10 [C:\Program Files\dotnet\sdk]
5.0.400-preview.21328.4 [C:\Program Files\dotnet\sdk]
6.0.100-preview.4.21255.9 [C:\Program Files\dotnet\sdk]
6.0.100-preview.7.21379.14 [C:\Program Files\dotnet\sdk]
> dotnet workload list
Workload Id
---------------------------------------
microsoft-net-sdk-blazorwebassembly-aot
sfoslund commented 3 years ago

Thanks for providing the info, @StevenTCramer! Is @mattleibow's observation relevant to you as well? Are you physically located far away from Redmond, WA?

StevenTCramer commented 3 years ago

@sfoslund Yes, I am in Thailand. Trying to install workloads via VS2022 now. As alternative.

sfoslund commented 3 years ago

Hmm okay. @wli3 @dsplaisted I think @mattleibow is right and this has to do with devops, is there anything we can do about that?

mattleibow commented 3 years ago

Just had a chat with Argentina. They also ended up manually downloading the files to a local folder.

wli3 commented 3 years ago

@nkolev92 do you know the cause of the error "transaction has aborted" from using nuget API directly? Any direction to debug this?

nkolev92 commented 3 years ago

@wli3

The error is coming from the framework, so I can't provide an extra advice.

Consider logging more details about the exception on higher verbosity.

For example, NuGet side we do: ExceptionUtilities.LogException

Redth commented 3 years ago

@wli3 @dsplaisted this error is becoming more frequent. It seems still very intermittent but I've seen several people experience it, and some have better success from different connections and locations. I saw this myself the other day and spent a few hours re-running the workload install command and hitting the error at different points in the install. Finally after enough times it succeeded.

Given we're using a lot of AzDo nuget feeds, I wonder if that's at all related. Would it make sense to build in some retry logic to the install command when it encounters this error?

tobiasschulz commented 3 years ago

Shouldnt it be relatively easy to fix this?

It's barely possible to install anything :D

dsplaisted commented 3 years ago

@wli3 @sfoslund @joeloff We should consider improving the --download-to-cache functionality to help with this issue (for example, #20308), especially if we can't figure out other ways to address intermittent download failures.

dsplaisted commented 3 years ago

I've filed #20617 with some ideas for how we can make this work better even if downloads may fail

wli3 commented 3 years ago

@dsplaisted let's talk about this in the workload meeting. I don't think --download-to-cache will hope that much, We would fail to download package just like we fail to install. I think retry might be a better solution. Considering a large workload would fail by one of the packs.

tobiasschulz commented 3 years ago

But why do the downloads fail? On a wired connection from US to europe?

mattleibow commented 3 years ago

I don't think it has anything to do with the network. I have a very stable and 200MB connection an I can download GBs just fine. The downloads don't seem to fail more than something cancels them.

I run this command with dotnet sdk 6.0.100-rc.2.21456.2:

dotnet workload install --no-cache --disable-parallel android-aot ios maccatalyst tvos macos maui wasm-tools --skip-manifest-update --source "https://pkgs.dev.azure.com/xamarin/public/_packaging/maui-main/nuget/v3/index.json" --source "https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" --source "https://api.nuget.org/v3/index.json"

After 10 minutes to the second, it fails and starts an uninstall. I tested several times to make sure it was not a coincidence. Each time, 10 mins.

How long are other people getting? Could it be some connection that is help open? If yours finishes faster, can you check some sort of throttling and see?

Redth commented 3 years ago

@dsplaisted @marcpopMSFT @wli3 this is becoming more and more of an issue and it seems to happen more commonly with non-US based connections (i've seen it myself quite a few times in Canada here too).

wli3 commented 3 years ago

Find it https://stackoverflow.com/questions/12055511/transaction-scope-timeout-on-10-minutes

there is a default transaction scope timeout for 10 minutes

jonlipsky commented 3 years ago

@Redth @dsplaisted I'm having the same issues as well, and I'm located in the US (Duvall, WA) on a Gigabit connection.

dsplaisted commented 3 years ago

I'm having the same issues as well, and I'm located in the US (Duvall, WA) on a Gigabit connection.

@jonlipsky Is it timing out after exactly 10 minutes for you?

jonlipsky commented 3 years ago

@dsplaisted Yes.

dsplaisted commented 3 years ago

@jonlipsky Great, then it seems likely that #21102 will fix this for you.