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

[ppc64le][mono] dotnet tool update -g is failing #41672

Closed
Swapnali911 opened this issue Jun 19, 2024 · 4 comments
Closed

[ppc64le][mono] dotnet tool update -g is failing #41672

Swapnali911 opened this issue Jun 19, 2024 · 4 comments
Labels
Area-Tools untriaged Request triage from a team member

Comments

@Swapnali911
Copy link
Contributor

To Reproduce

Run dotnet tool update -g dotnet-trace

Actual :

Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2[[System.CommandLine.CliSymbol, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[System.CommandLine.Parsing.SymbolResult, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].FindValue(CliSymbol key)
   at System.Collections.Generic.Dictionary`2[[System.CommandLine.CliSymbol, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[System.CommandLine.Parsing.SymbolResult, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].TryGetValue(CliSymbol key, SymbolResult& value)
   at System.CommandLine.Parsing.SymbolResultTree.GetResult(CliOption option)
   at System.CommandLine.Parsing.SymbolResult.GetResult(CliOption option)
   at System.CommandLine.ParseResult.GetResult(CliOption option)
   at Microsoft.DotNet.Tools.Tool.Common.ToolAppliedOption.EnsureNoConflictUpdateAllVersionOption(ParseResult parseResult, String message)
   at Microsoft.DotNet.Tools.Tool.Update.ToolUpdateCommand.Execute()
   at Microsoft.DotNet.Cli.ToolUpdateCommandParser.<>c.<ConstructCommand>b__5_0(ParseResult parseResult)
   at System.CommandLine.Invocation.AnonymousSynchronousCliAction.Invoke(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at System.CommandLine.ParseResult.Invoke()
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

Expected :
dotnet tool update should work without any issue

Tarball Details :

# dotnet --info
.NET SDK:
 Version:           9.0.100-preview.5.24307.1
 Commit:            35b2c21ea6
 Workload version:  9.0.100-manifests.9b4ca231
 MSBuild version:   17.11.0-preview-24279-02+b963c24ef

Runtime Environment:
 OS Name:     rhel
 OS Version:  9
 OS Platform: Linux
 RID:         linux-ppc64le
 Base Path:   /home/check_tarball/.dotnet/sdk/9.0.100-preview.5.24307.1/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      9.0.0-preview.5.24306.7
  Architecture: ppc64le
  Commit:       a5cc707d97

.NET SDKs installed:
  9.0.100-preview.5.24307.1 [/home/check_tarball/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.5.24306.11 [/home/check_tarball/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.5.24306.7 [/home/check_tarball/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/home/check_tarball/.dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

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

cc : @tmds @omajid @alhad-deshpande @ashwinik30

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Jun 19, 2024
@tmds
Copy link
Member

tmds commented Jun 19, 2024

This is a Mono runtime issue. It happens also on x64.

The supposed null argument is the VersionOption that is passed here:

if (parseResult.GetResult(VersionOption) is not null)

VersionOption a static that gets intialized from another class's static:

public static readonly CliOption<string> VersionOption = ToolInstallCommandParser.VersionOption;

public static readonly CliOption<string> VersionOption = new("--version")
{
Description = LocalizableStrings.VersionOptionDescription,
HelpName = LocalizableStrings.VersionOptionName
};

The VersionOption was added in this PR #38996 which is why we're only recently seeing this issue.

An easy workaround may be to initialize the VersionOption in ToolAppliedOption.
The root cause seems some issue with the static initialization in Mono.

cc @lambdageek @uweigand

@lambdageek
Copy link
Member

Probably related to dotnet/runtime#88066 or dotnet/runtime#77513

@lambdageek
Copy link
Member

/cc @steveisok

@marcpopMSFT
Copy link
Member

I believe that tmds fixed this in the linked issue so marking it closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants