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

[Bug] If a altcoins is disabled from BTCPay and payout processor is used, it would crash at restart #4997

Merged
merged 2 commits into from May 25, 2023

Conversation

NicolasDorier
Copy link
Member

@astupidmoose reported that his btcpay was failing to start after disabling Dash with this exception.

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'network')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
   at BTCPayServer.ExplorerClientProvider.GetExplorerClient(BTCPayNetworkBase network) in /source/BTCPayServer/ExplorerClientProvider.cs:line 86
   at BTCPayServer.Services.Fees.NBXplorerFeeProviderFactory.CreateFeeProvider(BTCPayNetworkBase network) in /source/BTCPayServer/Services/Fees/NBxplorerFeeProvider.cs:line 22
   at BTCPayServer.PayoutProcessors.OnChain.OnChainAutomatedPayoutProcessor..ctor(ApplicationDbContextFactory applicationDbContextFactory, ExplorerClientProvider explorerClientProvider, BTCPayWalletProvider btcPayWalletProvider, BTCPayNetworkJsonSerializerSettings btcPayNetworkJsonSerializerSettings, ILoggerFactory logger, BitcoinLikePayoutHandler bitcoinLikePayoutHandler, EventAggregator eventAggregator, WalletRepository walletRepository, StoreRepository storeRepository, PayoutProcessorData payoutProcesserSettings, PullPaymentHostedService pullPaymentHostedService, BTCPayNetworkProvider btcPayNetworkProvider, IPluginHookService pluginHookService, IFeeProviderFactory feeProviderFactory) in /source/BTCPayServer/PayoutProcessors/OnChain/OnChainAutomatedPayoutProcessor.cs:line 57
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance[T](IServiceProvider provider, Object[] parameters)
   at BTCPayServer.PayoutProcessors.OnChain.OnChainAutomatedPayoutSenderFactory.ConstructProcessor(PayoutProcessorData settings) in /source/BTCPayServer/PayoutProcessors/OnChain/OnChainAutomatedPayoutSenderFactory.cs:line 61
   at BTCPayServer.PayoutProcessors.PayoutProcessorService.StartOrUpdateProcessor(PayoutProcessorData data, CancellationToken cancellationToken) in /source/BTCPayServer/PayoutProcessors/PayoutProcessorService.cs:line 139
   at BTCPayServer.PayoutProcessors.PayoutProcessorService.StartAsync(CancellationToken cancellationToken) in /source/BTCPayServer/PayoutProcessors/PayoutProcessorService.cs:line 119
   at Microsoft.AspNetCore.Hosting.HostedServiceExecutor.ExecuteAsync(Func2 callback, Boolean throwOnFirstFailure)
   at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.StartWithTasksAsync(IWebHost webHost, CancellationToken cancellationToken) in /source/BTCPayServer/Extensions/WebHostExtensions.cs:line 23
   at BTCPayServer.Program.Main(String[] args) in /source/BTCPayServer/Program.cs:line 76

This PR catch errors in the constructors of payouts and just skip them.

@NicolasDorier NicolasDorier added this to the 1.10.0 milestone May 25, 2023
Copy link
Member

@dennisreimann dennisreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UtACK. Looks simple enough.

@dennisreimann dennisreimann merged commit 3d5361c into master May 25, 2023
2 of 4 checks passed
@dennisreimann dennisreimann deleted the qtioqtqotn branch May 25, 2023 10:42
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

Successfully merging this pull request may close these issues.

None yet

3 participants