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

Version Check blocks tool if it can't access nuget.org #278

Open
afscrome opened this issue Jan 17, 2025 · 0 comments
Open

Version Check blocks tool if it can't access nuget.org #278

afscrome opened this issue Jan 17, 2025 · 0 comments

Comments

@afscrome
Copy link

🔥 Bug Description

Trying to run aspirate on a machine without access to api.nuget.org. (In my case this is due to corporate firewall rules, but I imagine similar would occur if you have no network connection), then the generate command fails completely. (See output below)

I wouldn't expect a filed version update check to block the tool from running.

🔍 Steps to Reproduce the Bug

On a machine that doesn't have access to api.nuget.org , run aspirate generate.

🧯 Possible Solution

Logging a warning but continuing would be sufficient.

Alternatively if an error is thrown, the error should include details on how to skip the update check (create a file in %localappdata%\Aspirate\updates-disabled)

Output

> aspirate generate

     _                    _           ___
    / \     ___   _ __   (_)  _ __   ( _ )
   / _ \   / __| | '_ \  | | | '__|  / _ \
  / ___ \  \__ \ | |_) | | | | |    | (_) |
 /_/   \_\ |___/ | .__/  |_| |_|     \___/
                 |_|
Handle deployments of a .NET Aspire AppHost

(!) Unable to load the service index for source https://api.nuget.org/v3/index.json.
Unhandled exception: Aspirate.Shared.Exceptions.ActionCausesExitException: Exception of type 'Aspirate.Shared.Exceptions.ActionCausesExitException' was thrown.
   at Aspirate.Shared.Exceptions.ActionCausesExitException.ExitNow(Int32 exitCode) in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Shared/Exceptions/ActionCausesExitException.cs:line 7
   at Aspirate.Shared.Extensions.AnsiConsoleExtensions.ValidationFailed(IAnsiConsole console, String message) in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Shared/Extensions/AnsiConsoleExtensions.cs:line 15
   at Aspirate.Services.Implementations.VersionCheckService.PerformUpdateCheck(String lastVersionCheckedFilePath) in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Services/Implementations/VersionCheckService.cs:line 152
   at Aspirate.Commands.Commands.BaseCommand`2.ConstructCommand(TOptions options, IServiceCollection services) in /home/runner/work/aspirational-manifests/aspirational-manifests/src/Aspirate.Commands/Commands/BaseCommand.cs:line 27
   at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue, InvocationContext context)
   at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant