question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: brand new btcpayserver can't generate new btc receive address

See original GitHub issue

What is your BTCPay version?

v1.6.12.0 (Altcoins)

How did you deploy BTCPay Server?

docker build

What happened?

Create a new store, create a btc wallet, check import private key to rpc Then, creating a new bitcoin address fails

How did you encounter this bug?

Add bitcoin wallet, select segwit, check import private key to rpc generate new receive address

Relevant log output

fail: Microsoft.AspNetCore.Server.Kestrel: Connection id "0HMLCA8B39H2P", Request id "0HMLCA8B39H2P:0000002D": An unhandled exception was thrown by the application.
NBitcoin.RPC.RPCException: This type of wallet does not support this command
   at NBitcoin.RPC.RPCResponse.ThrowIfError()
   at NBitcoin.RPC.RPCClient.SendCommandAsync(RPCRequest request, CancellationToken cancellationToken)
   at NBitcoin.RPC.RPCClient.ImportPrivKeyAsync(BitcoinSecret secret, String label, Boolean rescan)
   at NBXplorer.Backends.Postgres.PostgresRepository.ImportAddressToRPC(BitcoinExtKey accountKey, BitcoinAddress address, KeyPath keyPath) in /source/NBXplorer/Backends/Postgres/PostgresRepository.cs:line 886
   at NBXplorer.Backends.Postgres.PostgresRepository.ImportAddressToRPC(DbConnectionHelper connection, TrackedSource trackedSource, BitcoinAddress address, KeyPath keyPath) in /source/NBXplorer/Backends/Postgres/PostgresRepository.cs:line 880
   at NBXplorer.Backends.Postgres.PostgresRepository.GetUnused(DerivationStrategyBase strategy, DerivationFeature derivationFeature, Int32 n, Boolean reserve) in /source/NBXplorer/Backends/Postgres/PostgresRepository.cs:line 807
   at NBXplorer.Backends.Postgres.PostgresRepository.GetUnused(DerivationStrategyBase strategy, DerivationFeature derivationFeature, Int32 n, Boolean reserve) in /source/NBXplorer/Backends/Postgres/PostgresRepository.cs:line 808
   at NBXplorer.Controllers.MainController.GetUnusedAddress(String cryptoCode, DerivationStrategyBase strategy, DerivationFeature feature, Int32 skip, Boolean reserve) in /source/NBXplorer/Controllers/MainController.cs:line 142
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

What browser do you use?

No response

Additional information

No response

Are you sure this is a bug report?

  • I confirm this is a bug report

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasDoriercommented, Oct 17, 2022

@anycolo just so you know: when you create a wallet you don’t have to import addresses to RPC.

0reactions
NicolasDoriercommented, Nov 14, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions and Common Issues
This document contains a Table of contents to all FAQ and common issues. ... How does BTCPay create a new address for each...
Read more >
getting HTTP error 500 when pressing Generate BTC ...
Describe the bug I'm getting HTTP error 500 in BTCPayServer, when pressing Generate BTC Address button on Wallets / Receive page.
Read more >
btcpayserver/Changelog.md at master
Fix: Shop's new receipt and cart not displaying items correctly and missing ... Can customize invoice's metadata for payments received through LN Address....
Read more >
BTCPay Server Workshop w/Pavlenex & Wouter Samaey
Bas Peters & Wouter Samaey take us through a demo to use the BTCPay Server at Bitcoin Amsterdam #day2 #bitcoinamsterdam #workshopstage ...
Read more >
Btc Wallet Out Of Sync
Whenever a new Bitcoin node comes online, it must first sync with the rest of the ... I cannot login into the Wallet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found